This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sim/11284] New: MADDU instruction increments ACX if non-carry


MADDU instruction unexpectedly increments ACX if *non-cally* on sim.

-- test case --
TEST_MADDU:
	mflhxu	$0		/* ACX|HI|LO >>= 32 */
	mthi	$0		/* HI = 0 */
	mtlo	$0		/* LO = 0 */
	li	$t0, 1		/* T0 = 1 */
	maddu	$t0, $t0	/* ACX|HI|LO += T0 * T0 */
	mflhxu	$0		/* ACX|HI|LO >>= 32 */
CHECKPOINT:
	/* HI == 1 (HI SHOUD BE 0) */


-- proposed patch --
$ diff -c sim/mips/mips.igen
Index: sim/mips/mips.igen
===============================================================
====
RCS file: /cvs/src/src/sim/mips/mips.igen,v
retrieving revision 1.68
diff -c -r1.68 mips.igen
*** sim/mips/mips.igen	22 Oct 2007 20:02:25 -0000	1.68
--- sim/mips/mips.igen	15 Feb 2010 05:51:25 -0000
***************
*** 2482,2488 ****
    TRACE_ALU_INPUT2 (GPR[RS], GPR[RT]);
    temp = (U8_4 (VL4_8 (HI), VL4_8 (LO))
            + ((unsigned64) VL4_8 (GPR[RS]) * (unsigned64) VL4_8 (GPR[RT])));
!   ACX += U8_4 (VL4_8 (HI), VL4_8 (LO)) < temp;  /* SmartMIPS */ 
    LO = EXTEND32 (temp);
    HI = EXTEND32 (VH4_8 (temp));
    TRACE_ALU_RESULT2 (HI, LO);
--- 2482,2488 ----
    TRACE_ALU_INPUT2 (GPR[RS], GPR[RT]);
    temp = (U8_4 (VL4_8 (HI), VL4_8 (LO))
            + ((unsigned64) VL4_8 (GPR[RS]) * (unsigned64) VL4_8 (GPR[RT])));
!   ACX += U8_4 (VL4_8 (HI), VL4_8 (LO)) > temp;  /* SmartMIPS */ 
    LO = EXTEND32 (temp);
    HI = EXTEND32 (VH4_8 (temp));
    TRACE_ALU_RESULT2 (HI, LO);
***************
*** 2505,2511 ****
    temp = (U8_4 (VL4_8 (DSPHI(AC)), VL4_8 (DSPLO(AC)))
  	  + ((unsigned64) VL4_8 (GPR[RS]) * (unsigned64) VL4_8 (GPR[RT])));
    if (AC == 0)
!     ACX += U8_4 (VL4_8 (HI), VL4_8 (LO)) < temp;  /* SmartMIPS */
    DSPLO(AC) = EXTEND32 (temp);
    DSPHI(AC) = EXTEND32 (VH4_8 (temp));
    if (AC == 0)
--- 2505,2511 ----
    temp = (U8_4 (VL4_8 (DSPHI(AC)), VL4_8 (DSPLO(AC)))
  	  + ((unsigned64) VL4_8 (GPR[RS]) * (unsigned64) VL4_8 (GPR[RT])));
    if (AC == 0)
!     ACX += U8_4 (VL4_8 (HI), VL4_8 (LO)) > temp;  /* SmartMIPS */
    DSPLO(AC) = EXTEND32 (temp);
    DSPHI(AC) = EXTEND32 (VH4_8 (temp));
    if (AC == 0)
$

-- 
           Summary: MADDU instruction increments ACX if non-carry
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: sim
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: kiyoshi dot coquser at gmail dot com
                CC: gdb-prs at sourceware dot org
  GCC host triplet: i386-apple-darwin10.2.0
GCC target triplet: mipsisa32-elf


http://sourceware.org/bugzilla/show_bug.cgi?id=11284

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]