1; RUN: llc -march=mips64 -mcpu=mips64r2 -mattr=+soft-float -O2 < %s | FileCheck %s 2 3define void @foosf() #0 { 4entry: 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 19declare float @rintf(float) 20 21define float @foosf1(float* nocapture readonly %a) #0 { 22entry: 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 33declare float @roundf(float) #1 34 35define float @foosf2(float* nocapture readonly %a) #0 { 36entry: 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 47declare float @truncf(float) #1 48 49define float @foosf3(float* nocapture readonly %a) #0 { 50entry: 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 61declare float @floorf(float) #1 62 63define float @foosf4(float* nocapture readonly %a) #0 { 64entry: 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 75declare float @nearbyintf(float) #1 76 77define float @foosf5(float* nocapture readonly %a) #0 { 78entry: 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 89define float @foosf6(float* nocapture readonly %a) #0 { 90entry: 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 101define float @foosf7(float* nocapture readonly %a) #0 { 102entry: 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 113define float @foosf8(float* nocapture readonly %a) #0 { 114entry: 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 127define float @foosf9() #0 { 128entry: 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 144declare double @pow(double, double) #0 145 146define float @foosf10() #0 { 147entry: 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 161declare double @sin(double) #0 162 163define float @foosf11() #0 { 164entry: 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 176declare float @ceilf(float) #1 177 178define float @foosf12() #0 { 179entry: 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 193declare float @fmaxf(float, float) #1 194 195define float @foosf13() #0 { 196entry: 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 210declare float @fminf(float, float) #1 211 212 213attributes #0 = { nounwind "use-soft-float"="true" } 214attributes #1 = { nounwind readnone "use-soft-float"="true" }