arch-x86: Movfp account for dataSize=4 (#1024)

Movfp instruction did not account for only copying the lower half of src
register if dataSize is 4.
GitHub Issue: #893 
I used the test code in issue #893 to verify the fix is working.
This commit is contained in:
Ivana Mitrovic
2024-04-18 10:36:00 -07:00
committed by GitHub

View File

@@ -257,7 +257,14 @@ let {{
super().__init__(reg1, reg2, reg3, **kwargs)
class Movfp(Fp2Op):
code = 'FpDestReg_uqw = FpSrcReg1_uqw;'
code = '''
if (dataSize == 4) {
FpDestReg_uqw = mbits(FpDestReg_uqw, 63, 32) |
mbits(FpSrcReg1_uqw, 31, 0);
} else {
FpDestReg_uqw = FpSrcReg1_uqw;
}
'''
else_code = 'FpDestReg_uqw = FpDestReg_uqw;'
cond_check = "checkCondition(ccFlagBits | cfofBits | dfBit | \
ecfBit | ezfBit, src1)"