This is the mail archive of the gdb-patches@sources.redhat.com 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]

[applied mips sim patch] use EXTENDnn rather than SIGNEXTENDmacro.


Better to use the sim/common macros than local ones, if there's no
real difference in effect.

passes --target=mips64-elf check-gcc et al., from host x86-linux.


cgd
===================================================================
2002-03-02  Chris Demetriou  <cgd@broadcom.com>

	* interp.c (load_word): Use EXTEND32 rather than SIGNEXTEND.
	* mips.igen (LL, CxC1, MxC1): Likewise.

Index: interp.c
===================================================================
RCS file: /cvs/src/src/sim/mips/interp.c,v
retrieving revision 1.7
diff -u -r1.7 interp.c
--- interp.c	2002/03/01 19:55:42	1.7
+++ interp.c	2002/03/03 02:48:19
@@ -1426,7 +1426,7 @@
 	  LoadMemory (&memval,NULL,uncached, AccessLength_WORD, paddr, vaddr,
 			       isDATA, isREAL);
 	  byte = (vaddr & mask) ^ (bigend << 2);
-	  return SIGNEXTEND (((memval >> (8 * byte)) & 0xffffffff), 32);
+	  return EXTEND32 (memval >> (8 * byte));
 	}
     }
 
Index: mips.igen
===================================================================
RCS file: /cvs/src/src/sim/mips/mips.igen,v
retrieving revision 1.25
diff -u -r1.25 mips.igen
--- mips.igen	2002/03/03 02:11:23	1.25
+++ mips.igen	2002/03/03 02:48:19
@@ -1716,7 +1716,7 @@
 	    paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
 	    LoadMemory(&memval,&memval1,uncached,AccessLength_WORD,paddr,vaddr,isDATA,isREAL);
 	    byte = ((vaddr & mask) ^ (bigend << shift));
-	    GPR[RT] = (SIGNEXTEND(((memval >> (8 * byte)) & 0xFFFFFFFF),32));
+	    GPR[RT] = EXTEND32 (memval >> (8 * byte));
 	    LLBIT = 1;
 	  }
       }
@@ -3269,9 +3269,9 @@
   else
     { /* control from */
       if (FS == 0)
- 	PENDING_FILL(RT,SIGNEXTEND(FCR0,32));
+ 	PENDING_FILL(RT, EXTEND32 (FCR0));
       else if (FS == 31)
- 	PENDING_FILL(RT,SIGNEXTEND(FCR31,32));
+ 	PENDING_FILL(RT, EXTEND32 (FCR31));
       /* else NOP */
     }
 }
@@ -3310,12 +3310,12 @@
       if (FS == 0)
 	{
 	  TRACE_ALU_INPUT1 (FCR0);
-	  GPR[RT] = SIGNEXTEND (FCR0, 32);
+	  GPR[RT] = EXTEND32 (FCR0);
 	}
       else if (FS == 31)
 	{
 	  TRACE_ALU_INPUT1 (FCR31);
-	  GPR[RT] = SIGNEXTEND (FCR31, 32);
+	  GPR[RT] = EXTEND32 (FCR31);
 	}
       TRACE_ALU_RESULT (GPR[RT]);
       /* else NOP */
@@ -3656,7 +3656,7 @@
 	PENDING_FILL ((FS + FGRIDX), VL4_8(GPR[RT]));
     }
   else /*MFC1*/
-    PENDING_FILL (RT, SIGNEXTEND(FGR[FS],32));
+    PENDING_FILL (RT, EXTEND32 (FGR[FS]));
 }
 010001,00,X,00,5.RT,5.FS,00000000000:COP1Sb:32,f::MxC1
 "m%s<X>c1 r<RT>, f<FS>"
@@ -3672,7 +3672,7 @@
     /*MTC1*/
     StoreFPR (FS, fmt_uninterpreted_32, VL4_8 (GPR[RT]));
   else /*MFC1*/
-    GPR[RT] = SIGNEXTEND(FGR[FS],32);
+    GPR[RT] = EXTEND32 (FGR[FS]);
 }
 
 


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