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