2013-05-08 19:38:04 +00:00
|
|
|
; RUN: llc -march=mipsel < %s | FileCheck %s
|
|
|
|
|
2013-06-05 19:49:55 +00:00
|
|
|
@g1 = external global i32
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: seteq0:
|
2013-05-08 19:38:04 +00:00
|
|
|
; 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
|
|
|
|
}
|
2013-05-20 18:18:07 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: setne0:
|
2013-05-20 18:18:07 +00:00
|
|
|
; CHECK: sltu ${{[0-9]+}}, $zero, $4
|
|
|
|
|
|
|
|
define i32 @setne0(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp ne i32 %a, 0
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
2013-06-05 19:49:55 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: slti_beq0:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: slti $[[R0:[0-9]+]], $4, -32768
|
[mips] Print instructions "beq", "bne" and "or" using assembler pseudo
instructions "beqz", "bnez" and "move", when possible.
beq $2, $zero, $L1 => beqz $2, $L1
bne $2, $zero, $L1 => bnez $2, $L1
or $2, $3, $zero => move $2, $3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 18:34:25 +00:00
|
|
|
; CHECK: beqz $[[R0]]
|
2013-06-05 19:49:55 +00:00
|
|
|
|
|
|
|
define void @slti_beq0(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp slt i32 %a, -32768
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: slti_beq1:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: slt ${{[0-9]+}}
|
|
|
|
|
|
|
|
define void @slti_beq1(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp slt i32 %a, -32769
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: slti_beq2:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: slti $[[R0:[0-9]+]], $4, 32767
|
[mips] Print instructions "beq", "bne" and "or" using assembler pseudo
instructions "beqz", "bnez" and "move", when possible.
beq $2, $zero, $L1 => beqz $2, $L1
bne $2, $zero, $L1 => bnez $2, $L1
or $2, $3, $zero => move $2, $3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 18:34:25 +00:00
|
|
|
; CHECK: beqz $[[R0]]
|
2013-06-05 19:49:55 +00:00
|
|
|
|
|
|
|
define void @slti_beq2(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp slt i32 %a, 32767
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: slti_beq3:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: slt ${{[0-9]+}}
|
|
|
|
|
|
|
|
define void @slti_beq3(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp slt i32 %a, 32768
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: sltiu_beq0:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: sltiu $[[R0:[0-9]+]], $4, 32767
|
[mips] Print instructions "beq", "bne" and "or" using assembler pseudo
instructions "beqz", "bnez" and "move", when possible.
beq $2, $zero, $L1 => beqz $2, $L1
bne $2, $zero, $L1 => bnez $2, $L1
or $2, $3, $zero => move $2, $3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 18:34:25 +00:00
|
|
|
; CHECK: beqz $[[R0]]
|
2013-06-05 19:49:55 +00:00
|
|
|
|
|
|
|
define void @sltiu_beq0(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp ult i32 %a, 32767
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: sltiu_beq1:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: sltu ${{[0-9]+}}
|
|
|
|
|
|
|
|
define void @sltiu_beq1(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp ult i32 %a, 32768
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: sltiu_beq2:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: sltiu $[[R0:[0-9]+]], $4, -32768
|
[mips] Print instructions "beq", "bne" and "or" using assembler pseudo
instructions "beqz", "bnez" and "move", when possible.
beq $2, $zero, $L1 => beqz $2, $L1
bne $2, $zero, $L1 => bnez $2, $L1
or $2, $3, $zero => move $2, $3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 18:34:25 +00:00
|
|
|
; CHECK: beqz $[[R0]]
|
2013-06-05 19:49:55 +00:00
|
|
|
|
|
|
|
define void @sltiu_beq2(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp ult i32 %a, -32768
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: sltiu_beq3:
|
2013-06-05 19:49:55 +00:00
|
|
|
; CHECK: sltu ${{[0-9]+}}
|
|
|
|
|
|
|
|
define void @sltiu_beq3(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%cmp = icmp ult i32 %a, -32769
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then:
|
|
|
|
store i32 %a, i32* @g1, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
ret void
|
|
|
|
}
|