re PR target/31167 (ICE wnen using __int128_t on x86_64)
authorUros Bizjak <ubizjak@gmail.com>
Thu, 15 Mar 2007 07:25:22 +0000 (08:25 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 15 Mar 2007 07:25:22 +0000 (08:25 +0100)
        PR target/31167
        * config/i386/i386.md (*addti3_1, *addti3_1 splitter): Use
        x86_64_general_operand as operand[2] predicate.  Remove "iF"
        from operand constraints and use "e" constraint instead.
        (*subti3_1, *subti3_1 splitter): Ditto.
        (*negti2_1, *negti2_1 splitter): Use nonimmediate_operand as
        operand[1] predicate.

testsuite/ChangeLog

       PR target/31167
       * gcc.target/i386/pr31167.c: New test.

From-SVN: r122945

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

index 56d9d74b62a8548cdd4f01f5ed8460be43d7181d..6816ef23d94b00472e684201d7fac9a94652b26e 100644 (file)
@@ -1,3 +1,13 @@
+2007-03-15  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/31167
+       * config/i386/i386.md (*addti3_1, *addti3_1 splitter): Use
+       x86_64_general_operand as operand[2] predicate.  Remove "iF"
+       from operand constraints and use "e" constraint instead.
+       (*subti3_1, *subti3_1 splitter): Ditto.
+       (*negti2_1, *negti2_1 splitter): Use nonimmediate_operand as
+       operand[1] predicate.
+
 2007-03-14  Sebastian Pop  <sebastian.pop@inria.fr>
 
        * tree-loop-linear.c (gather_interchange_stats): For multidimensional
index a76c7802e496c5826119851d3c550b155e8bedcd..98c74f5131c05ec33d72676e4ef047cde4506463 100644 (file)
 (define_insn "*addti3_1"
   [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
        (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0,0")
-                (match_operand:TI 2 "general_operand" "roiF,riF")))
+                (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && ix86_binary_operator_ok (PLUS, TImode, operands)"
   "#")
 (define_split
   [(set (match_operand:TI 0 "nonimmediate_operand" "")
        (plus:TI (match_operand:TI 1 "nonimmediate_operand" "")
-                (match_operand:TI 2 "general_operand" "")))
+                (match_operand:TI 2 "x86_64_general_operand" "")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && reload_completed"
   [(parallel [(set (reg:CC FLAGS_REG) (unspec:CC [(match_dup 1) (match_dup 2)]
 (define_insn "*subti3_1"
   [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
        (minus:TI (match_operand:TI 1 "nonimmediate_operand" "0,0")
-                 (match_operand:TI 2 "general_operand" "roiF,riF")))
+                 (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && ix86_binary_operator_ok (MINUS, TImode, operands)"
   "#")
 (define_split
   [(set (match_operand:TI 0 "nonimmediate_operand" "")
        (minus:TI (match_operand:TI 1 "nonimmediate_operand" "")
-                 (match_operand:TI 2 "general_operand" "")))
+                 (match_operand:TI 2 "x86_64_general_operand" "")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && reload_completed"
   [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2)))
 
 (define_insn "*negti2_1"
   [(set (match_operand:TI 0 "nonimmediate_operand" "=ro")
-       (neg:TI (match_operand:TI 1 "general_operand" "0")))
+       (neg:TI (match_operand:TI 1 "nonimmediate_operand" "0")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT
    && ix86_unary_operator_ok (NEG, TImode, operands)"
 
 (define_split
   [(set (match_operand:TI 0 "nonimmediate_operand" "")
-       (neg:TI (match_operand:TI 1 "general_operand" "")))
+       (neg:TI (match_operand:TI 1 "nonimmediate_operand" "")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && reload_completed"
   [(parallel
index 291295c34e4f7d650281e9958aaa9f763994d320..b5eaa0f2c4d3aa8b6312cc72df026dd1ba3e3ab0 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-15  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/31167
+       * gcc.target/i386/pr31167.c: New test.
+
 2007-03-15  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/30922
diff --git a/gcc/testsuite/gcc.target/i386/pr31167.c b/gcc/testsuite/gcc.target/i386/pr31167.c
new file mode 100644 (file)
index 0000000..883ab5a
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile { target x86_64-*-* } } */
+/* { dg-options "-O" } */
+
+typedef int int32_t;
+
+int32_t round32hi (const __int128_t arg)
+{
+  const int SHIFT = 96;
+  const int mshift = 96;
+  const __int128_t M = (~(__int128_t) 0) << mshift;
+  const __int128_t L = (~M) + 1;
+  const __int128_t L1 = ((__int128_t) L) >> 1;
+  const __int128_t Mlo = ((__int128_t) (~M)) >> 1;
+  __int128_t vv = arg & M;
+
+  if ((arg & (L1)) && ((arg & Mlo) || (arg & L)))
+    vv += L;
+
+  return (int32_t) (vv >> SHIFT);
+}