aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-09 04:01:32 +0000
committerChris Lattner <sabre@nondot.org>2005-04-09 04:01:32 +0000
commite23836cf775919e5184afb485ae6ef8714064974 (patch)
tree1914742f09176aceb4d816dfee72ee6706b8b03c
parente7ccd4acd2ee9753e6d212efd522be5c7de154d7 (diff)
add a partial test for the fma operations that ppc supports. I'm sure I'm
missing some and not all of these match yet, but I'm sure that Nate will clean up my mess :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21168 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/PowerPC/fma.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/fma.ll b/test/CodeGen/PowerPC/fma.ll
new file mode 100644
index 0000000000..26b8aac204
--- /dev/null
+++ b/test/CodeGen/PowerPC/fma.ll
@@ -0,0 +1,30 @@
+; RUN: llvm-as < %s | llc -march=ppc32 -enable-ppc-pattern-isel | grep 'fn\?madd\|fn\?msub' | wc -l | grep 5
+
+double %test_FMADD(double %A, double %B, double %C) {
+ %D = mul double %A, %B
+ %E = add double %D, %C
+ ret double %E
+}
+double %test_FMSUB(double %A, double %B, double %C) {
+ %D = mul double %A, %B
+ %E = sub double %D, %C
+ ret double %E
+}
+double %test_FNMADD1(double %A, double %B, double %C) {
+ %D = mul double %A, %B
+ %E = sub double %D, %C
+ %F = sub double -0.0, %E
+ ret double %F
+}
+double %test_FNMADD2(double %A, double %B, double %C) {
+ %D = mul double %A, %B
+ %E = add double %D, %C
+ %F = sub double -0.0, %E
+ ret double %F
+}
+double %test_FNMADD3(double %A, double %B, double %C) {
+ %D = mul double %A, %B
+ %E = add double %C, %D
+ %F = sub double -0.0, %E
+ ret double %F
+}