]> gcc.gnu.org Git - gcc.git/commitdiff
gcc:
authorPaolo Bonzini <bonzini@gnu.org>
Thu, 23 Aug 2007 12:15:20 +0000 (12:15 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Thu, 23 Aug 2007 12:15:20 +0000 (12:15 +0000)
2007-08-23  Paolo Bonzini  <bonzini@gnu.org>

* config/i386/sse.md (*sse_and<mode>3, *sse_ior<mode>3,
*sse_nand<mode>3, *sse_xor<mode>3): New.

gcc/testsuite:
2007-08-23  Paolo Bonzini  <bonzini@gnu.org>

* gcc.target/i386/xorps-sse.c: New.
* gcc.target/i386/xorps-sse2.c: New.

From-SVN: r127735

gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/xorps-sse.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/xorps-sse2.c [new file with mode: 0644]

index 14cb46a37028751dcc847dd9ccaf3060fdb75af5..b8c7a21e41b60449e477fec297ee0bfa2e236419 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-23  Paolo Bonzini  <bonzini@gnu.org>
+
+       * config/i386/sse.md (*sse_and<mode>3, *sse_ior<mode>3,
+       *sse_nand<mode>3, *sse_xor<mode>3): New.
+
 2007-08-23  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.h (PRINT_OPERAND_PUNCT_VALID_P): Add ';' code.
index 31fd293e7b66093a65df085e4522a3b2372a132e..07969375f1d1e1dbb4ed9fe46d181cbc4006580c 100644 (file)
   [(set (match_operand:SSEMODEI 0 "register_operand" "")
        (and:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "")
                      (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))]
-  "TARGET_SSE2"
+  "TARGET_SSE"
   "ix86_fixup_binary_operands_no_copy (AND, <MODE>mode, operands);")
 
-(define_insn "*and<mode>3"
+(define_insn "*sse_and<mode>3"
+  [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
+        (and:SSEMODEI
+          (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0")
+          (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
+  "(TARGET_SSE && !TARGET_SSE2)
+   && ix86_binary_operator_ok (AND, <MODE>mode, operands)"
+  "andps\t{%2, %0|%0, %2}"
+  [(set_attr "type" "sselog")
+   (set_attr "mode" "V4SF")])
+
+(define_insn "*sse2_and<mode>3"
   [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
        (and:SSEMODEI
          (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0")
    (set_attr "prefix_data16" "1")
    (set_attr "mode" "TI")])
 
+(define_insn "*sse_nand<mode>3"
+  [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
+       (and:SSEMODEI
+         (not:SSEMODEI (match_operand:SSEMODEI 1 "register_operand" "0"))
+          (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
+  "(TARGET_SSE && !TARGET_SSE2)"
+  "andnps\t{%2, %0|%0, %2}"
+  [(set_attr "type" "sselog")
+   (set_attr "mode" "V4SF")])
+
 (define_insn "sse2_nand<mode>3"
   [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
        (and:SSEMODEI
   [(set (match_operand:SSEMODEI 0 "register_operand" "")
        (ior:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "")
                      (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))]
-  "TARGET_SSE2"
+  "TARGET_SSE"
   "ix86_fixup_binary_operands_no_copy (IOR, <MODE>mode, operands);")
 
-(define_insn "*ior<mode>3"
+(define_insn "*sse_ior<mode>3"
+  [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
+        (ior:SSEMODEI
+          (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0")
+          (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
+  "(TARGET_SSE && !TARGET_SSE2)
+   && ix86_binary_operator_ok (IOR, <MODE>mode, operands)"
+  "orps\t{%2, %0|%0, %2}"
+  [(set_attr "type" "sselog")
+   (set_attr "mode" "V4SF")])
+
+(define_insn "*sse2_ior<mode>3"
   [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
        (ior:SSEMODEI
          (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0")
   [(set (match_operand:SSEMODEI 0 "register_operand" "")
        (xor:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "")
                      (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))]
-  "TARGET_SSE2"
+  "TARGET_SSE"
   "ix86_fixup_binary_operands_no_copy (XOR, <MODE>mode, operands);")
 
-(define_insn "*xor<mode>3"
+(define_insn "*sse_xor<mode>3"
+  [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
+       (xor:SSEMODEI
+         (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0")
+         (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
+  "(TARGET_SSE && !TARGET_SSE2)
+   && ix86_binary_operator_ok (XOR, <MODE>mode, operands)"
+  "xorps\t{%2, %0|%0, %2}"
+  [(set_attr "type" "sselog")
+   (set_attr "mode" "V4SF")])
+
+(define_insn "*sse2_xor<mode>3"
   [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
        (xor:SSEMODEI
          (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0")
index 24e419a9f19966ffae168bfabfe08ccf158035fa..ef44671770637104e6f0df67b447ee7b461b7e04 100644 (file)
        * gfortran.dg/min_max_optional_3.f90: Remove.
        * gfortran.dg/min_max_optional_4.f90: Remove.
 
+2007-08-23  Paolo Bonzini  <bonzini@gnu.org>
+
+       * gcc.target/i386/xorps-sse.c: New.
+       * gcc.target/i386/xorps-sse2.c: New.
+
 2007-08-23  Paolo Bonzini  <bonzini@gnu.org>
 
        * gcc.target/i386/cmov3.c: Fix scan-assembler.
diff --git a/gcc/testsuite/gcc.target/i386/xorps-sse.c b/gcc/testsuite/gcc.target/i386/xorps-sse.c
new file mode 100644 (file)
index 0000000..e9c0a2e
--- /dev/null
@@ -0,0 +1,14 @@
+/* Test that we generate xorps instruction when pxor is not available.  */
+/* { dg-do compile } */
+/* { dg-options "-O -msse -mno-sse2" } */
+/* { dg-final { scan-assembler "xorps\[ \t\]" } } */
+
+#define vector __attribute__ ((vector_size (16)))
+
+vector int i(vector int f)
+{
+  vector int g = { 0x80000000, 0, 0x80000000, 0 };
+  vector int f_int = (vector int) f;
+  return (f_int ^ g);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/xorps-sse2.c b/gcc/testsuite/gcc.target/i386/xorps-sse2.c
new file mode 100644 (file)
index 0000000..3c268b4
--- /dev/null
@@ -0,0 +1,15 @@
+/* Test that we generate xorps when the result is used in FP math.  */
+/* { dg-do compile } */
+/* { dg-options "-O -msse2 -mno-sse3" } */
+/* { dg-final { scan-assembler "xorps\[ \t\]" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "pxor" { xfail *-*-* } } } */
+
+#define vector __attribute__ ((vector_size (16)))
+
+vector float i(vector float f, vector float h)
+{
+  vector int g = { 0x80000000, 0, 0x80000000, 0 };
+  vector int f_int = (vector int) f;
+  return ((vector float) (f_int ^ g)) + h;
+}
+
This page took 0.129382 seconds and 5 git commands to generate.