aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.target/i386/xop-pcmov2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.target/i386/xop-pcmov2.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.target/i386/xop-pcmov2.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.target/i386/xop-pcmov2.c b/gcc-4.8/gcc/testsuite/gcc.target/i386/xop-pcmov2.c
new file mode 100644
index 000000000..6b6bd2169
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gcc.target/i386/xop-pcmov2.c
@@ -0,0 +1,22 @@
+/* Test that the compiler properly optimizes conditional floating point moves
+ into the pcmov instruction on XOP systems. */
+
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mxop" } */
+
+extern void exit (int);
+
+float flt_test (float a, float b, float c, float d)
+{
+ return (a > b) ? c : d;
+}
+
+float flt_a = 1, flt_b = 2, flt_c = 3, flt_d = 4, flt_e;
+
+int main()
+{
+ flt_e = flt_test (flt_a, flt_b, flt_c, flt_d);
+ exit (0);
+}
+
+/* { dg-final { scan-assembler "vpcmov" } } */