mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 02:33:53 +00:00
DIVREM isel deficiency: If sign bit is known zero, zero out DX/EDX/RDX instead of sign extending the low part (in AX/EAX/RAX) into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62519 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c1a168a0fc
commit
2722e7b139
@ -1405,7 +1405,7 @@ SDNode *X86DAGToDAGISel::Select(SDValue N) {
|
||||
InFlag =
|
||||
CurDAG->getCopyToReg(CurDAG->getEntryNode(),
|
||||
LoReg, N0, SDValue()).getValue(1);
|
||||
if (isSigned) {
|
||||
if (isSigned && !CurDAG->SignBitIsZero(N0)) {
|
||||
// Sign extend the low part into the high part.
|
||||
InFlag =
|
||||
SDValue(CurDAG->getTargetNode(SExtOpcode, MVT::Flag, InFlag), 0);
|
||||
|
7
test/CodeGen/X86/rem-2.ll
Normal file
7
test/CodeGen/X86/rem-2.ll
Normal file
@ -0,0 +1,7 @@
|
||||
; RUN: llvm-as < %s | llc -march=x86 | not grep cltd
|
||||
|
||||
define i32 @test(i32 %X) nounwind readnone {
|
||||
entry:
|
||||
%0 = srem i32 41, %X
|
||||
ret i32 %0
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user