add a partial test for the fma operations that ppc supports. I'm sure I'm
authorChris Lattner <sabre@nondot.org>
Sat, 9 Apr 2005 04:01:32 +0000 (04:01 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 9 Apr 2005 04:01:32 +0000 (04:01 +0000)
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

test/CodeGen/PowerPC/fma.ll [new file with mode: 0644]

diff --git a/test/CodeGen/PowerPC/fma.ll b/test/CodeGen/PowerPC/fma.ll
new file mode 100644 (file)
index 0000000..26b8aac
--- /dev/null
@@ -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
+}