Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame^] | 1 | ; RUN: llc -march=arm64 < %s | FileCheck %s |
| 2 | |
| 3 | define float @fma32(float %a, float %b, float %c) nounwind readnone ssp { |
| 4 | entry: |
| 5 | ; CHECK-LABEL: fma32: |
| 6 | ; CHECK: fmadd |
| 7 | %0 = tail call float @llvm.fma.f32(float %a, float %b, float %c) |
| 8 | ret float %0 |
| 9 | } |
| 10 | |
| 11 | define float @fnma32(float %a, float %b, float %c) nounwind readnone ssp { |
| 12 | entry: |
| 13 | ; CHECK-LABEL: fnma32: |
| 14 | ; CHECK: fnmadd |
| 15 | %0 = tail call float @llvm.fma.f32(float %a, float %b, float %c) |
| 16 | %mul = fmul float %0, -1.000000e+00 |
| 17 | ret float %mul |
| 18 | } |
| 19 | |
| 20 | define float @fms32(float %a, float %b, float %c) nounwind readnone ssp { |
| 21 | entry: |
| 22 | ; CHECK-LABEL: fms32: |
| 23 | ; CHECK: fmsub |
| 24 | %mul = fmul float %b, -1.000000e+00 |
| 25 | %0 = tail call float @llvm.fma.f32(float %a, float %mul, float %c) |
| 26 | ret float %0 |
| 27 | } |
| 28 | |
| 29 | define float @fnms32(float %a, float %b, float %c) nounwind readnone ssp { |
| 30 | entry: |
| 31 | ; CHECK-LABEL: fnms32: |
| 32 | ; CHECK: fnmsub |
| 33 | %mul = fmul float %c, -1.000000e+00 |
| 34 | %0 = tail call float @llvm.fma.f32(float %a, float %b, float %mul) |
| 35 | ret float %0 |
| 36 | } |
| 37 | |
| 38 | define double @fma64(double %a, double %b, double %c) nounwind readnone ssp { |
| 39 | ; CHECK-LABEL: fma64: |
| 40 | ; CHECK: fmadd |
| 41 | entry: |
| 42 | %0 = tail call double @llvm.fma.f64(double %a, double %b, double %c) |
| 43 | ret double %0 |
| 44 | } |
| 45 | |
| 46 | define double @fnma64(double %a, double %b, double %c) nounwind readnone ssp { |
| 47 | ; CHECK-LABEL: fnma64: |
| 48 | ; CHECK: fnmadd |
| 49 | entry: |
| 50 | %0 = tail call double @llvm.fma.f64(double %a, double %b, double %c) |
| 51 | %mul = fmul double %0, -1.000000e+00 |
| 52 | ret double %mul |
| 53 | } |
| 54 | |
| 55 | define double @fms64(double %a, double %b, double %c) nounwind readnone ssp { |
| 56 | ; CHECK-LABEL: fms64: |
| 57 | ; CHECK: fmsub |
| 58 | entry: |
| 59 | %mul = fmul double %b, -1.000000e+00 |
| 60 | %0 = tail call double @llvm.fma.f64(double %a, double %mul, double %c) |
| 61 | ret double %0 |
| 62 | } |
| 63 | |
| 64 | define double @fnms64(double %a, double %b, double %c) nounwind readnone ssp { |
| 65 | ; CHECK-LABEL: fnms64: |
| 66 | ; CHECK: fnmsub |
| 67 | entry: |
| 68 | %mul = fmul double %c, -1.000000e+00 |
| 69 | %0 = tail call double @llvm.fma.f64(double %a, double %b, double %mul) |
| 70 | ret double %0 |
| 71 | } |
| 72 | |
| 73 | declare float @llvm.fma.f32(float, float, float) nounwind readnone |
| 74 | declare double @llvm.fma.f64(double, double, double) nounwind readnone |