1 ; RUN: llc -march=mipsel < %s | FileCheck %s 2 ; RUN: llc -march=mipsel -mattr=+fp64 < %s | FileCheck %s 3 ; RUN: llc -march=mipsel < %s | FileCheck -check-prefix=FP32EL %s 4 ; RUN: llc -march=mipsel -mattr=+fp64 < %s | FileCheck -check-prefix=FP64EL %s 5 6 ; $f12, $f14 7 ; CHECK-LABEL: testlowercall0: 8 ; CHECK-DAG: ldc1 $f12, %lo 9 ; CHECK-DAG: ldc1 $f14, %lo 10 define void @testlowercall0() nounwind { 11 entry: 12 tail call void @f0(double 5.000000e+00, double 6.000000e+00) nounwind 13 ret void 14 } 15 16 declare void @f0(double, double) 17 18 ; $f12, $f14 19 ; CHECK-LABEL: testlowercall1: 20 ; CHECK-DAG: lwc1 $f12, %lo 21 ; CHECK-DAG: lwc1 $f14, %lo 22 define void @testlowercall1() nounwind { 23 entry: 24 tail call void @f1(float 8.000000e+00, float 9.000000e+00) nounwind 25 ret void 26 } 27 28 declare void @f1(float, float) 29 30 ; $f12, $f14 31 ; CHECK-LABEL: testlowercall2: 32 ; CHECK-DAG: lwc1 $f12, %lo 33 ; CHECK-DAG: ldc1 $f14, %lo 34 define void @testlowercall2() nounwind { 35 entry: 36 tail call void @f2(float 8.000000e+00, double 6.000000e+00) nounwind 37 ret void 38 } 39 40 declare void @f2(float, double) 41 42 ; $f12, $f14 43 ; CHECK-LABEL: testlowercall3: 44 ; CHECK-DAG: ldc1 $f12, %lo 45 ; CHECK-DAG: lwc1 $f14, %lo 46 define void @testlowercall3() nounwind { 47 entry: 48 tail call void @f3(double 5.000000e+00, float 9.000000e+00) nounwind 49 ret void 50 } 51 52 declare void @f3(double, float) 53 54 ; $4, $5, $6, $7 55 ; CHECK-LABEL: testlowercall4: 56 ; CHECK-DAG: addiu $4, $zero, 12 57 ; CHECK-DAG: addiu $5, $zero, 13 58 ; CHECK-DAG: addiu $6, $zero, 14 59 ; CHECK-DAG: addiu $7, $zero, 15 60 define void @testlowercall4() nounwind { 61 entry: 62 tail call void @f4(i32 12, i32 13, i32 14, i32 15) nounwind 63 ret void 64 } 65 66 declare void @f4(i32, i32, i32, i32) 67 68 ; $f12, $6, stack 69 ; CHECK-LABEL: testlowercall5: 70 ; CHECK-DAG: ldc1 $f12, %lo 71 ; CHECK-DAG: addiu $6, $zero, 23 72 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 16($sp) 73 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 20($sp) 74 define void @testlowercall5() nounwind { 75 entry: 76 tail call void @f5(double 1.500000e+01, i32 23, double 1.700000e+01) nounwind 77 ret void 78 } 79 80 declare void @f5(double, i32, double) 81 82 ; $f12, $6, $7 83 ; CHECK-LABEL: testlowercall6: 84 ; CHECK-DAG: ldc1 $f12, %lo 85 ; CHECK-DAG: addiu $6, $zero, 33 86 ; CHECK-DAG: addiu $7, $zero, 24 87 define void @testlowercall6() nounwind { 88 entry: 89 tail call void @f6(double 2.500000e+01, i32 33, i32 24) nounwind 90 ret void 91 } 92 93 declare void @f6(double, i32, i32) 94 95 ; $f12, $5, $6 96 ; CHECK-LABEL: testlowercall7: 97 ; CHECK-DAG: lwc1 $f12, %lo 98 ; CHECK-DAG: addiu $5, $zero, 43 99 ; CHECK-DAG: addiu $6, $zero, 34 100 define void @testlowercall7() nounwind { 101 entry: 102 tail call void @f7(float 1.800000e+01, i32 43, i32 34) nounwind 103 ret void 104 } 105 106 declare void @f7(float, i32, i32) 107 108 ; $4, $5, $6, stack 109 ; CHECK-LABEL: testlowercall8: 110 ; CHECK-DAG: addiu $4, $zero, 22 111 ; CHECK-DAG: addiu $5, $zero, 53 112 ; CHECK-DAG: addiu $6, $zero, 44 113 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 16($sp) 114 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 20($sp) 115 define void @testlowercall8() nounwind { 116 entry: 117 tail call void @f8(i32 22, i32 53, i32 44, double 4.000000e+00) nounwind 118 ret void 119 } 120 121 declare void @f8(i32, i32, i32, double) 122 123 ; $4, $5, $6, $7 124 ; CHECK-LABEL: testlowercall9: 125 ; CHECK-DAG: addiu $4, $zero, 32 126 ; CHECK-DAG: addiu $5, $zero, 63 127 ; CHECK-DAG: addiu $6, $zero, 54 128 ; CHECK-DAG: lui $7, 16688 129 define void @testlowercall9() nounwind { 130 entry: 131 tail call void @f9(i32 32, i32 63, i32 54, float 1.100000e+01) nounwind 132 ret void 133 } 134 135 declare void @f9(i32, i32, i32, float) 136 137 ; $4, $5, ($6, $7) 138 ; CHECK-LABEL: testlowercall10: 139 ; CHECK-DAG: addiu $4, $zero, 42 140 ; CHECK-DAG: addiu $5, $zero, 73 141 ; FP32EL-LABEL: testlowercall10: 142 ; FP32EL-DAG: mfc1 $6, $f{{[0-9]+}} 143 ; FP32EL-DAG: mfc1 $7, $f{{[0-9]+}} 144 ; FP64EL-LABEL: testlowercall10: 145 ; FP64EL-DAG: mfc1 $6, $f{{[0-9]+}} 146 ; FP64EL-DAG: mfhc1 $7, $f{{[0-9]+}} 147 define void @testlowercall10() nounwind { 148 entry: 149 tail call void @f10(i32 42, i32 73, double 2.700000e+01) nounwind 150 ret void 151 } 152 153 declare void @f10(i32, i32, double) 154 155 ; $4, ($6, $7) 156 ; CHECK-LABEL: testlowercall11: 157 ; CHECK-DAG: addiu $4, $zero, 52 158 ; FP32EL-LABEL: testlowercall11: 159 ; FP32EL-DAG: mfc1 $6, $f{{[0-9]+}} 160 ; FP32EL-DAG: mfc1 $7, $f{{[0-9]+}} 161 ; FP64EL-LABEL: testlowercall11: 162 ; FP64EL-DAG: mfc1 $6, $f{{[0-9]+}} 163 ; FP64EL-DAG: mfhc1 $7, $f{{[0-9]+}} 164 define void @testlowercall11() nounwind { 165 entry: 166 tail call void @f11(i32 52, double 1.600000e+01) nounwind 167 ret void 168 } 169 170 declare void @f11(i32, double) 171 172 ; $f12, $f14, $6, $7 173 ; CHECK-LABEL: testlowercall12: 174 ; CHECK-DAG: lwc1 $f12, %lo 175 ; CHECK-DAG: lwc1 $f14, %lo 176 ; CHECK-DAG: lui $6, 16672 177 ; CHECK-DAG: lui $7, 16808 178 define void @testlowercall12() nounwind { 179 entry: 180 tail call void @f12(float 2.800000e+01, float 1.900000e+01, float 1.000000e+01, float 2.100000e+01) nounwind 181 ret void 182 } 183 184 declare void @f12(float, float, float, float) 185 186 ; $f12, $5, $6, $7 187 ; CHECK-LABEL: testlowercall13: 188 ; CHECK-DAG: lwc1 $f12, %lo 189 ; CHECK-DAG: addiu $5, $zero, 83 190 ; CHECK-DAG: lui $6, 16800 191 ; CHECK-DAG: addiu $7, $zero, 25 192 define void @testlowercall13() nounwind { 193 entry: 194 tail call void @f13(float 3.800000e+01, i32 83, float 2.000000e+01, i32 25) nounwind 195 ret void 196 } 197 198 199 declare void @f13(float, i32, float, i32) 200 201 ; $f12, $f14, $7 202 ; CHECK-LABEL: testlowercall14: 203 ; CHECK-DAG: ldc1 $f12, %lo 204 ; CHECK-DAG: lwc1 $f14, %lo 205 ; CHECK-DAG: lui $7, 16880 206 define void @testlowercall14() nounwind { 207 entry: 208 tail call void @f14(double 3.500000e+01, float 2.900000e+01, float 3.000000e+01) nounwind 209 ret void 210 } 211 212 declare void @f14(double, float, float) 213 214 ; $f12, $f14, ($6, $7) 215 ; CHECK-LABEL: testlowercall15: 216 ; CHECK-DAG: lwc1 $f12, %lo 217 ; CHECK-DAG: lwc1 $f14, %lo 218 ; FP32EL-LABEL: testlowercall15: 219 ; FP32EL-DAG: mfc1 $6, $f{{[0-9]+}} 220 ; FP32EL-DAG: mfc1 $7, $f{{[0-9]+}} 221 ; FP64EL-LABEL: testlowercall15: 222 ; FP64EL-DAG: mfc1 $6, $f{{[0-9]+}} 223 ; FP64EL-DAG: mfhc1 $7, $f{{[0-9]+}} 224 define void @testlowercall15() nounwind { 225 entry: 226 tail call void @f15(float 4.800000e+01, float 3.900000e+01, double 3.700000e+01) nounwind 227 ret void 228 } 229 230 declare void @f15(float, float, double) 231 232 ; $4, $5, $6, $7 233 ; CHECK-LABEL: testlowercall16: 234 ; CHECK-DAG: addiu $4, $zero, 62 235 ; CHECK-DAG: lui $5, 16964 236 ; CHECK-DAG: addiu $6, $zero, 64 237 ; CHECK-DAG: lui $7, 16888 238 define void @testlowercall16() nounwind { 239 entry: 240 tail call void @f16(i32 62, float 4.900000e+01, i32 64, float 3.100000e+01) nounwind 241 ret void 242 } 243 244 declare void @f16(i32, float, i32, float) 245 246 ; $4, $5, $6, $7 247 ; CHECK-LABEL: testlowercall17: 248 ; CHECK-DAG: addiu $4, $zero, 72 249 ; CHECK-DAG: lui $5, 17004 250 ; CHECK-DAG: addiu $6, $zero, 74 251 ; CHECK-DAG: addiu $7, $zero, 35 252 define void @testlowercall17() nounwind { 253 entry: 254 tail call void @f17(i32 72, float 5.900000e+01, i32 74, i32 35) nounwind 255 ret void 256 } 257 258 declare void @f17(i32, float, i32, i32) 259 260 ; $4, $5, $6, $7 261 ; CHECK-LABEL: testlowercall18: 262 ; CHECK-DAG: addiu $4, $zero, 82 263 ; CHECK-DAG: addiu $5, $zero, 93 264 ; CHECK-DAG: lui $6, 16928 265 ; CHECK-DAG: addiu $7, $zero, 45 266 define void @testlowercall18() nounwind { 267 entry: 268 tail call void @f18(i32 82, i32 93, float 4.000000e+01, i32 45) nounwind 269 ret void 270 } 271 272 declare void @f18(i32, i32, float, i32) 273 274 275 ; $4, ($6, $7), stack 276 ; CHECK-LABEL: testlowercall20: 277 ; CHECK-DAG: addiu $4, $zero, 92 278 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 16($sp) 279 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 20($sp) 280 ; FP32EL-LABEL: testlowercall20: 281 ; FP32EL-DAG: mfc1 $6, $f{{[0-9]+}} 282 ; FP32EL-DAG: mfc1 $7, $f{{[0-9]+}} 283 ; FP64EL-LABEL: testlowercall20: 284 ; FP64EL-DAG: mfc1 $6, $f{{[0-9]+}} 285 ; FP64EL-DAG: mfhc1 $7, $f{{[0-9]+}} 286 define void @testlowercall20() nounwind { 287 entry: 288 tail call void @f20(i32 92, double 2.600000e+01, double 4.700000e+01) nounwind 289 ret void 290 } 291 292 declare void @f20(i32, double, double) 293 294 ; $f12, $5 295 ; CHECK-LABEL: testlowercall21: 296 ; CHECK-DAG: lwc1 $f12, %lo 297 ; CHECK-DAG: addiu $5, $zero, 103 298 define void @testlowercall21() nounwind { 299 entry: 300 tail call void @f21(float 5.800000e+01, i32 103) nounwind 301 ret void 302 } 303 304 declare void @f21(float, i32) 305 306 ; $f12, $5, ($6, $7) 307 ; CHECK-LABEL: testlowercall22: 308 ; CHECK-DAG: lwc1 $f12, %lo 309 ; CHECK-DAG: addiu $5, $zero, 113 310 ; FP32EL-LABEL: testlowercall22: 311 ; FP32EL-DAG: mfc1 $6, $f{{[0-9]+}} 312 ; FP32EL-DAG: mfc1 $7, $f{{[0-9]+}} 313 ; FP64EL-LABEL: testlowercall22: 314 ; FP64EL-DAG: mfc1 $6, $f{{[0-9]+}} 315 ; FP64EL-DAG: mfhc1 $7, $f{{[0-9]+}} 316 define void @testlowercall22() nounwind { 317 entry: 318 tail call void @f22(float 6.800000e+01, i32 113, double 5.700000e+01) nounwind 319 ret void 320 } 321 322 declare void @f22(float, i32, double) 323 324 ; $f12, f6 325 ; CHECK-LABEL: testlowercall23: 326 ; CHECK-DAG: ldc1 $f12, %lo 327 ; CHECK-DAG: addiu $6, $zero, 123 328 define void @testlowercall23() nounwind { 329 entry: 330 tail call void @f23(double 4.500000e+01, i32 123) nounwind 331 ret void 332 } 333 334 declare void @f23(double, i32) 335 336 ; $f12,$6, stack 337 ; CHECK-LABEL: testlowercall24: 338 ; CHECK-DAG: ldc1 $f12, %lo 339 ; CHECK-DAG: addiu $6, $zero, 133 340 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 16($sp) 341 ; CHECK-DAG: sw ${{[a-z0-9]+}}, 20($sp) 342 define void @testlowercall24() nounwind { 343 entry: 344 tail call void @f24(double 5.500000e+01, i32 133, double 6.700000e+01) nounwind 345 ret void 346 } 347 348 declare void @f24(double, i32, double) 349 350 ; CHECK-LABEL: testlowercall25: 351 ; CHECK-DAG: lwc1 $f12, %lo 352 ; CHECK-DAG: lwc1 $f14, %lo 353 ; CHECK-DAG: lui $6 354 ; CHECK-DAG: lui $7 355 ; CHECK-DAG: lwc1 $f12, %lo 356 ; CHECK-DAG: addiu $5, $zero, 83 357 ; CHECK-DAG: lui $6 358 ; CHECK-DAG: addiu $7, $zero, 25 359 ; CHECK-DAG: addiu $4, $zero, 82 360 ; CHECK-DAG: addiu $5, $zero, 93 361 ; CHECK-DAG: lui $6 362 ; CHECK-DAG: addiu $7, $zero, 45 363 define void @testlowercall25() nounwind { 364 entry: 365 tail call void @f12(float 2.800000e+01, float 1.900000e+01, float 1.000000e+01, float 2.100000e+01) nounwind 366 tail call void @f13(float 3.800000e+01, i32 83, float 2.000000e+01, i32 25) nounwind 367 tail call void @f18(i32 82, i32 93, float 4.000000e+01, i32 45) nounwind 368 ret void 369 } 370