PR target/44481
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jun 2010 21:58:31 +0000 (21:58 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jun 2010 21:58:31 +0000 (21:58 +0000)
* config/i386/i386.md (UNSPEC_PARITY): New unspec.
(paritydi2_cmp): Use UNSPEC_PARITY unspec insted of parity RTX.
(partiysi2_cmp): Ditto.
(*partiyhi2_cmp): Ditto.
(*parityqi2_cmp): Remove.

testsuite/ChangeLog:

PR target/44481
* gcc.target/i386/pr44481.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160638 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr44481.c [new file with mode: 0644]

index fa404da..7b5980b 100644 (file)
@@ -1,8 +1,16 @@
+2010-06-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/44481
+       * config/i386/i386.md (UNSPEC_PARITY): New unspec.
+       (paritydi2_cmp): Use UNSPEC_PARITY unspec insted of parity RTX.
+       (partiysi2_cmp): Ditto.
+       (*partiyhi2_cmp): Ditto.
+       (*parityqi2_cmp): Remove.
+
 2010-06-11  Jan Hubicka  <jh@suse.cz>
 
-       * bitmap.h (+bmp_iter_next_bit): New.
-       (bmp_iter_set, bmp_iter_and, bmp_iter_and_compl):
-       Use it.
+       * bitmap.h (bmp_iter_next_bit): New.
+       (bmp_iter_set, bmp_iter_and, bmp_iter_and_compl): Use it.
 
 2010-06-11  Sandra Loosemore  <sandra@codesourcery.com>
             Eric Botcazou  <ebotcazou@adacore.com>
index c1613e6..675b8c9 100644 (file)
@@ -97,6 +97,7 @@
   UNSPEC_SCAS
   UNSPEC_FNSTSW
   UNSPEC_SAHF
+  UNSPEC_PARITY
   UNSPEC_FSTCW
   UNSPEC_ADD_CARRY
   UNSPEC_FLDCW
 
 (define_insn_and_split "paritydi2_cmp"
   [(set (reg:CC FLAGS_REG)
-       (parity:CC (match_operand:DI 3 "register_operand" "0")))
+       (unspec:CC [(match_operand:DI 3 "register_operand" "0")]
+                  UNSPEC_PARITY))
    (clobber (match_scratch:DI 0 "=r"))
    (clobber (match_scratch:SI 1 "=&r"))
    (clobber (match_scratch:HI 2 "=Q"))]
       (clobber (reg:CC FLAGS_REG))])
    (parallel
      [(set (reg:CC FLAGS_REG)
-          (parity:CC (match_dup 1)))
+          (unspec:CC [(match_dup 1)] UNSPEC_PARITY))
       (clobber (match_dup 1))
       (clobber (match_dup 2))])]
 {
 
 (define_insn_and_split "paritysi2_cmp"
   [(set (reg:CC FLAGS_REG)
-       (parity:CC (match_operand:SI 2 "register_operand" "0")))
+       (unspec:CC [(match_operand:SI 2 "register_operand" "0")]
+                  UNSPEC_PARITY))
    (clobber (match_scratch:SI 0 "=r"))
    (clobber (match_scratch:HI 1 "=&Q"))]
   "! TARGET_POPCNT"
       (clobber (reg:CC FLAGS_REG))])
    (parallel
      [(set (reg:CC FLAGS_REG)
-          (parity:CC (match_dup 1)))
+          (unspec:CC [(match_dup 1)] UNSPEC_PARITY))
       (clobber (match_dup 1))])]
 {
   operands[3] = gen_lowpart (HImode, operands[2]);
 
 (define_insn "*parityhi2_cmp"
   [(set (reg:CC FLAGS_REG)
-       (parity:CC (match_operand:HI 1 "register_operand" "0")))
+       (unspec:CC [(match_operand:HI 1 "register_operand" "0")]
+                  UNSPEC_PARITY))
    (clobber (match_scratch:HI 0 "=Q"))]
   "! TARGET_POPCNT"
   "xor{b}\t{%h0, %b0|%b0, %h0}"
   [(set_attr "length" "2")
    (set_attr "mode" "HI")])
-
-(define_insn "*parityqi2_cmp"
-  [(set (reg:CC FLAGS_REG)
-       (parity:CC (match_operand:QI 0 "register_operand" "q")))]
-  "! TARGET_POPCNT"
-  "test{b}\t%0, %0"
-  [(set_attr "length" "2")
-   (set_attr "mode" "QI")])
 \f
 ;; Thread-local storage patterns for ELF.
 ;;
index 4922318..885f215 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/44481
+       * gcc.target/i386/pr44481.c: New test.
+
 2010-06-11  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.dg/pr42461.c: Compile at -O2 instead of -O.
@@ -8,7 +13,7 @@
        * gcc.dg/tree-ssa/pr44483.c: New.
 
 2010-06-11  Paul Brook  <paul@codesourcery.com>
+
        * g++.dg/other/arm-neon-1.C: New test.
 
 2010-06-11  Paul Thomas  <pault@gcc.gnu.org>
 
 2010-06-08  Andrew Pinski <pinskia@gmail.com>
            Shujing Zhao  <pearly.zhao@oracle.com>
-       
+
        PR c/37724
        * gcc.dg/c90-const-expr-10.c: Adjust.
        * gcc.dg/c99-const-expr-10.c: Adjust.
diff --git a/gcc/testsuite/gcc.target/i386/pr44481.c b/gcc/testsuite/gcc.target/i386/pr44481.c
new file mode 100644 (file)
index 0000000..701268b
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static inline unsigned
+parity (unsigned x)
+{
+  return (unsigned) __builtin_parity (x);
+}
+
+unsigned
+f (unsigned rpoly)
+{
+  return parity (rpoly & 1) ^ parity (rpoly & 6);
+}