Home | History | Annotate | Download | only in SystemZ
      1 ; Test 64-bit ORs in which the second operand is constant.
      2 ;
      3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
      4 
      5 ; Check the lowest useful OILL value.
      6 define i64 @f1(i64 %a) {
      7 ; CHECK-LABEL: f1:
      8 ; CHECK: oill %r2, 1
      9 ; CHECK: br %r14
     10   %or = or i64 %a, 1
     11   ret i64 %or
     12 }
     13 
     14 ; Check the high end of the OILL range.
     15 define i64 @f2(i64 %a) {
     16 ; CHECK-LABEL: f2:
     17 ; CHECK: oill %r2, 65535
     18 ; CHECK: br %r14
     19   %or = or i64 %a, 65535
     20   ret i64 %or
     21 }
     22 
     23 ; Check the lowest useful OILH value, which is the next value up.
     24 define i64 @f3(i64 %a) {
     25 ; CHECK-LABEL: f3:
     26 ; CHECK: oilh %r2, 1
     27 ; CHECK: br %r14
     28   %or = or i64 %a, 65536
     29   ret i64 %or
     30 }
     31 
     32 ; Check the lowest useful OILF value, which is the next value up again.
     33 define i64 @f4(i64 %a) {
     34 ; CHECK-LABEL: f4:
     35 ; CHECK: oilf %r2, 4294901759
     36 ; CHECK: br %r14
     37   %or = or i64 %a, 4294901759
     38   ret i64 %or
     39 }
     40 
     41 ; Check the high end of the OILH range.
     42 define i64 @f5(i64 %a) {
     43 ; CHECK-LABEL: f5:
     44 ; CHECK: oilh %r2, 65535
     45 ; CHECK: br %r14
     46   %or = or i64 %a, 4294901760
     47   ret i64 %or
     48 }
     49 
     50 ; Check the high end of the OILF range.
     51 define i64 @f6(i64 %a) {
     52 ; CHECK-LABEL: f6:
     53 ; CHECK: oilf %r2, 4294967295
     54 ; CHECK: br %r14
     55   %or = or i64 %a, 4294967295
     56   ret i64 %or
     57 }
     58 
     59 ; Check the lowest useful OIHL value, which is the next value up.
     60 define i64 @f7(i64 %a) {
     61 ; CHECK-LABEL: f7:
     62 ; CHECK: oihl %r2, 1
     63 ; CHECK: br %r14
     64   %or = or i64 %a, 4294967296
     65   ret i64 %or
     66 }
     67 
     68 ; Check the next value up again, which must use two ORs.
     69 define i64 @f8(i64 %a) {
     70 ; CHECK-LABEL: f8:
     71 ; CHECK: oihl %r2, 1
     72 ; CHECK: oill %r2, 1
     73 ; CHECK: br %r14
     74   %or = or i64 %a, 4294967297
     75   ret i64 %or
     76 }
     77 
     78 ; Check the high end of the OILL range.
     79 define i64 @f9(i64 %a) {
     80 ; CHECK-LABEL: f9:
     81 ; CHECK: oihl %r2, 1
     82 ; CHECK: oill %r2, 65535
     83 ; CHECK: br %r14
     84   %or = or i64 %a, 4295032831
     85   ret i64 %or
     86 }
     87 
     88 ; Check the next value up, which must use OILH
     89 define i64 @f10(i64 %a) {
     90 ; CHECK-LABEL: f10:
     91 ; CHECK: oihl %r2, 1
     92 ; CHECK: oilh %r2, 1
     93 ; CHECK: br %r14
     94   %or = or i64 %a, 4295032832
     95   ret i64 %or
     96 }
     97 
     98 ; Check the next value up again, which must use OILF
     99 define i64 @f11(i64 %a) {
    100 ; CHECK-LABEL: f11:
    101 ; CHECK: oihl %r2, 1
    102 ; CHECK: oilf %r2, 65537
    103 ; CHECK: br %r14
    104   %or = or i64 %a, 4295032833
    105   ret i64 %or
    106 }
    107 
    108 ; Check the high end of the OIHL range.
    109 define i64 @f12(i64 %a) {
    110 ; CHECK-LABEL: f12:
    111 ; CHECK: oihl %r2, 65535
    112 ; CHECK: br %r14
    113   %or = or i64 %a, 281470681743360
    114   ret i64 %or
    115 }
    116 
    117 ; Check a combination of the high end of the OIHL range and the high end
    118 ; of the OILF range.
    119 define i64 @f13(i64 %a) {
    120 ; CHECK-LABEL: f13:
    121 ; CHECK: oihl %r2, 65535
    122 ; CHECK: oilf %r2, 4294967295
    123 ; CHECK: br %r14
    124   %or = or i64 %a, 281474976710655
    125   ret i64 %or
    126 }
    127 
    128 ; Check the lowest useful OIHH value.
    129 define i64 @f14(i64 %a) {
    130 ; CHECK-LABEL: f14:
    131 ; CHECK: oihh %r2, 1
    132 ; CHECK: br %r14
    133   %or = or i64 %a, 281474976710656
    134   ret i64 %or
    135 }
    136 
    137 ; Check the next value up, which needs two ORs.
    138 define i64 @f15(i64 %a) {
    139 ; CHECK-LABEL: f15:
    140 ; CHECK: oihh %r2, 1
    141 ; CHECK: oill %r2, 1
    142 ; CHECK: br %r14
    143   %or = or i64 %a, 281474976710657
    144   ret i64 %or
    145 }
    146 
    147 ; Check the lowest useful OIHF value.
    148 define i64 @f16(i64 %a) {
    149 ; CHECK-LABEL: f16:
    150 ; CHECK: oihf %r2, 65537
    151 ; CHECK: br %r14
    152   %or = or i64 %a, 281479271677952
    153   ret i64 %or
    154 }
    155 
    156 ; Check the high end of the OIHH range.
    157 define i64 @f17(i64 %a) {
    158 ; CHECK-LABEL: f17:
    159 ; CHECK: oihh %r2, 65535
    160 ; CHECK: br %r14
    161   %or = or i64 %a, 18446462598732840960
    162   ret i64 %or
    163 }
    164 
    165 ; Check the high end of the OIHF range.
    166 define i64 @f18(i64 %a) {
    167 ; CHECK-LABEL: f18:
    168 ; CHECK: oihf %r2, 4294967295
    169 ; CHECK: br %r14
    170   %or = or i64 %a, -4294967296
    171   ret i64 %or
    172 }
    173 
    174 ; Check the highest useful OR value.
    175 define i64 @f19(i64 %a) {
    176 ; CHECK-LABEL: f19:
    177 ; CHECK: oihf %r2, 4294967295
    178 ; CHECK: oilf %r2, 4294967294
    179 ; CHECK: br %r14
    180   %or = or i64 %a, -2
    181   ret i64 %or
    182 }
    183