#define ACTIONS_ADD(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
- argL = CC_DEP1; \
- argR = CC_DEP2; \
- res = argL + argR; \
- cf = (DATA_UTYPE)res < (DATA_UTYPE)argL; \
- pf = parity_table[(UChar)res]; \
- af = (res ^ argL ^ argR) & 0x10; \
- zf = ((DATA_UTYPE)res == 0) << 6; \
- sf = lshift(res, 8 - DATA_BITS) & 0x80; \
- of = lshift((argL ^ argR ^ -1) & (argL ^ res), \
- 12 - DATA_BITS) & CC_MASK_O; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ Int argL, argR, res; \
+ argL = CC_DEP1; \
+ argR = CC_DEP2; \
+ res = argL + argR; \
+ cf = (DATA_UTYPE)res < (DATA_UTYPE)argL; \
+ pf = parity_table[(UChar)res]; \
+ af = (res ^ argL ^ argR) & 0x10; \
+ zf = ((DATA_UTYPE)res == 0) << 6; \
+ sf = lshift(res, 8 - DATA_BITS) & 0x80; \
+ of = lshift((argL ^ argR ^ -1) & (argL ^ res), \
+ 12 - DATA_BITS) & CC_MASK_O; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_SUB(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
- argL = CC_DEP1; \
- argR = CC_DEP2; \
- res = argL - argR; \
- cf = (DATA_UTYPE)argL < (DATA_UTYPE)argR; \
- pf = parity_table[(UChar)res]; \
- af = (res ^ argL ^ argR) & 0x10; \
- zf = ((DATA_UTYPE)res == 0) << 6; \
- sf = lshift(res, 8 - DATA_BITS) & 0x80; \
- of = lshift((argL ^ argR) & (argL ^ res), \
- 12 - DATA_BITS) & CC_MASK_O; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ Int argL, argR, res; \
+ argL = CC_DEP1; \
+ argR = CC_DEP2; \
+ res = argL - argR; \
+ cf = (DATA_UTYPE)argL < (DATA_UTYPE)argR; \
+ pf = parity_table[(UChar)res]; \
+ af = (res ^ argL ^ argR) & 0x10; \
+ zf = ((DATA_UTYPE)res == 0) << 6; \
+ sf = lshift(res, 8 - DATA_BITS) & 0x80; \
+ of = lshift((argL ^ argR) & (argL ^ res), \
+ 12 - DATA_BITS) & CC_MASK_O; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_ADC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- Int argL, argR, oldC, res; \
- oldC = CC_NDEP & CC_MASK_C; \
- argL = CC_DEP1; \
- argR = CC_DEP2 ^ oldC; \
- res = (argL + argR) + oldC; \
- if (oldC) \
- cf = (DATA_UTYPE)res <= (DATA_UTYPE)argL; \
- else \
- cf = (DATA_UTYPE)res < (DATA_UTYPE)argL; \
- pf = parity_table[(UChar)res]; \
- af = (res ^ argL ^ argR) & 0x10; \
- zf = ((DATA_UTYPE)res == 0) << 6; \
- sf = lshift(res, 8 - DATA_BITS) & 0x80; \
- of = lshift((argL ^ argR ^ -1) & (argL ^ res), \
- 12 - DATA_BITS) & CC_MASK_O; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ Int argL, argR, oldC, res; \
+ oldC = CC_NDEP & CC_MASK_C; \
+ argL = CC_DEP1; \
+ argR = CC_DEP2 ^ oldC; \
+ res = (argL + argR) + oldC; \
+ if (oldC) \
+ cf = (DATA_UTYPE)res <= (DATA_UTYPE)argL; \
+ else \
+ cf = (DATA_UTYPE)res < (DATA_UTYPE)argL; \
+ pf = parity_table[(UChar)res]; \
+ af = (res ^ argL ^ argR) & 0x10; \
+ zf = ((DATA_UTYPE)res == 0) << 6; \
+ sf = lshift(res, 8 - DATA_BITS) & 0x80; \
+ of = lshift((argL ^ argR ^ -1) & (argL ^ res), \
+ 12 - DATA_BITS) & CC_MASK_O; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_SBB(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- Int argL, argR, oldC, res; \
- oldC = CC_NDEP & CC_MASK_C; \
- argL = CC_DEP1; \
- argR = CC_DEP2 ^ oldC; \
- res = (argL - argR) - oldC; \
- if (oldC) \
- cf = (DATA_UTYPE)argL <= (DATA_UTYPE)argR; \
- else \
- cf = (DATA_UTYPE)argL < (DATA_UTYPE)argR; \
- pf = parity_table[(UChar)res]; \
- af = (res ^ argL ^ argR) & 0x10; \
- zf = ((DATA_UTYPE)res == 0) << 6; \
- sf = lshift(res, 8 - DATA_BITS) & 0x80; \
- of = lshift((argL ^ argR) & (argL ^ res), \
- 12 - DATA_BITS) & CC_MASK_O; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ Int argL, argR, oldC, res; \
+ oldC = CC_NDEP & CC_MASK_C; \
+ argL = CC_DEP1; \
+ argR = CC_DEP2 ^ oldC; \
+ res = (argL - argR) - oldC; \
+ if (oldC) \
+ cf = (DATA_UTYPE)argL <= (DATA_UTYPE)argR; \
+ else \
+ cf = (DATA_UTYPE)argL < (DATA_UTYPE)argR; \
+ pf = parity_table[(UChar)res]; \
+ af = (res ^ argL ^ argR) & 0x10; \
+ zf = ((DATA_UTYPE)res == 0) << 6; \
+ sf = lshift(res, 8 - DATA_BITS) & 0x80; \
+ of = lshift((argL ^ argR) & (argL ^ res), \
+ 12 - DATA_BITS) & CC_MASK_O; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_LOGIC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- cf = 0; \
- pf = parity_table[(UChar)CC_DEP1]; \
- af = 0; \
- zf = ((DATA_UTYPE)CC_DEP1 == 0) << 6; \
- sf = lshift(CC_DEP1, 8 - DATA_BITS) & 0x80; \
- of = 0; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ cf = 0; \
+ pf = parity_table[(UChar)CC_DEP1]; \
+ af = 0; \
+ zf = ((DATA_UTYPE)CC_DEP1 == 0) << 6; \
+ sf = lshift(CC_DEP1, 8 - DATA_BITS) & 0x80; \
+ of = 0; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_INC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
- res = CC_DEP1; \
- argL = res - 1; \
- argR = 1; \
- cf = CC_NDEP & CC_MASK_C; \
- pf = parity_table[(UChar)res]; \
- af = (res ^ argL ^ argR) & 0x10; \
- zf = ((DATA_UTYPE)res == 0) << 6; \
- sf = lshift(res, 8 - DATA_BITS) & 0x80; \
- of = ((res & DATA_MASK) == SIGN_MASK) << 11; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ Int argL, argR, res; \
+ res = CC_DEP1; \
+ argL = res - 1; \
+ argR = 1; \
+ cf = CC_NDEP & CC_MASK_C; \
+ pf = parity_table[(UChar)res]; \
+ af = (res ^ argL ^ argR) & 0x10; \
+ zf = ((DATA_UTYPE)res == 0) << 6; \
+ sf = lshift(res, 8 - DATA_BITS) & 0x80; \
+ of = ((res & DATA_MASK) == SIGN_MASK) << 11; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_DEC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
- res = CC_DEP1; \
- argL = res + 1; \
- argR = 1; \
- cf = CC_NDEP & CC_MASK_C; \
- pf = parity_table[(UChar)res]; \
- af = (res ^ argL ^ argR) & 0x10; \
- zf = ((DATA_UTYPE)res == 0) << 6; \
- sf = lshift(res, 8 - DATA_BITS) & 0x80; \
- of = ((res & DATA_MASK) \
- == ((UInt)SIGN_MASK - 1)) << 11; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ Int argL, argR, res; \
+ res = CC_DEP1; \
+ argL = res + 1; \
+ argR = 1; \
+ cf = CC_NDEP & CC_MASK_C; \
+ pf = parity_table[(UChar)res]; \
+ af = (res ^ argL ^ argR) & 0x10; \
+ zf = ((DATA_UTYPE)res == 0) << 6; \
+ sf = lshift(res, 8 - DATA_BITS) & 0x80; \
+ of = ((res & DATA_MASK) \
+ == ((UInt)SIGN_MASK - 1)) << 11; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_SHL(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- cf = (CC_DEP2 >> (DATA_BITS - 1)) & CC_MASK_C; \
- pf = parity_table[(UChar)CC_DEP1]; \
- af = 0; /* undefined */ \
- zf = ((DATA_UTYPE)CC_DEP1 == 0) << 6; \
- sf = lshift(CC_DEP1, 8 - DATA_BITS) & 0x80; \
- /* of is defined if shift count == 1 */ \
- of = lshift(CC_DEP2 ^ CC_DEP1, 12 - DATA_BITS) & CC_MASK_O; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ cf = (CC_DEP2 >> (DATA_BITS - 1)) & CC_MASK_C; \
+ pf = parity_table[(UChar)CC_DEP1]; \
+ af = 0; /* undefined */ \
+ zf = ((DATA_UTYPE)CC_DEP1 == 0) << 6; \
+ sf = lshift(CC_DEP1, 8 - DATA_BITS) & 0x80; \
+ /* of is defined if shift count == 1 */ \
+ of = lshift(CC_DEP2 ^ CC_DEP1, 12 - DATA_BITS) & CC_MASK_O;\
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_SHR(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- cf = CC_DEP2 & 1; \
- pf = parity_table[(UChar)CC_DEP1]; \
- af = 0; /* undefined */ \
- zf = ((DATA_UTYPE)CC_DEP1 == 0) << 6; \
- sf = lshift(CC_DEP1, 8 - DATA_BITS) & 0x80; \
- /* of is defined if shift count == 1 */ \
- of = lshift(CC_DEP2 ^ CC_DEP1, 12 - DATA_BITS) & CC_MASK_O; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ cf = CC_DEP2 & 1; \
+ pf = parity_table[(UChar)CC_DEP1]; \
+ af = 0; /* undefined */ \
+ zf = ((DATA_UTYPE)CC_DEP1 == 0) << 6; \
+ sf = lshift(CC_DEP1, 8 - DATA_BITS) & 0x80; \
+ /* of is defined if shift count == 1 */ \
+ of = lshift(CC_DEP2 ^ CC_DEP1, 12 - DATA_BITS) & CC_MASK_O;\
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_ROL(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int fl \
- = (CC_NDEP & ~(CC_MASK_O | CC_MASK_C)) \
- | (CC_MASK_C & CC_DEP1) \
- | (CC_MASK_O & (lshift(CC_DEP1, 11-(DATA_BITS-1)) \
- ^ lshift(CC_DEP1, 11))); \
- return fl; \
+ { Int fl \
+ = (CC_NDEP & ~(CC_MASK_O | CC_MASK_C)) \
+ | (CC_MASK_C & CC_DEP1) \
+ | (CC_MASK_O & (lshift(CC_DEP1, 11-(DATA_BITS-1)) \
+ ^ lshift(CC_DEP1, 11))); \
+ return fl; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_ROR(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int fl \
- = (CC_NDEP & ~(CC_MASK_O | CC_MASK_C)) \
- | (CC_MASK_C & (CC_DEP1 >> (DATA_BITS-1))) \
- | (CC_MASK_O & (lshift(CC_DEP1, 11-(DATA_BITS-1)) \
- ^ lshift(CC_DEP1, 11-(DATA_BITS-1)+1))); \
- return fl; \
+ { Int fl \
+ = (CC_NDEP & ~(CC_MASK_O | CC_MASK_C)) \
+ | (CC_MASK_C & (CC_DEP1 >> (DATA_BITS-1))) \
+ | (CC_MASK_O & (lshift(CC_DEP1, 11-(DATA_BITS-1)) \
+ ^ lshift(CC_DEP1, 11-(DATA_BITS-1)+1))); \
+ return fl; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_UMUL(DATA_BITS,DATA_UTYPE,DATA_U2TYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- DATA_UTYPE hi; \
- DATA_UTYPE lo = ((DATA_UTYPE)CC_DEP1) \
- * ((DATA_UTYPE)CC_DEP2); \
- DATA_U2TYPE rr = ((DATA_U2TYPE)((DATA_UTYPE)CC_DEP1)) \
- * ((DATA_U2TYPE)((DATA_UTYPE)CC_DEP2)); \
- hi = (DATA_UTYPE)(rr >>/*u*/ DATA_BITS); \
- cf = (hi != 0); \
- pf = parity_table[(UChar)lo]; \
- af = 0; /* undefined */ \
- zf = (lo == 0) << 6; \
- sf = lshift(lo, 8 - DATA_BITS) & 0x80; \
- of = cf << 11; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ DATA_UTYPE hi; \
+ DATA_UTYPE lo = ((DATA_UTYPE)CC_DEP1) \
+ * ((DATA_UTYPE)CC_DEP2); \
+ DATA_U2TYPE rr = ((DATA_U2TYPE)((DATA_UTYPE)CC_DEP1)) \
+ * ((DATA_U2TYPE)((DATA_UTYPE)CC_DEP2)); \
+ hi = (DATA_UTYPE)(rr >>/*u*/ DATA_BITS); \
+ cf = (hi != 0); \
+ pf = parity_table[(UChar)lo]; \
+ af = 0; /* undefined */ \
+ zf = (lo == 0) << 6; \
+ sf = lshift(lo, 8 - DATA_BITS) & 0x80; \
+ of = cf << 11; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/*-------------------------------------------------------------*/
#define ACTIONS_SMUL(DATA_BITS,DATA_STYPE,DATA_S2TYPE) \
{ \
PREAMBLE(DATA_BITS); \
- Int cf, pf, af, zf, sf, of; \
- DATA_STYPE hi; \
- DATA_STYPE lo = ((DATA_STYPE)CC_DEP1) \
- * ((DATA_STYPE)CC_DEP2); \
- DATA_S2TYPE rr = ((DATA_S2TYPE)((DATA_STYPE)CC_DEP1)) \
- * ((DATA_S2TYPE)((DATA_STYPE)CC_DEP2)); \
- hi = (DATA_STYPE)(rr >>/*s*/ DATA_BITS); \
- cf = (hi != (lo >>/*s*/ (DATA_BITS-1))); \
- pf = parity_table[(UChar)lo]; \
- af = 0; /* undefined */ \
- zf = (lo == 0) << 6; \
- sf = lshift(lo, 8 - DATA_BITS) & 0x80; \
- of = cf << 11; \
- return cf | pf | af | zf | sf | of; \
+ { Int cf, pf, af, zf, sf, of; \
+ DATA_STYPE hi; \
+ DATA_STYPE lo = ((DATA_STYPE)CC_DEP1) \
+ * ((DATA_STYPE)CC_DEP2); \
+ DATA_S2TYPE rr = ((DATA_S2TYPE)((DATA_STYPE)CC_DEP1)) \
+ * ((DATA_S2TYPE)((DATA_STYPE)CC_DEP2)); \
+ hi = (DATA_STYPE)(rr >>/*s*/ DATA_BITS); \
+ cf = (hi != (lo >>/*s*/ (DATA_BITS-1))); \
+ pf = parity_table[(UChar)lo]; \
+ af = 0; /* undefined */ \
+ zf = (lo == 0) << 6; \
+ sf = lshift(lo, 8 - DATA_BITS) & 0x80; \
+ of = cf << 11; \
+ return cf | pf | af | zf | sf | of; \
+ } \
}
/* flags thunk: OP and NDEP are always defd, whereas DEP1
and DEP2 have to be tracked. See detailed comment in
gdefs.h on meaning of thunk fields. */
- .alwaysDefd[0] = ALWAYSDEFD(guest_CC_OP),
- .alwaysDefd[1] = ALWAYSDEFD(guest_CC_NDEP),
-
- .alwaysDefd[2] = ALWAYSDEFD(guest_DFLAG),
- .alwaysDefd[3] = ALWAYSDEFD(guest_IDFLAG),
- .alwaysDefd[4] = ALWAYSDEFD(guest_EIP),
- .alwaysDefd[5] = ALWAYSDEFD(guest_FTOP),
- .alwaysDefd[6] = ALWAYSDEFD(guest_FPTAG),
- .alwaysDefd[7] = ALWAYSDEFD(guest_FPUCW),
- .alwaysDefd[8] = ALWAYSDEFD(guest_FC3210),
- .alwaysDefd[9] = ALWAYSDEFD(guest_CS),
- .alwaysDefd[10] = ALWAYSDEFD(guest_DS),
- .alwaysDefd[11] = ALWAYSDEFD(guest_ES),
- .alwaysDefd[12] = ALWAYSDEFD(guest_FS),
- .alwaysDefd[13] = ALWAYSDEFD(guest_GS),
- .alwaysDefd[14] = ALWAYSDEFD(guest_SS)
+
+ .alwaysDefd
+ = { /* 0 */ ALWAYSDEFD(guest_CC_OP),
+ /* 1 */ ALWAYSDEFD(guest_CC_NDEP),
+ /* 2 */ ALWAYSDEFD(guest_DFLAG),
+ /* 3 */ ALWAYSDEFD(guest_IDFLAG),
+ /* 4 */ ALWAYSDEFD(guest_EIP),
+ /* 5 */ ALWAYSDEFD(guest_FTOP),
+ /* 6 */ ALWAYSDEFD(guest_FPTAG),
+ /* 7 */ ALWAYSDEFD(guest_FPUCW),
+ /* 8 */ ALWAYSDEFD(guest_FC3210),
+ /* 9 */ ALWAYSDEFD(guest_CS),
+ /* 10 */ ALWAYSDEFD(guest_DS),
+ /* 11 */ ALWAYSDEFD(guest_ES),
+ /* 12 */ ALWAYSDEFD(guest_FS),
+ /* 13 */ ALWAYSDEFD(guest_GS),
+ /* 14 */ ALWAYSDEFD(guest_SS)
+ }
};
static IRAtom* mkPCastTo( MCEnv* mce, IRType dst_ty, IRAtom* vbits )
{
+ IRType ty;
+ IRAtom* tmp1;
/* Note, dst_ty is a shadow type, not an original type. */
/* First of all, collapse vbits down to a single bit. */
sk_assert(isShadowAtom(mce,vbits));
- IRType ty = typeOfIRExpr(mce->bb->tyenv, vbits);
- IRAtom* tmp1 = NULL;
+ ty = typeOfIRExpr(mce->bb->tyenv, vbits);
+ tmp1 = NULL;
switch (ty) {
case Ity_I1:
tmp1 = vbits;
*/
static void complainIfUndefined ( MCEnv* mce, IRAtom* atom )
{
+ Int sz;
+ IRType ty;
+ IRAtom* vatom;
+ IRAtom* cond;
+ IRDirty* di;
+
/* Since the original expression is atomic, there's no duplicated
work generated by making multiple V-expressions for it. So we
don't really care about the possibility that someone else may
also create a V-interpretion for it. */
sk_assert(isOriginalAtom(mce, atom));
- IRAtom* vatom = expr2vbits( mce, atom );
+ vatom = expr2vbits( mce, atom );
sk_assert(isShadowAtom(mce, vatom));
sk_assert(sameKindedAtoms(atom, vatom));
- IRType ty = typeOfIRExpr(mce->bb->tyenv, vatom);
+ ty = typeOfIRExpr(mce->bb->tyenv, vatom);
/* sz is only used for constructing the error message */
- Int sz = ty==Ity_I1 ? 0 : sizeofIRType(ty);
+ sz = ty==Ity_I1 ? 0 : sizeofIRType(ty);
- IRAtom* cond = mkPCastTo( mce, Ity_I1, vatom );
+ cond = mkPCastTo( mce, Ity_I1, vatom );
/* cond will be 0 if all defined, and 1 if any not defined. */
- IRDirty* di;
switch (sz) {
case 0:
di = unsafeIRDirty_0_N( 0/*regparms*/,
void do_shadow_PUT ( MCEnv* mce, Int offset,
IRAtom* atom, IRAtom* vatom )
{
+ IRType ty;
if (atom) {
sk_assert(!vatom);
sk_assert(isOriginalAtom(mce, atom));
sk_assert(isShadowAtom(mce, vatom));
}
- IRType ty = typeOfIRExpr(mce->bb->tyenv, vatom);
+ ty = typeOfIRExpr(mce->bb->tyenv, vatom);
sk_assert(ty != Ity_I1);
if (isAlwaysDefd(mce, offset, sizeofIRType(ty))) {
/* later: no ... */
void do_shadow_PUTI ( MCEnv* mce,
IRArray* descr, IRAtom* ix, Int bias, IRAtom* atom )
{
+ IRAtom* vatom;
+ IRType ty, tyS;
+ Int arrSize;
+
sk_assert(isOriginalAtom(mce,atom));
- IRAtom* vatom = expr2vbits( mce, atom );
+ vatom = expr2vbits( mce, atom );
sk_assert(sameKindedAtoms(atom, vatom));
- IRType ty = descr->elemTy;
- IRType tyS = shadowType(ty);
- Int arrSize = descr->nElems * sizeofIRType(ty);
+ ty = descr->elemTy;
+ tyS = shadowType(ty);
+ arrSize = descr->nElems * sizeofIRType(ty);
sk_assert(ty != Ity_I1);
sk_assert(isOriginalAtom(mce,ix));
complainIfUndefined(mce,ix);
IRAtom* expensiveAdd32 ( MCEnv* mce, IRAtom* qaa, IRAtom* qbb,
IRAtom* aa, IRAtom* bb )
{
+ IRType ty;
+ IROp opAND, opOR, opXOR, opNOT, opADD;
+ IRAtom *a_min, *b_min, *a_max, *b_max;
+
sk_assert(isShadowAtom(mce,qaa));
sk_assert(isShadowAtom(mce,qbb));
sk_assert(isOriginalAtom(mce,aa));
sk_assert(sameKindedAtoms(qaa,aa));
sk_assert(sameKindedAtoms(qbb,bb));
- IRType ty = Ity_I32;
- IROp opAND = Iop_And32;
- IROp opOR = Iop_Or32;
- IROp opXOR = Iop_Xor32;
- IROp opNOT = Iop_Not32;
- IROp opADD = Iop_Add32;
-
- IRAtom *a_min, *b_min, *a_max, *b_max;
+ ty = Ity_I32;
+ opAND = Iop_And32;
+ opOR = Iop_Or32;
+ opXOR = Iop_Xor32;
+ opNOT = Iop_Not32;
+ opADD = Iop_Add32;
// a_min = aa & ~qaa
a_min = assignNew(mce,ty,
addrAct = addr;
} else {
IRType tyAddr = mce->hWordTy;
- sk_assert( tyAddr == Ity_I32 || tyAddr == Ity_I64 );
IROp mkAdd = tyAddr==Ity_I32 ? Iop_Add32 : Iop_Add64;
IRAtom* eBias = tyAddr==Ity_I32 ? mkU32(bias) : mkU64(bias);
+ sk_assert( tyAddr == Ity_I32 || tyAddr == Ity_I64 );
addrAct = assignNew(mce, tyAddr, binop(mkAdd, addr, eBias) );
}
static
IRExpr* zwidenToHostWord ( MCEnv* mce, IRAtom* vatom )
{
- /* vatom is vbits-value and as such can only have a shadow type. */
- sk_assert(isShadowAtom(mce,vatom));
-
IRType ty = typeOfIRExpr(mce->bb->tyenv, vatom);
IRType tyH = mce->hWordTy;
+ /* vatom is vbits-value and as such can only have a shadow type. */
+ sk_assert(isShadowAtom(mce,vatom));
+
if (tyH == Ity_I32) {
switch (ty) {
case Ity_I32: return vatom;
addrAct = addr;
} else {
IRType tyAddr = mce->hWordTy;
- sk_assert( tyAddr == Ity_I32 || tyAddr == Ity_I64 );
IROp mkAdd = tyAddr==Ity_I32 ? Iop_Add32 : Iop_Add64;
IRAtom* eBias = tyAddr==Ity_I32 ? mkU32(bias) : mkU64(bias);
+ sk_assert( tyAddr == Ity_I32 || tyAddr == Ity_I64 );
addrAct = assignNew(mce, tyAddr, binop(mkAdd, addr, eBias) );
}
IRAtom* src;
IRType tyAddr, tySrc, tyDst;
IRTemp dst;
+ IRAtom *here, *curr;
/* First check the guard. */
complainIfUndefined(mce, d->guard);
/* Now round up all inputs and PCast over them. */
- IRAtom* here;
- IRAtom* curr = definedOfType(Ity_I32);
+ curr = definedOfType(Ity_I32);
/* Inputs: unmasked args */
for (i = 0; d->args[i]; i++) {