X86: Fix sign extension when doing an arithmetic shift right by 0.
This commit is contained in:
parent
a238959c34
commit
860f0f8350
1 changed files with 1 additions and 1 deletions
|
@ -700,7 +700,7 @@ let {{
|
||||||
// Because what happens to the bits shift -in- on a right shift
|
// Because what happens to the bits shift -in- on a right shift
|
||||||
// is not defined in the C/C++ standard, we have to sign extend
|
// is not defined in the C/C++ standard, we have to sign extend
|
||||||
// them manually to be sure.
|
// them manually to be sure.
|
||||||
uint64_t arithMask =
|
uint64_t arithMask = (shiftAmt == 0) ? 0 :
|
||||||
-bits(psrc1, dataSize * 8 - 1) << (dataSize * 8 - shiftAmt);
|
-bits(psrc1, dataSize * 8 - 1) << (dataSize * 8 - shiftAmt);
|
||||||
DestReg = merge(DestReg, (psrc1 >> shiftAmt) | arithMask, dataSize);
|
DestReg = merge(DestReg, (psrc1 >> shiftAmt) | arithMask, dataSize);
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in a new issue