tree-cfg.c (verify_gimple_assign_binary): Allow vector shifts of floating point vecto...
authorRichard Guenther <rguenther@suse.de>
Wed, 29 Apr 2009 18:03:58 +0000 (18:03 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 29 Apr 2009 18:03:58 +0000 (18:03 +0000)
2009-04-29  Richard Guenther  <rguenther@suse.de>

* tree-cfg.c (verify_gimple_assign_binary): Allow vector
shifts of floating point vectors if the shift amount is
a constant multiple of the element size.

From-SVN: r146983

gcc/ChangeLog
gcc/tree-cfg.c

index 47978bf9ad6255a8ca041126707f81a31cdb1efb..3795ef4119fef4649d79f2f8bf8ed9f923b39b06 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-29  Richard Guenther  <rguenther@suse.de>
+
+       * tree-cfg.c (verify_gimple_assign_binary): Allow vector
+       shifts of floating point vectors if the shift amount is
+       a constant multiple of the element size.
+
 2009-04-29  Andreas Krebbel  <krebbel1@de.ibm.com>
            Michael Matz  <matz@suse.de>
 
index 0ef2fb9b88176c54f956caa2715e0e597747c9c3..b5c67cd8a087903b1c7968d9083a467a294835e2 100644 (file)
@@ -3560,7 +3560,8 @@ verify_gimple_assign_binary (gimple stmt)
       {
        if (TREE_CODE (rhs1_type) != VECTOR_TYPE
            || !(INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type))
-                || FIXED_POINT_TYPE_P (TREE_TYPE (rhs1_type)))
+                || FIXED_POINT_TYPE_P (TREE_TYPE (rhs1_type))
+                || SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs1_type)))
            || (!INTEGRAL_TYPE_P (rhs2_type)
                && (TREE_CODE (rhs2_type) != VECTOR_TYPE
                    || !INTEGRAL_TYPE_P (TREE_TYPE (rhs2_type))))
@@ -3572,6 +3573,16 @@ verify_gimple_assign_binary (gimple stmt)
            debug_generic_expr (rhs2_type);
            return true;
          }
+       /* For shifting a vector of floating point components we
+          only allow shifting by a constant multiple of the element size.  */
+       if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs1_type))
+           && (TREE_CODE (rhs2) != INTEGER_CST
+               || !div_if_zero_remainder (EXACT_DIV_EXPR, rhs2,
+                                          TYPE_SIZE (TREE_TYPE (rhs1_type)))))
+         {
+           error ("non-element sized vector shift of floating point vector");
+           return true;
+         }
 
        return false;
       }