mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
[mips] Add instruction selection pattern for (seteq $LHS, 0).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
146f336272
commit
b637b9f89e
@ -1263,6 +1263,8 @@ defm : BrcondPats<CPURegs, BEQ, BNE, SLT, SLTu, SLTi, SLTiu, ZERO>;
|
||||
// setcc patterns
|
||||
multiclass SeteqPats<RegisterClass RC, Instruction SLTiuOp, Instruction XOROp,
|
||||
Instruction SLTuOp, Register ZEROReg> {
|
||||
def : MipsPat<(seteq RC:$lhs, 0),
|
||||
(SLTiuOp RC:$lhs, 1)>;
|
||||
def : MipsPat<(seteq RC:$lhs, RC:$rhs),
|
||||
(SLTiuOp (XOROp RC:$lhs, RC:$rhs), 1)>;
|
||||
def : MipsPat<(setne RC:$lhs, RC:$rhs),
|
||||
|
11
test/CodeGen/Mips/setcc-se.ll
Normal file
11
test/CodeGen/Mips/setcc-se.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llc -march=mipsel < %s | FileCheck %s
|
||||
|
||||
; CHECK: seteq0:
|
||||
; CHECK: sltiu ${{[0-9]+}}, $4, 1
|
||||
|
||||
define i32 @seteq0(i32 %a) {
|
||||
entry:
|
||||
%cmp = icmp eq i32 %a, 0
|
||||
%conv = zext i1 %cmp to i32
|
||||
ret i32 %conv
|
||||
}
|
Loading…
Reference in New Issue
Block a user