Home | History | Annotate | Download | only in PowerPC
      1 ; FIXME: FastISel currently returns false if it hits code that uses VSX
      2 ; registers and with -fast-isel-abort=1 turned on the test case will then fail.
      3 ; When fastisel better supports VSX fix up this test case.
      4 ;
      5 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
      6 define void @t1a(float %a) nounwind {
      7 entry:
      8 ; ELF64: t1a
      9   %cmp = fcmp oeq float %a, 0.000000e+00
     10 ; ELF64: addis
     11 ; ELF64: lfs
     12 ; ELF64: fcmpu
     13   br i1 %cmp, label %if.then, label %if.end
     14 
     15 if.then:                                          ; preds = %entry
     16   call void @foo()
     17   br label %if.end
     18 
     19 if.end:                                           ; preds = %if.then, %entry
     20   ret void
     21 }
     22 
     23 declare void @foo()
     24 
     25 define void @t1b(float %a) nounwind {
     26 entry:
     27 ; ELF64: t1b
     28   %cmp = fcmp oeq float %a, -0.000000e+00
     29 ; ELF64: addis
     30 ; ELF64: lfs
     31 ; ELF64: fcmpu
     32   br i1 %cmp, label %if.then, label %if.end
     33 
     34 if.then:                                          ; preds = %entry
     35   call void @foo()
     36   br label %if.end
     37 
     38 if.end:                                           ; preds = %if.then, %entry
     39   ret void
     40 }
     41 
     42 define void @t2a(double %a) nounwind {
     43 entry:
     44 ; ELF64: t2a
     45   %cmp = fcmp oeq double %a, 0.000000e+00
     46 ; ELF64: addis
     47 ; ELF64: lfd
     48 ; ELF64: fcmpu
     49   br i1 %cmp, label %if.then, label %if.end
     50 
     51 if.then:                                          ; preds = %entry
     52   call void @foo()
     53   br label %if.end
     54 
     55 if.end:                                           ; preds = %if.then, %entry
     56   ret void
     57 }
     58 
     59 define void @t2b(double %a) nounwind {
     60 entry:
     61 ; ELF64: t2b
     62   %cmp = fcmp oeq double %a, -0.000000e+00
     63 ; ELF64: addis
     64 ; ELF64: lfd
     65 ; ELF64: fcmpu
     66   br i1 %cmp, label %if.then, label %if.end
     67 
     68 if.then:                                          ; preds = %entry
     69   call void @foo()
     70   br label %if.end
     71 
     72 if.end:                                           ; preds = %if.then, %entry
     73   ret void
     74 }
     75 
     76 define void @t4(i8 signext %a) nounwind {
     77 entry:
     78 ; ELF64: t4
     79   %cmp = icmp eq i8 %a, -1
     80 ; ELF64: extsb
     81 ; ELF64: cmpwi
     82   br i1 %cmp, label %if.then, label %if.end
     83 
     84 if.then:                                          ; preds = %entry
     85   call void @foo()
     86   br label %if.end
     87 
     88 if.end:                                           ; preds = %if.then, %entry
     89   ret void
     90 }
     91 
     92 define void @t5(i8 zeroext %a) nounwind {
     93 entry:
     94 ; ELF64: t5
     95   %cmp = icmp eq i8 %a, 1
     96 ; ELF64: extsb
     97 ; ELF64: cmpwi
     98   br i1 %cmp, label %if.then, label %if.end
     99 
    100 if.then:                                          ; preds = %entry
    101   call void @foo()
    102   br label %if.end
    103 
    104 if.end:                                           ; preds = %if.then, %entry
    105   ret void
    106 }
    107 
    108 define void @t6(i16 signext %a) nounwind {
    109 entry:
    110 ; ELF64: t6
    111   %cmp = icmp eq i16 %a, -1
    112 ; ELF64: extsh
    113 ; ELF64: cmpwi
    114   br i1 %cmp, label %if.then, label %if.end
    115 
    116 if.then:                                          ; preds = %entry
    117   call void @foo()
    118   br label %if.end
    119 
    120 if.end:                                           ; preds = %if.then, %entry
    121   ret void
    122 }
    123 
    124 define void @t7(i16 zeroext %a) nounwind {
    125 entry:
    126 ; ELF64: t7
    127   %cmp = icmp eq i16 %a, 1
    128 ; ELF64: extsh
    129 ; ELF64: cmpwi
    130   br i1 %cmp, label %if.then, label %if.end
    131 
    132 if.then:                                          ; preds = %entry
    133   call void @foo()
    134   br label %if.end
    135 
    136 if.end:                                           ; preds = %if.then, %entry
    137   ret void
    138 }
    139 
    140 define void @t8(i32 %a) nounwind {
    141 entry:
    142 ; ELF64: t8
    143   %cmp = icmp eq i32 %a, -1
    144 ; ELF64: cmpwi
    145   br i1 %cmp, label %if.then, label %if.end
    146 
    147 if.then:                                          ; preds = %entry
    148   call void @foo()
    149   br label %if.end
    150 
    151 if.end:                                           ; preds = %if.then, %entry
    152   ret void
    153 }
    154 
    155 define void @t9(i32 %a) nounwind {
    156 entry:
    157 ; ELF64: t9
    158   %cmp = icmp eq i32 %a, 1
    159 ; ELF64: cmpwi
    160   br i1 %cmp, label %if.then, label %if.end
    161 
    162 if.then:                                          ; preds = %entry
    163   call void @foo()
    164   br label %if.end
    165 
    166 if.end:                                           ; preds = %if.then, %entry
    167   ret void
    168 }
    169 
    170 define void @t10(i32 %a) nounwind {
    171 entry:
    172 ; ELF64: t10
    173   %cmp = icmp eq i32 %a, 384
    174 ; ELF64: cmpwi
    175   br i1 %cmp, label %if.then, label %if.end
    176 
    177 if.then:                                          ; preds = %entry
    178   call void @foo()
    179   br label %if.end
    180 
    181 if.end:                                           ; preds = %if.then, %entry
    182   ret void
    183 }
    184 
    185 define void @t11(i32 %a) nounwind {
    186 entry:
    187 ; ELF64: t11
    188   %cmp = icmp eq i32 %a, 4096
    189 ; ELF64: cmpwi
    190   br i1 %cmp, label %if.then, label %if.end
    191 
    192 if.then:                                          ; preds = %entry
    193   call void @foo()
    194   br label %if.end
    195 
    196 if.end:                                           ; preds = %if.then, %entry
    197   ret void
    198 }
    199 
    200 define void @t12(i8 %a) nounwind {
    201 entry:
    202 ; ELF64: t12
    203   %cmp = icmp ugt i8 %a, -113
    204 ; ELF64: clrlwi
    205 ; ELF64: cmplwi
    206   br i1 %cmp, label %if.then, label %if.end
    207 
    208 if.then:                                          ; preds = %entry
    209   call void @foo()
    210   br label %if.end
    211 
    212 if.end:                                           ; preds = %if.then, %entry
    213   ret void
    214 }
    215 
    216 define void @t13() nounwind ssp {
    217 entry:
    218 ; ELF64: t13
    219   %cmp = icmp slt i32 -123, -2147483648
    220 ; ELF64: li
    221 ; ELF64: lis
    222 ; ELF64: cmpw
    223   br i1 %cmp, label %if.then, label %if.end
    224 
    225 if.then:                                          ; preds = %entry
    226   ret void
    227 
    228 if.end:                                           ; preds = %entry
    229   ret void
    230 }
    231 
    232 define void @t14(i64 %a) nounwind {
    233 entry:
    234 ; ELF64: t14
    235   %cmp = icmp eq i64 %a, -1
    236 ; ELF64: cmpdi
    237   br i1 %cmp, label %if.then, label %if.end
    238 
    239 if.then:                                          ; preds = %entry
    240   call void @foo()
    241   br label %if.end
    242 
    243 if.end:                                           ; preds = %if.then, %entry
    244   ret void
    245 }
    246 
    247 define void @t15(i64 %a) nounwind {
    248 entry:
    249 ; ELF64: t15
    250   %cmp = icmp eq i64 %a, 1
    251 ; ELF64: cmpdi
    252   br i1 %cmp, label %if.then, label %if.end
    253 
    254 if.then:                                          ; preds = %entry
    255   call void @foo()
    256   br label %if.end
    257 
    258 if.end:                                           ; preds = %if.then, %entry
    259   ret void
    260 }
    261 
    262 define void @t16(i64 %a) nounwind {
    263 entry:
    264 ; ELF64: t16
    265   %cmp = icmp eq i64 %a, 384
    266 ; ELF64: cmpdi
    267   br i1 %cmp, label %if.then, label %if.end
    268 
    269 if.then:                                          ; preds = %entry
    270   call void @foo()
    271   br label %if.end
    272 
    273 if.end:                                           ; preds = %if.then, %entry
    274   ret void
    275 }
    276 
    277 define void @t17(i64 %a) nounwind {
    278 entry:
    279 ; ELF64: t17
    280   %cmp = icmp eq i64 %a, 32768
    281 ; Extra operand so we don't match on cmpdi.
    282 ; ELF64: cmpd {{[0-9]+}}
    283   br i1 %cmp, label %if.then, label %if.end
    284 
    285 if.then:                                          ; preds = %entry
    286   call void @foo()
    287   br label %if.end
    288 
    289 if.end:                                           ; preds = %if.then, %entry
    290   ret void
    291 }
    292 
    293