OSDN Git Service

Merge remote-tracking branch 'gnu/gcc-4_7-branch' into rework
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / fma_float_2.c
diff --git a/gcc/testsuite/gcc.target/i386/fma_float_2.c b/gcc/testsuite/gcc.target/i386/fma_float_2.c
new file mode 100644 (file)
index 0000000..a54644d
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes -mfpmath=sse -mfma" } */
+
+/* Test that the compiler properly optimizes floating point multiply
+   and add instructions into FMA3 instructions.  */
+
+#define TYPE float
+
+#include "fma_2.h"
+
+/* { dg-final { scan-assembler-times "vfmadd132ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfmsub132ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfnmadd132ss" 8  } } */
+/* { dg-final { scan-assembler-times "vfnmsub132ss" 8  } } */