James Y Knight | bb76d48 | 2017-07-20 20:09:11 +0000 | [diff] [blame] | 1 | ; RUN: llc %s -march=sparc -o - | FileCheck --check-prefix=CHECK --check-prefix=DEFAULT %s |
| 2 | ; RUN: llc %s -march=sparc -mattr=no-fmuls -o - | FileCheck --check-prefix=CHECK --check-prefix=NO-FMULS %s |
| 3 | ; RUN: llc %s -march=sparc -mattr=no-fsmuld -o - | FileCheck --check-prefix=CHECK --check-prefix=NO-FSMULD %s |
| 4 | ; RUN: llc %s -march=sparc -mattr=no-fsmuld,no-fmuls -o - | FileCheck --check-prefix=CHECK --check-prefix=NO-BOTH %s |
| 5 | |
| 6 | ;;; Test case ensures that the no-fsmuld and no-fmuls features disable |
| 7 | ;;; the relevant instruction, and alternative sequences get emitted |
| 8 | ;;; instead. |
| 9 | |
| 10 | ; CHECK-LABEL: test_float_mul: |
| 11 | ; DEFAULT: fmuls |
| 12 | ; NO-FSMULD: fmuls |
| 13 | ; NO-FMULS: fsmuld |
| 14 | ; NO-FMULS: fdtos |
| 15 | ; NO-BOTH: fstod |
| 16 | ; NO-BOTH: fstod |
| 17 | ; NO-BOTH: fmuld |
| 18 | ; NO-BOTH: fdtos |
| 19 | define float @test_float_mul(float %a, float %b) { |
| 20 | entry: |
| 21 | %mul = fmul float %a, %b |
| 22 | |
| 23 | ret float %mul |
| 24 | } |
| 25 | |
| 26 | ; CHECK-LABEL: test_float_mul_double: |
| 27 | ; DEFAULT: fsmuld |
| 28 | ; NO-FSMULD: fstod |
| 29 | ; NO-FSMULD: fstod |
| 30 | ; NO-FSMULD: fmuld |
| 31 | define double @test_float_mul_double(float %a, float %b) { |
| 32 | entry: |
| 33 | %a_double = fpext float %a to double |
| 34 | %b_double = fpext float %b to double |
| 35 | %mul = fmul double %a_double, %b_double |
| 36 | |
| 37 | ret double %mul |
| 38 | } |