mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-03 00:33:09 +00:00
Bug fix: sign-extension was not happening for C = -MININT since C == -C!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6332 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f6bcd1b6bf
commit
c2f0939320
@ -142,8 +142,9 @@ CreateSETSWConst(const TargetMachine& target, int32_t C,
|
|||||||
// Set the low 32 bits of dest
|
// Set the low 32 bits of dest
|
||||||
CreateSETUWConst(target, (uint32_t) C, dest, mvec, /*isSigned*/true);
|
CreateSETUWConst(target, (uint32_t) C, dest, mvec, /*isSigned*/true);
|
||||||
|
|
||||||
// Sign-extend to the high 32 bits if needed
|
// Sign-extend to the high 32 bits if needed.
|
||||||
if (C < 0 && (-C) > (int32_t) MAXSIMM)
|
// NOTE: The value C = 0x80000000 is bad: -C == C and so -C is < MAXSIMM
|
||||||
|
if (C < 0 && (C == -C || -C > (int32_t) MAXSIMM))
|
||||||
mvec.push_back(BuildMI(V9::SRA, 3).addReg(dest).addZImm(0).addRegDef(dest));
|
mvec.push_back(BuildMI(V9::SRA, 3).addReg(dest).addZImm(0).addRegDef(dest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user