]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.def (LSHIFT_EXPR, [...]): Add commentary.
authorRichard Sandiford <rdsandiford@googlemail.com>
Sun, 4 Jan 2009 22:14:39 +0000 (22:14 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 4 Jan 2009 22:14:39 +0000 (22:14 +0000)
gcc/
* tree.def (LSHIFT_EXPR, RSHIFT_EXPR): Add commentary.
* tree-cfg.c (verify_gimple_assign_binary): Allow shifts of
fixed-point types, and vectors of the same.

From-SVN: r143061

gcc/ChangeLog
gcc/tree-cfg.c
gcc/tree.def

index 032f0280817ec9049ccb6a337edfe63233a30942..d7056f3de804c2d696c277565ff269768274b06e 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-04  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * tree.def (LSHIFT_EXPR, RSHIFT_EXPR): Add commentary.
+       * tree-cfg.c (verify_gimple_assign_binary): Allow shifts of
+       fixed-point types, and vectors of the same.
+
 2009-01-04  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * config/mips/sync.md (*mb_barrier): Rename to...
index 3def9a2ec9b8e27af79599cb680d97323db82fec..875d123244d07adb2a0ce6622307e13854606f8b 100644 (file)
@@ -3474,6 +3474,12 @@ verify_gimple_assign_binary (gimple stmt)
 
     case LSHIFT_EXPR:
     case RSHIFT_EXPR:
+      if (FIXED_POINT_TYPE_P (rhs1_type)
+         && INTEGRAL_TYPE_P (rhs2_type)
+         && useless_type_conversion_p (lhs_type, rhs1_type))
+       return false;
+      /* Fall through.  */
+
     case LROTATE_EXPR:
     case RROTATE_EXPR:
       {
@@ -3495,7 +3501,8 @@ verify_gimple_assign_binary (gimple stmt)
     case VEC_RSHIFT_EXPR:
       {
        if (TREE_CODE (rhs1_type) != VECTOR_TYPE
-           || !INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type))
+           || !(INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type))
+                || FIXED_POINT_TYPE_P (TREE_TYPE (rhs1_type)))
            || (!INTEGRAL_TYPE_P (rhs2_type)
                && (TREE_CODE (rhs2_type) != VECTOR_TYPE
                    || !INTEGRAL_TYPE_P (TREE_TYPE (rhs2_type))))
index 3e077cc2cd7a7612e20aa70b1e30940422988687..19a502952effa92b1f6309a2552d1fc8d61572b4 100644 (file)
@@ -691,7 +691,13 @@ DEFTREECODE (ABS_EXPR, "abs_expr", tcc_unary, 1)
    The second operand is the number of bits to
    shift by; it need not be the same type as the first operand and result.
    Note that the result is undefined if the second operand is larger
-   than or equal to the first operand's type size.  */
+   than or equal to the first operand's type size.
+
+   The first operand of a shift can have either an integer or a
+   (non-integer) fixed-point type.  We follow the ISO/IEC TR 18037:2004
+   semantics for the latter.
+
+   Rotates are defined for integer types only.  */
 DEFTREECODE (LSHIFT_EXPR, "lshift_expr", tcc_binary, 2)
 DEFTREECODE (RSHIFT_EXPR, "rshift_expr", tcc_binary, 2)
 DEFTREECODE (LROTATE_EXPR, "lrotate_expr", tcc_binary, 2)