Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -march=mipsel < %s | FileCheck %s
      2 
      3 @g1 = external global i32
      4 
      5 ; CHECK-LABEL: seteq0:
      6 ; CHECK: sltiu ${{[0-9]+}}, $4, 1
      7 
      8 define i32 @seteq0(i32 %a) {
      9 entry:
     10   %cmp = icmp eq i32 %a, 0
     11   %conv = zext i1 %cmp to i32
     12   ret i32 %conv
     13 }
     14 
     15 ; CHECK-LABEL: setne0:
     16 ; CHECK: sltu ${{[0-9]+}}, $zero, $4
     17 
     18 define i32 @setne0(i32 %a) {
     19 entry:
     20   %cmp = icmp ne i32 %a, 0
     21   %conv = zext i1 %cmp to i32
     22   ret i32 %conv
     23 }
     24 
     25 ; CHECK-LABEL: slti_beq0:
     26 ; CHECK: slti $[[R0:[0-9]+]], $4, -32768
     27 ; CHECK: beqz $[[R0]]
     28 
     29 define void @slti_beq0(i32 %a) {
     30 entry:
     31   %cmp = icmp slt i32 %a, -32768
     32   br i1 %cmp, label %if.then, label %if.end
     33 
     34 if.then:
     35   store i32 %a, i32* @g1, align 4
     36   br label %if.end
     37 
     38 if.end:
     39   ret void
     40 }
     41 
     42 ; CHECK-LABEL: slti_beq1:
     43 ; CHECK: slt ${{[0-9]+}}
     44 
     45 define void @slti_beq1(i32 %a) {
     46 entry:
     47   %cmp = icmp slt i32 %a, -32769
     48   br i1 %cmp, label %if.then, label %if.end
     49 
     50 if.then:
     51   store i32 %a, i32* @g1, align 4
     52   br label %if.end
     53 
     54 if.end:
     55   ret void
     56 }
     57 
     58 ; CHECK-LABEL: slti_beq2:
     59 ; CHECK: slti $[[R0:[0-9]+]], $4, 32767
     60 ; CHECK: beqz $[[R0]]
     61 
     62 define void @slti_beq2(i32 %a) {
     63 entry:
     64   %cmp = icmp slt i32 %a, 32767
     65   br i1 %cmp, label %if.then, label %if.end
     66 
     67 if.then:
     68   store i32 %a, i32* @g1, align 4
     69   br label %if.end
     70 
     71 if.end:
     72   ret void
     73 }
     74 
     75 ; CHECK-LABEL: slti_beq3:
     76 ; CHECK: slt ${{[0-9]+}}
     77 
     78 define void @slti_beq3(i32 %a) {
     79 entry:
     80   %cmp = icmp slt i32 %a, 32768
     81   br i1 %cmp, label %if.then, label %if.end
     82 
     83 if.then:
     84   store i32 %a, i32* @g1, align 4
     85   br label %if.end
     86 
     87 if.end:
     88   ret void
     89 }
     90 
     91 ; CHECK-LABEL: sltiu_beq0:
     92 ; CHECK: sltiu $[[R0:[0-9]+]], $4, 32767
     93 ; CHECK: beqz $[[R0]]
     94 
     95 define void @sltiu_beq0(i32 %a) {
     96 entry:
     97   %cmp = icmp ult i32 %a, 32767
     98   br i1 %cmp, label %if.then, label %if.end
     99 
    100 if.then:
    101   store i32 %a, i32* @g1, align 4
    102   br label %if.end
    103 
    104 if.end:
    105   ret void
    106 }
    107 
    108 ; CHECK-LABEL: sltiu_beq1:
    109 ; CHECK: sltu ${{[0-9]+}}
    110 
    111 define void @sltiu_beq1(i32 %a) {
    112 entry:
    113   %cmp = icmp ult i32 %a, 32768
    114   br i1 %cmp, label %if.then, label %if.end
    115 
    116 if.then:
    117   store i32 %a, i32* @g1, align 4
    118   br label %if.end
    119 
    120 if.end:
    121   ret void
    122 }
    123 
    124 ; CHECK-LABEL: sltiu_beq2:
    125 ; CHECK: sltiu $[[R0:[0-9]+]], $4, -32768
    126 ; CHECK: beqz $[[R0]]
    127 
    128 define void @sltiu_beq2(i32 %a) {
    129 entry:
    130   %cmp = icmp ult i32 %a, -32768
    131   br i1 %cmp, label %if.then, label %if.end
    132 
    133 if.then:
    134   store i32 %a, i32* @g1, align 4
    135   br label %if.end
    136 
    137 if.end:
    138   ret void
    139 }
    140 
    141 ; CHECK-LABEL: sltiu_beq3:
    142 ; CHECK: sltu ${{[0-9]+}}
    143 
    144 define void @sltiu_beq3(i32 %a) {
    145 entry:
    146   %cmp = icmp ult i32 %a, -32769
    147   br i1 %cmp, label %if.then, label %if.end
    148 
    149 if.then:
    150   store i32 %a, i32* @g1, align 4
    151   br label %if.end
    152 
    153 if.end:
    154   ret void
    155 }
    156