Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc < %s -march=arm
      2 ; ModuleID = 'mult-alt-generic.c'
      3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32"
      4 target triple = "arm"
      5 
      6 @mout0 = common global i32 0, align 4
      7 @min1 = common global i32 0, align 4
      8 @marray = common global [2 x i32] zeroinitializer, align 4
      9 
     10 define arm_aapcscc void @single_m() nounwind {
     11 entry:
     12   call void asm "foo $1,$0", "=*m,*m"(i32* @mout0, i32* @min1) nounwind
     13   ret void
     14 }
     15 
     16 define arm_aapcscc void @single_o() nounwind {
     17 entry:
     18   %out0 = alloca i32, align 4
     19   %index = alloca i32, align 4
     20   store i32 0, i32* %out0, align 4
     21   store i32 1, i32* %index, align 4
     22   ret void
     23 }
     24 
     25 define arm_aapcscc void @single_V() nounwind {
     26 entry:
     27   ret void
     28 }
     29 
     30 define arm_aapcscc void @single_lt() nounwind {
     31 entry:
     32   %out0 = alloca i32, align 4
     33   %in1 = alloca i32, align 4
     34   store i32 0, i32* %out0, align 4
     35   store i32 1, i32* %in1, align 4
     36   %tmp = load i32* %in1, align 4
     37   %0 = call i32 asm "foo $1,$0", "=r,<r"(i32 %tmp) nounwind
     38   store i32 %0, i32* %out0, align 4
     39   %tmp1 = load i32* %in1, align 4
     40   %1 = call i32 asm "foo $1,$0", "=r,r<"(i32 %tmp1) nounwind
     41   store i32 %1, i32* %out0, align 4
     42   ret void
     43 }
     44 
     45 define arm_aapcscc void @single_gt() nounwind {
     46 entry:
     47   %out0 = alloca i32, align 4
     48   %in1 = alloca i32, align 4
     49   store i32 0, i32* %out0, align 4
     50   store i32 1, i32* %in1, align 4
     51   %tmp = load i32* %in1, align 4
     52   %0 = call i32 asm "foo $1,$0", "=r,>r"(i32 %tmp) nounwind
     53   store i32 %0, i32* %out0, align 4
     54   %tmp1 = load i32* %in1, align 4
     55   %1 = call i32 asm "foo $1,$0", "=r,r>"(i32 %tmp1) nounwind
     56   store i32 %1, i32* %out0, align 4
     57   ret void
     58 }
     59 
     60 define arm_aapcscc void @single_r() nounwind {
     61 entry:
     62   %out0 = alloca i32, align 4
     63   %in1 = alloca i32, align 4
     64   store i32 0, i32* %out0, align 4
     65   store i32 1, i32* %in1, align 4
     66   %tmp = load i32* %in1, align 4
     67   %0 = call i32 asm "foo $1,$0", "=r,r"(i32 %tmp) nounwind
     68   store i32 %0, i32* %out0, align 4
     69   ret void
     70 }
     71 
     72 define arm_aapcscc void @single_i() nounwind {
     73 entry:
     74   %out0 = alloca i32, align 4
     75   store i32 0, i32* %out0, align 4
     76   %0 = call i32 asm "foo $1,$0", "=r,i"(i32 1) nounwind
     77   store i32 %0, i32* %out0, align 4
     78   ret void
     79 }
     80 
     81 define arm_aapcscc void @single_n() nounwind {
     82 entry:
     83   %out0 = alloca i32, align 4
     84   store i32 0, i32* %out0, align 4
     85   %0 = call i32 asm "foo $1,$0", "=r,n"(i32 1) nounwind
     86   store i32 %0, i32* %out0, align 4
     87   ret void
     88 }
     89 
     90 define arm_aapcscc void @single_E() nounwind {
     91 entry:
     92   %out0 = alloca double, align 8
     93   store double 0.000000e+000, double* %out0, align 8
     94 ; No lowering support.
     95 ;  %0 = call double asm "foo $1,$0", "=r,E"(double 1.000000e+001) nounwind
     96 ;  store double %0, double* %out0, align 8
     97   ret void
     98 }
     99 
    100 define arm_aapcscc void @single_F() nounwind {
    101 entry:
    102   %out0 = alloca double, align 8
    103   store double 0.000000e+000, double* %out0, align 8
    104 ; No lowering support.
    105 ;  %0 = call double asm "foo $1,$0", "=r,F"(double 1.000000e+000) nounwind
    106 ;  store double %0, double* %out0, align 8
    107   ret void
    108 }
    109 
    110 define arm_aapcscc void @single_s() nounwind {
    111 entry:
    112   %out0 = alloca i32, align 4
    113   store i32 0, i32* %out0, align 4
    114   ret void
    115 }
    116 
    117 define arm_aapcscc void @single_g() nounwind {
    118 entry:
    119   %out0 = alloca i32, align 4
    120   %in1 = alloca i32, align 4
    121   store i32 0, i32* %out0, align 4
    122   store i32 1, i32* %in1, align 4
    123   %tmp = load i32* %in1, align 4
    124   %0 = call i32 asm "foo $1,$0", "=r,imr"(i32 %tmp) nounwind
    125   store i32 %0, i32* %out0, align 4
    126   %tmp1 = load i32* @min1, align 4
    127   %1 = call i32 asm "foo $1,$0", "=r,imr"(i32 %tmp1) nounwind
    128   store i32 %1, i32* %out0, align 4
    129   %2 = call i32 asm "foo $1,$0", "=r,imr"(i32 1) nounwind
    130   store i32 %2, i32* %out0, align 4
    131   ret void
    132 }
    133 
    134 define arm_aapcscc void @single_X() nounwind {
    135 entry:
    136   %out0 = alloca i32, align 4
    137   %in1 = alloca i32, align 4
    138   store i32 0, i32* %out0, align 4
    139   store i32 1, i32* %in1, align 4
    140   %tmp = load i32* %in1, align 4
    141   %0 = call i32 asm "foo $1,$0", "=r,X"(i32 %tmp) nounwind
    142   store i32 %0, i32* %out0, align 4
    143   %tmp1 = load i32* @min1, align 4
    144   %1 = call i32 asm "foo $1,$0", "=r,X"(i32 %tmp1) nounwind
    145   store i32 %1, i32* %out0, align 4
    146   %2 = call i32 asm "foo $1,$0", "=r,X"(i32 1) nounwind
    147   store i32 %2, i32* %out0, align 4
    148   %3 = call i32 asm "foo $1,$0", "=r,X"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind
    149   store i32 %3, i32* %out0, align 4
    150 ; No lowering support.
    151 ;  %4 = call i32 asm "foo $1,$0", "=r,X"(double 1.000000e+001) nounwind
    152 ;  store i32 %4, i32* %out0, align 4
    153 ;  %5 = call i32 asm "foo $1,$0", "=r,X"(double 1.000000e+000) nounwind
    154 ;  store i32 %5, i32* %out0, align 4
    155   ret void
    156 }
    157 
    158 define arm_aapcscc void @single_p() nounwind {
    159 entry:
    160   %out0 = alloca i32, align 4
    161   store i32 0, i32* %out0, align 4
    162   %0 = call i32 asm "foo $1,$0", "=r,r"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind
    163   store i32 %0, i32* %out0, align 4
    164   ret void
    165 }
    166 
    167 define arm_aapcscc void @multi_m() nounwind {
    168 entry:
    169   %tmp = load i32* @min1, align 4
    170   call void asm "foo $1,$0", "=*m|r,m|r"(i32* @mout0, i32 %tmp) nounwind
    171   ret void
    172 }
    173 
    174 define arm_aapcscc void @multi_o() nounwind {
    175 entry:
    176   %out0 = alloca i32, align 4
    177   %index = alloca i32, align 4
    178   store i32 0, i32* %out0, align 4
    179   store i32 1, i32* %index, align 4
    180   ret void
    181 }
    182 
    183 define arm_aapcscc void @multi_V() nounwind {
    184 entry:
    185   ret void
    186 }
    187 
    188 define arm_aapcscc void @multi_lt() nounwind {
    189 entry:
    190   %out0 = alloca i32, align 4
    191   %in1 = alloca i32, align 4
    192   store i32 0, i32* %out0, align 4
    193   store i32 1, i32* %in1, align 4
    194   %tmp = load i32* %in1, align 4
    195   %0 = call i32 asm "foo $1,$0", "=r|r,r|<r"(i32 %tmp) nounwind
    196   store i32 %0, i32* %out0, align 4
    197   %tmp1 = load i32* %in1, align 4
    198   %1 = call i32 asm "foo $1,$0", "=r|r,r|r<"(i32 %tmp1) nounwind
    199   store i32 %1, i32* %out0, align 4
    200   ret void
    201 }
    202 
    203 define arm_aapcscc void @multi_gt() nounwind {
    204 entry:
    205   %out0 = alloca i32, align 4
    206   %in1 = alloca i32, align 4
    207   store i32 0, i32* %out0, align 4
    208   store i32 1, i32* %in1, align 4
    209   %tmp = load i32* %in1, align 4
    210   %0 = call i32 asm "foo $1,$0", "=r|r,r|>r"(i32 %tmp) nounwind
    211   store i32 %0, i32* %out0, align 4
    212   %tmp1 = load i32* %in1, align 4
    213   %1 = call i32 asm "foo $1,$0", "=r|r,r|r>"(i32 %tmp1) nounwind
    214   store i32 %1, i32* %out0, align 4
    215   ret void
    216 }
    217 
    218 define arm_aapcscc void @multi_r() nounwind {
    219 entry:
    220   %out0 = alloca i32, align 4
    221   %in1 = alloca i32, align 4
    222   store i32 0, i32* %out0, align 4
    223   store i32 1, i32* %in1, align 4
    224   %tmp = load i32* %in1, align 4
    225   %0 = call i32 asm "foo $1,$0", "=r|r,r|m"(i32 %tmp) nounwind
    226   store i32 %0, i32* %out0, align 4
    227   ret void
    228 }
    229 
    230 define arm_aapcscc void @multi_i() nounwind {
    231 entry:
    232   %out0 = alloca i32, align 4
    233   store i32 0, i32* %out0, align 4
    234   %0 = call i32 asm "foo $1,$0", "=r|r,r|i"(i32 1) nounwind
    235   store i32 %0, i32* %out0, align 4
    236   ret void
    237 }
    238 
    239 define arm_aapcscc void @multi_n() nounwind {
    240 entry:
    241   %out0 = alloca i32, align 4
    242   store i32 0, i32* %out0, align 4
    243   %0 = call i32 asm "foo $1,$0", "=r|r,r|n"(i32 1) nounwind
    244   store i32 %0, i32* %out0, align 4
    245   ret void
    246 }
    247 
    248 define arm_aapcscc void @multi_E() nounwind {
    249 entry:
    250   %out0 = alloca double, align 8
    251   store double 0.000000e+000, double* %out0, align 8
    252 ; No lowering support.
    253 ;  %0 = call double asm "foo $1,$0", "=r|r,r|E"(double 1.000000e+001) nounwind
    254 ;  store double %0, double* %out0, align 8
    255   ret void
    256 }
    257 
    258 define arm_aapcscc void @multi_F() nounwind {
    259 entry:
    260   %out0 = alloca double, align 8
    261   store double 0.000000e+000, double* %out0, align 8
    262 ; No lowering support.
    263 ;  %0 = call double asm "foo $1,$0", "=r|r,r|F"(double 1.000000e+000) nounwind
    264 ;  store double %0, double* %out0, align 8
    265   ret void
    266 }
    267 
    268 define arm_aapcscc void @multi_s() nounwind {
    269 entry:
    270   %out0 = alloca i32, align 4
    271   store i32 0, i32* %out0, align 4
    272   ret void
    273 }
    274 
    275 define arm_aapcscc void @multi_g() nounwind {
    276 entry:
    277   %out0 = alloca i32, align 4
    278   %in1 = alloca i32, align 4
    279   store i32 0, i32* %out0, align 4
    280   store i32 1, i32* %in1, align 4
    281   %tmp = load i32* %in1, align 4
    282   %0 = call i32 asm "foo $1,$0", "=r|r,r|imr"(i32 %tmp) nounwind
    283   store i32 %0, i32* %out0, align 4
    284   %tmp1 = load i32* @min1, align 4
    285   %1 = call i32 asm "foo $1,$0", "=r|r,r|imr"(i32 %tmp1) nounwind
    286   store i32 %1, i32* %out0, align 4
    287   %2 = call i32 asm "foo $1,$0", "=r|r,r|imr"(i32 1) nounwind
    288   store i32 %2, i32* %out0, align 4
    289   ret void
    290 }
    291 
    292 define arm_aapcscc void @multi_X() nounwind {
    293 entry:
    294   %out0 = alloca i32, align 4
    295   %in1 = alloca i32, align 4
    296   store i32 0, i32* %out0, align 4
    297   store i32 1, i32* %in1, align 4
    298   %tmp = load i32* %in1, align 4
    299   %0 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32 %tmp) nounwind
    300   store i32 %0, i32* %out0, align 4
    301   %tmp1 = load i32* @min1, align 4
    302   %1 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32 %tmp1) nounwind
    303   store i32 %1, i32* %out0, align 4
    304   %2 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32 1) nounwind
    305   store i32 %2, i32* %out0, align 4
    306   %3 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind
    307   store i32 %3, i32* %out0, align 4
    308 ; No lowering support.
    309 ;  %4 = call i32 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+001) nounwind
    310 ;  store i32 %4, i32* %out0, align 4
    311 ;  %5 = call i32 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+000) nounwind
    312 ;  store i32 %5, i32* %out0, align 4
    313   ret void
    314 }
    315 
    316 define arm_aapcscc void @multi_p() nounwind {
    317 entry:
    318   %out0 = alloca i32, align 4
    319   store i32 0, i32* %out0, align 4
    320   %0 = call i32 asm "foo $1,$0", "=r|r,r|r"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind
    321   store i32 %0, i32* %out0, align 4
    322   ret void
    323 }
    324