Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -march=mips64 -mcpu=mips64r2 -soft-float -O2 < %s | FileCheck %s
      2 
      3 define void @foosf() #0 {
      4 entry:
      5   %in = alloca float, align 4
      6   %out = alloca float, align 4
      7   store volatile float 0xBFD59E1380000000, float* %in, align 4
      8   %in.0.in.0. = load volatile float, float* %in, align 4
      9   %rintf = tail call float @rintf(float %in.0.in.0.) #1
     10   store volatile float %rintf, float* %out, align 4
     11   ret void
     12 
     13 ; CHECK-LABEL:      foosf
     14 ; CHECK-NOT:        dsll
     15 ; CHECK-NOT:        dsrl
     16 ; CHECK-NOT:        lwu
     17 }
     18 
     19 declare float @rintf(float)
     20 
     21 define float @foosf1(float* nocapture readonly %a) #0 {
     22 entry:
     23   %0 = load float, float* %a, align 4
     24   %call = tail call float @roundf(float %0) #2
     25   ret float %call
     26 
     27 ; CHECK-LABEL:      foosf1
     28 ; CHECK-NOT:        dsll
     29 ; CHECK-NOT:        dsrl
     30 ; CHECK-NOT:        lwu
     31 }
     32 
     33 declare float @roundf(float) #1
     34 
     35 define float @foosf2(float* nocapture readonly %a) #0 {
     36 entry:
     37   %0 = load float, float* %a, align 4
     38   %call = tail call float @truncf(float %0) #2
     39   ret float %call
     40 
     41 ; CHECK-LABEL:      foosf2
     42 ; CHECK-NOT:        dsll
     43 ; CHECK-NOT:        dsrl
     44 ; CHECK-NOT:        lwu
     45 }
     46 
     47 declare float @truncf(float) #1
     48 
     49 define float @foosf3(float* nocapture readonly %a) #0 {
     50 entry:
     51   %0 = load float, float* %a, align 4
     52   %call = tail call float @floorf(float %0) #2
     53   ret float %call
     54 
     55 ; CHECK-LABEL:      foosf3
     56 ; CHECK-NOT:        dsll
     57 ; CHECK-NOT:        dsrl
     58 ; CHECK-NOT:        lwu
     59 }
     60 
     61 declare float @floorf(float) #1
     62 
     63 define float @foosf4(float* nocapture readonly %a) #0 {
     64 entry:
     65   %0 = load float, float* %a, align 4
     66   %call = tail call float @nearbyintf(float %0) #2
     67   ret float %call
     68 
     69 ; CHECK-LABEL:      foosf4
     70 ; CHECK-NOT:        dsll
     71 ; CHECK-NOT:        dsrl
     72 ; CHECK-NOT:        lwu
     73 }
     74 
     75 declare float @nearbyintf(float) #1
     76 
     77 define float @foosf5(float* nocapture readonly %a) #0 {
     78 entry:
     79   %0 = load float, float* %a, align 4
     80   %mul = fmul float %0, undef
     81   ret float %mul
     82 
     83 ; CHECK-LABEL:      foosf5
     84 ; CHECK-NOT:        dsll
     85 ; CHECK-NOT:        dsrl
     86 ; CHECK-NOT:        lwu
     87 }
     88 
     89 define float @foosf6(float* nocapture readonly %a) #0 {
     90 entry:
     91   %0 = load float, float* %a, align 4
     92   %sub = fsub float %0, undef
     93   ret float %sub
     94 
     95 ; CHECK-LABEL:      foosf6
     96 ; CHECK-NOT:        dsll
     97 ; CHECK-NOT:        dsrl
     98 ; CHECK-NOT:        lwu
     99 }
    100 
    101 define float @foosf7(float* nocapture readonly %a) #0 {
    102 entry:
    103   %0 = load float, float* %a, align 4
    104   %add = fadd float %0, undef
    105   ret float %add
    106 
    107 ; CHECK-LABEL:      foosf7
    108 ; CHECK-NOT:        dsll
    109 ; CHECK-NOT:        dsrl
    110 ; CHECK-NOT:        lwu
    111 }
    112 
    113 define float @foosf8(float* nocapture readonly %a) #0 {
    114 entry:
    115   %b = alloca float, align 4
    116   %b.0.b.0. = load volatile float, float* %b, align 4
    117   %0 = load float, float* %a, align 4
    118   %div = fdiv float %b.0.b.0., %0
    119   ret float %div
    120 
    121 ; CHECK-LABEL:      foosf8
    122 ; CHECK-NOT:        dsll
    123 ; CHECK-NOT:        dsrl
    124 ; CHECK-NOT:        lwu
    125 }
    126 
    127 define float @foosf9() #0 {
    128 entry:
    129   %b = alloca float, align 4
    130   %b.0.b.0. = load volatile float, float* %b, align 4
    131   %conv = fpext float %b.0.b.0. to double
    132   %b.0.b.0.3 = load volatile float, float* %b, align 4
    133   %conv1 = fpext float %b.0.b.0.3 to double
    134   %call = tail call double @pow(double %conv, double %conv1) #1
    135   %conv2 = fptrunc double %call to float
    136   ret float %conv2
    137 
    138 ; CHECK-LABEL:      foosf9
    139 ; CHECK-NOT:        dsll
    140 ; CHECK-NOT:        dsrl
    141 ; CHECK-NOT:        lwu
    142 }
    143 
    144 declare double @pow(double, double) #0
    145 
    146 define float @foosf10() #0 {
    147 entry:
    148   %a = alloca float, align 4
    149   %a.0.a.0. = load volatile float, float* %a, align 4
    150   %conv = fpext float %a.0.a.0. to double
    151   %call = tail call double @sin(double %conv) #1
    152   %conv1 = fptrunc double %call to float
    153   ret float %conv1
    154 
    155 ; CHECK-LABEL:      foosf10
    156 ; CHECK-NOT:        dsll
    157 ; CHECK-NOT:        dsrl
    158 ; CHECK-NOT:        lwu
    159 }
    160 
    161 declare double @sin(double) #0
    162 
    163 define float @foosf11() #0 {
    164 entry:
    165   %b = alloca float, align 4
    166   %b.0.b.0. = load volatile float, float* %b, align 4
    167   %call = tail call float @ceilf(float %b.0.b.0.) #2
    168   ret float %call
    169 
    170 ; CHECK-LABEL:      foosf11
    171 ; CHECK-NOT:        dsll
    172 ; CHECK-NOT:        dsrl
    173 ; CHECK-NOT:        lwu
    174 }
    175 
    176 declare float @ceilf(float) #1
    177 
    178 define float @foosf12() #0 {
    179 entry:
    180   %b = alloca float, align 4
    181   %a = alloca float, align 4
    182   %b.0.b.0. = load volatile float, float* %b, align 4
    183   %a.0.a.0. = load volatile float, float* %a, align 4
    184   %call = tail call float @fmaxf(float %b.0.b.0., float %a.0.a.0.) #2
    185   ret float %call
    186 
    187 ; CHECK-LABEL:      foosf12
    188 ; CHECK-NOT:        dsll
    189 ; CHECK-NOT:        dsrl
    190 ; CHECK-NOT:        lwu
    191 }
    192 
    193 declare float @fmaxf(float, float) #1
    194 
    195 define float @foosf13() #0 {
    196 entry:
    197   %b = alloca float, align 4
    198   %a = alloca float, align 4
    199   %b.0.b.0. = load volatile float, float* %b, align 4
    200   %a.0.a.0. = load volatile float, float* %a, align 4
    201   %call = tail call float @fminf(float %b.0.b.0., float %a.0.a.0.) #2
    202   ret float %call
    203 
    204 ; CHECK-LABEL:      foosf13
    205 ; CHECK-NOT:        dsll
    206 ; CHECK-NOT:        dsrl
    207 ; CHECK-NOT:        lwu
    208 }
    209 
    210 declare float @fminf(float, float) #1
    211 
    212 
    213 attributes #0 = { nounwind "use-soft-float"="true" }
    214 attributes #1 = { nounwind readnone "use-soft-float"="true" }