|
From: <sv...@va...> - 2012-06-07 16:52:51
|
petarj 2012-06-07 17:52:41 +0100 (Thu, 07 Jun 2012)
New Revision: 2377
Log:
Small improvement for getIReg on MIPS when reading from r0.
zero register on MIPS is actually a constant, and front end should be aware of
that. MIPS port is currently tracked as bug #270777.
Modified files:
trunk/priv/guest_mips_toIR.c
Modified: trunk/priv/guest_mips_toIR.c (+7 -3)
===================================================================
--- trunk/priv/guest_mips_toIR.c 2012-06-07 09:59:53 +01:00 (rev 2376)
+++ trunk/priv/guest_mips_toIR.c 2012-06-07 17:52:41 +01:00 (rev 2377)
@@ -701,9 +701,13 @@
static IRExpr *getIReg(UInt iregNo)
{
- IRType ty = mode64 ? Ity_I64 : Ity_I32;
- vassert(iregNo < 32);
- return IRExpr_Get(integerGuestRegOffset(iregNo), ty);
+ if (0 == iregNo) {
+ return mode64 ? mkU64(0x0) : mkU32(0x0);
+ } else {
+ IRType ty = mode64 ? Ity_I64 : Ity_I32;
+ vassert(iregNo < 32);
+ return IRExpr_Get(integerGuestRegOffset(iregNo), ty);
+ }
}
static IRExpr *getHI(void)
|