mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Don't generate sbfx / ubfx with negative lsb field. Patch by David Conrad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
921bdaaa98
commit
8000c6c535
@ -1287,7 +1287,7 @@ SDNode *ARMDAGToDAGISel::SelectV6T2BitfieldExtractOp(SDValue Op,
|
||||
assert(Srl_imm > 0 && Srl_imm < 32 && "bad amount in shift node!");
|
||||
unsigned Width = 32 - Srl_imm;
|
||||
int LSB = Srl_imm - Shl_imm;
|
||||
if ((LSB + Width) > 32)
|
||||
if (LSB < 0)
|
||||
return NULL;
|
||||
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
|
||||
SDValue Ops[] = { Op.getOperand(0).getOperand(0),
|
||||
|
@ -35,3 +35,13 @@ entry:
|
||||
%tmp2 = lshr i32 %tmp, 29
|
||||
ret i32 %tmp2
|
||||
}
|
||||
|
||||
define i32 @f5(i32 %a) {
|
||||
entry:
|
||||
; CHECK: f5:
|
||||
; CHECK-NOT: sbfx
|
||||
; CHECK: bx
|
||||
%tmp = shl i32 %a, 3
|
||||
%tmp2 = ashr i32 %tmp, 1
|
||||
ret i32 %tmp2
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user