]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/fma.ll
Vendor import of llvm trunk r161861:
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / fma.ll
1 ; RUN: llc < %s -mtriple=i386-apple-darwin10  -mattr=+fma  | FileCheck %s --check-prefix=CHECK-FMA-INST
2 ; RUN: llc < %s -mtriple=i386-apple-darwin10               | FileCheck %s --check-prefix=CHECK-FMA-CALL
3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -mattr=+fma | FileCheck %s --check-prefix=CHECK-FMA-INST
4 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10             | FileCheck %s --check-prefix=CHECK-FMA-CALL
5
6 ; CHECK: test_f32
7 ; CHECK-FMA-INST: vfmadd213ss
8 ; CHECK-FMA-CALL: _fmaf
9
10 define float @test_f32(float %a, float %b, float %c) nounwind readnone ssp {
11 entry:
12   %call = tail call float @llvm.fma.f32(float %a, float %b, float %c) nounwind readnone
13   ret float %call
14 }
15
16 ; CHECK: test_f64
17 ; CHECK-FMA-INST: vfmadd213sd
18 ; CHECK-FMA-CALL: _fma
19
20 define double @test_f64(double %a, double %b, double %c) nounwind readnone ssp {
21 entry:
22   %call = tail call double @llvm.fma.f64(double %a, double %b, double %c) nounwind readnone
23   ret double %call
24 }
25
26 ; CHECK: test_f80
27 ; CHECK: _fmal
28
29 define x86_fp80 @test_f80(x86_fp80 %a, x86_fp80 %b, x86_fp80 %c) nounwind readnone ssp {
30 entry:
31   %call = tail call x86_fp80 @llvm.fma.f80(x86_fp80 %a, x86_fp80 %b, x86_fp80 %c) nounwind readnone
32   ret x86_fp80 %call
33 }
34
35 declare float @llvm.fma.f32(float, float, float) nounwind readnone
36 declare double @llvm.fma.f64(double, double, double) nounwind readnone
37 declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) nounwind readnone