The masking of src.val is common to both paths. Move it later and simplify
the entry condition for adjusting the memory operand.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
}
break;
case DstBitBase:
- if ( ((d & SrcMask) == SrcImmByte) || (ea.type == OP_REG) )
- {
- src.val &= (op_bytes << 3) - 1;
- }
- else
+ if ( ea.type == OP_MEM )
{
/*
* Instructions such as bt can reference an arbitrary offset from
op_bytes + (((-src.val - 1) >> 3) & ~(op_bytes - 1L));
else
ea.mem.off += (src.val >> 3) & ~(op_bytes - 1L);
- src.val &= (op_bytes << 3) - 1;
}
+
+ /* Bit index always truncated to within range. */
+ src.val &= (op_bytes << 3) - 1;
+
d = (d & ~DstMask) | DstMem;
/* Becomes a normal DstMem operation from here on. */
case DstMem: