summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/fusedMAC.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-04-11 06:59:47 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-04-11 06:59:47 +0000
commit5efc442290d45d4e5b27f9d90a83be29f222a811 (patch)
tree2c564f8e1bce9b3d5ff944c050619ebb9a1b9e72 /llvm/test/CodeGen/ARM/fusedMAC.ll
parent9bc178ac5c8f103c328d626f8307756e4b7d753d (diff)
downloadbcm5719-llvm-5efc442290d45d4e5b27f9d90a83be29f222a811.tar.gz
bcm5719-llvm-5efc442290d45d4e5b27f9d90a83be29f222a811.zip
Add more fused mul+add/sub patterns. rdar://10139676
llvm-svn: 154484
Diffstat (limited to 'llvm/test/CodeGen/ARM/fusedMAC.ll')
-rw-r--r--llvm/test/CodeGen/ARM/fusedMAC.ll70
1 files changed, 54 insertions, 16 deletions
diff --git a/llvm/test/CodeGen/ARM/fusedMAC.ll b/llvm/test/CodeGen/ARM/fusedMAC.ll
index b5398c7a587..a8b3999d2bf 100644
--- a/llvm/test/CodeGen/ARM/fusedMAC.ll
+++ b/llvm/test/CodeGen/ARM/fusedMAC.ll
@@ -103,43 +103,81 @@ define float @test_fma_f32(float %a, float %b, float %c) nounwind readnone ssp {
entry:
; CHECK: test_fma_f32
; CHECK: vfma.f32
- %call = tail call float @llvm.fma.f32(float %a, float %b, float %c) nounwind readnone
- ret float %call
+ %tmp1 = tail call float @llvm.fma.f32(float %a, float %b, float %c) nounwind readnone
+ ret float %tmp1
}
define double @test_fma_f64(double %a, double %b, double %c) nounwind readnone ssp {
entry:
; CHECK: test_fma_f64
; CHECK: vfma.f64
- %call = tail call double @llvm.fma.f64(double %a, double %b, double %c) nounwind readnone
- ret double %call
+ %tmp1 = tail call double @llvm.fma.f64(double %a, double %b, double %c) nounwind readnone
+ ret double %tmp1
}
define <2 x float> @test_fma_v2f32(<2 x float> %a, <2 x float> %b, <2 x float> %c) nounwind readnone ssp {
entry:
; CHECK: test_fma_v2f32
; CHECK: vfma.f32
- %0 = tail call <2 x float> @llvm.fma.v2f32(<2 x float> %a, <2 x float> %b, <2 x float> %c) nounwind
- ret <2 x float> %0
+ %tmp1 = tail call <2 x float> @llvm.fma.v2f32(<2 x float> %a, <2 x float> %b, <2 x float> %c) nounwind
+ ret <2 x float> %tmp1
}
-define float @test_fnma_f32(float %a, float %b, float %c) nounwind readnone ssp {
+define double @test_fms_f64(double %a, double %b, double %c) nounwind readnone ssp {
entry:
-; CHECK: test_fnma_f32
-; CHECK: vfnma.f32
- %call = tail call float @llvm.fma.f32(float %a, float %b, float %c) nounwind readnone
- %tmp1 = fsub float -0.0, %call
- %tmp2 = fsub float %tmp1, %c
- ret float %tmp2
+; CHECK: test_fms_f64
+; CHECK: vfms.f64
+ %tmp1 = fsub double -0.0, %a
+ %tmp2 = tail call double @llvm.fma.f64(double %tmp1, double %b, double %c) nounwind readnone
+ ret double %tmp2
+}
+
+define double @test_fms_f64_2(double %a, double %b, double %c) nounwind readnone ssp {
+entry:
+; CHECK: test_fms_f64_2
+; CHECK: vfms.f64
+ %tmp1 = fsub double -0.0, %b
+ %tmp2 = tail call double @llvm.fma.f64(double %a, double %tmp1, double %c) nounwind readnone
+ %tmp3 = fsub double -0.0, %tmp2
+ ret double %tmp3
+}
+
+define double @test_fnms_f64(double %a, double %b, double %c) nounwind readnone ssp {
+entry:
+; CHECK: test_fnms_f64
+; CHECK: vfnms.f64
+ %tmp1 = fsub double -0.0, %a
+ %tmp2 = tail call double @llvm.fma.f64(double %tmp1, double %b, double %c) nounwind readnone
+ %tmp3 = fsub double -0.0, %tmp2
+ ret double %tmp3
+}
+
+define double @test_fnms_f64_2(double %a, double %b, double %c) nounwind readnone ssp {
+entry:
+; CHECK: test_fnms_f64_2
+; CHECK: vfnms.f64
+ %tmp1 = fsub double -0.0, %b
+ %tmp2 = tail call double @llvm.fma.f64(double %a, double %tmp1, double %c) nounwind readnone
+ ret double %tmp2
}
define double @test_fnma_f64(double %a, double %b, double %c) nounwind readnone ssp {
entry:
; CHECK: test_fnma_f64
; CHECK: vfnma.f64
- %call = tail call double @llvm.fma.f64(double %a, double %b, double %c) nounwind readnone
- %tmp = fsub double -0.0, %call
- ret double %tmp
+ %tmp1 = tail call double @llvm.fma.f64(double %a, double %b, double %c) nounwind readnone
+ %tmp2 = fsub double -0.0, %tmp1
+ ret double %tmp2
+}
+
+define double @test_fnma_f64_2(double %a, double %b, double %c) nounwind readnone ssp {
+entry:
+; CHECK: test_fnma_f64_2
+; CHECK: vfnma.f64
+ %tmp1 = fsub double -0.0, %a
+ %tmp2 = fsub double -0.0, %c
+ %tmp3 = tail call double @llvm.fma.f64(double %tmp1, double %b, double %tmp2) nounwind readnone
+ ret double %tmp3
}
declare float @llvm.fma.f32(float, float, float) nounwind readnone
OpenPOWER on IntegriCloud