assign(src, getIRegG(size,pfx,rm));
if (addSubCarry && op8 == Iop_Add8) {
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
/* cas-style store */
helper_ADC( size, dst1, dst0, src,
/*store*/addr, dst0/*expVal*/, guest_RIP_curr_instr );
}
} else
if (addSubCarry && op8 == Iop_Sub8) {
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
/* cas-style store */
helper_SBB( size, dst1, dst0, src,
/*store*/addr, dst0/*expVal*/, guest_RIP_curr_instr );
} else {
assign(dst1, binop(mkSizedOp(ty,op8), mkexpr(dst0), mkexpr(src)));
if (keep) {
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
if (0) vex_printf("locked case\n" );
casLE( mkexpr(addr),
mkexpr(dst0)/*expval*/,
assign(src, mkU(ty,d64 & mask));
if (gregLO3ofRM(modrm) == 2 /* ADC */) {
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
/* cas-style store */
helper_ADC( sz, dst1, dst0, src,
/*store*/addr, dst0/*expVal*/, guest_RIP_curr_instr );
}
} else
if (gregLO3ofRM(modrm) == 3 /* SBB */) {
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
/* cas-style store */
helper_SBB( sz, dst1, dst0, src,
/*store*/addr, dst0/*expVal*/, guest_RIP_curr_instr );
} else {
assign(dst1, binop(mkSizedOp(ty,op8), mkexpr(dst0), mkexpr(src)));
if (gregLO3ofRM(modrm) < 7) {
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(addr), mkexpr(dst0)/*expVal*/,
mkexpr(dst1)/*newVal*/,
guest_RIP_curr_instr );
if (epartIsReg(modrm)) {
putIRegE(sz, pfx, modrm, narrowTo(ty, mkexpr(t2m)));
} else {
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(t_addr),
narrowTo(ty, mkexpr(t2))/*expd*/,
narrowTo(ty, mkexpr(t2m))/*new*/,
case 2: /* NOT */
dst1 = newTemp(ty);
assign(dst1, unop(mkSizedOp(ty,Iop_Not8), mkexpr(t1)));
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(addr), mkexpr(t1)/*expd*/, mkexpr(dst1)/*new*/,
guest_RIP_curr_instr );
} else {
assign(src, mkexpr(t1));
assign(dst1, binop(mkSizedOp(ty,Iop_Sub8), mkexpr(dst0),
mkexpr(src)));
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(addr), mkexpr(t1)/*expd*/, mkexpr(dst1)/*new*/,
guest_RIP_curr_instr );
} else {
switch (gregLO3ofRM(modrm)) {
case 0: /* INC */
assign(t2, binop(Iop_Add8, mkexpr(t1), mkU8(1)));
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(addr), mkexpr(t1)/*expd*/, mkexpr(t2)/*new*/,
guest_RIP_curr_instr );
} else {
break;
case 1: /* DEC */
assign(t2, binop(Iop_Sub8, mkexpr(t1), mkU8(1)));
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(addr), mkexpr(t1)/*expd*/, mkexpr(t2)/*new*/,
guest_RIP_curr_instr );
} else {
t2 = newTemp(ty);
assign(t2, binop(mkSizedOp(ty,Iop_Add8),
mkexpr(t1), mkU(ty,1)));
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(addr),
mkexpr(t1), mkexpr(t2), guest_RIP_curr_instr );
} else {
t2 = newTemp(ty);
assign(t2, binop(mkSizedOp(ty,Iop_Sub8),
mkexpr(t1), mkU(ty,1)));
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
casLE( mkexpr(addr),
mkexpr(t1), mkexpr(t2), guest_RIP_curr_instr );
} else {
default:
vpanic("dis_bt_G_E(amd64)");
}
- if ((pfx & PFX_LOCK) && !epartIsReg(modrm)) {
+ if ((haveLOCK(pfx)) && !epartIsReg(modrm)) {
casLE( mkexpr(t_addr1), mkexpr(t_fetched)/*expd*/,
mkexpr(t_new)/*new*/,
guest_RIP_curr_instr );
nameIRegG(size,pfx,rm),
nameIRegE(size,pfx,rm) );
}
- else if (!epartIsReg(rm) && !(pfx & PFX_LOCK)) {
+ else if (!epartIsReg(rm) && !haveLOCK(pfx)) {
/* case 2 */
addr = disAMode ( &len, vbi, pfx, delta0, dis_buf, 0 );
assign( dest, loadLE(ty, mkexpr(addr)) );
DIP("cmpxchg%c %s,%s\n", nameISize(size),
nameIRegG(size,pfx,rm), dis_buf);
}
- else if (!epartIsReg(rm) && (pfx & PFX_LOCK)) {
+ else if (!epartIsReg(rm) && haveLOCK(pfx)) {
/* case 3 */
/* src is new value. acc is expected value. dest is old value.
Compute success from the output of the IRCAS, and steer the
*decode_ok = True;
return 1+delta0;
}
- else if (!epartIsReg(rm) && !(pfx & PFX_LOCK)) {
+ else if (!epartIsReg(rm) && !haveLOCK(pfx)) {
/* case 2 */
IRTemp addr = disAMode ( &len, vbi, pfx, delta0, dis_buf, 0 );
assign( tmpd, loadLE(ty, mkexpr(addr)) );
*decode_ok = True;
return len+delta0;
}
- else if (!epartIsReg(rm) && (pfx & PFX_LOCK)) {
+ else if (!epartIsReg(rm) && haveLOCK(pfx)) {
/* case 3 */
IRTemp addr = disAMode ( &len, vbi, pfx, delta0, dis_buf, 0 );
assign( tmpd, loadLE(ty, mkexpr(addr)) );
/* Now we should be looking at the primary opcode byte or the
leading escapes. Check that any LOCK prefix is actually
allowed. */
- if (pfx & PFX_LOCK) {
+ if (haveLOCK(pfx)) {
if (can_be_used_with_LOCK_prefix( (UChar*)&guest_code[delta] )) {
DIP("lock ");
} else {