mirror of git://gcc.gnu.org/git/gcc.git
re PR middle-end/52584 (Fails to constant fold vector upper/lower half BIT_FIELD_REFs)
2012-03-14 Richard Guenther <rguenther@suse.de> PR middle-end/52584 * tree-vect-generic.c (type_for_widest_vector_mode): Take element type instead of mode, use build_vector_type_for_mode instead of the langhook, build a vector of proper signedness. (expand_vector_operations_1): Adjust. From-SVN: r185385
This commit is contained in:
parent
0ec2c2a943
commit
995ec13233
|
@ -1,3 +1,11 @@
|
||||||
|
2012-03-14 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/52584
|
||||||
|
* tree-vect-generic.c (type_for_widest_vector_mode): Take
|
||||||
|
element type instead of mode, use build_vector_type_for_mode
|
||||||
|
instead of the langhook, build a vector of proper signedness.
|
||||||
|
(expand_vector_operations_1): Adjust.
|
||||||
|
|
||||||
2012-03-14 Richard Guenther <rguenther@suse.de>
|
2012-03-14 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
PR middle-end/52582
|
PR middle-end/52582
|
||||||
|
|
|
@ -471,13 +471,13 @@ expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type
|
||||||
gimple_assign_rhs2 (assign), code);
|
gimple_assign_rhs2 (assign), code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a type for the widest vector mode whose components are of mode
|
/* Return a type for the widest vector mode whose components are of type
|
||||||
INNER_MODE, or NULL_TREE if none is found.
|
TYPE, or NULL_TREE if none is found. */
|
||||||
SATP is true for saturating fixed-point types. */
|
|
||||||
|
|
||||||
static tree
|
static tree
|
||||||
type_for_widest_vector_mode (enum machine_mode inner_mode, optab op, int satp)
|
type_for_widest_vector_mode (tree type, optab op)
|
||||||
{
|
{
|
||||||
|
enum machine_mode inner_mode = TYPE_MODE (type);
|
||||||
enum machine_mode best_mode = VOIDmode, mode;
|
enum machine_mode best_mode = VOIDmode, mode;
|
||||||
int best_nunits = 0;
|
int best_nunits = 0;
|
||||||
|
|
||||||
|
@ -503,13 +503,7 @@ type_for_widest_vector_mode (enum machine_mode inner_mode, optab op, int satp)
|
||||||
if (best_mode == VOIDmode)
|
if (best_mode == VOIDmode)
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
else
|
else
|
||||||
{
|
return build_vector_type_for_mode (type, best_mode);
|
||||||
/* For fixed-point modes, we need to pass satp as the 2nd parameter. */
|
|
||||||
if (ALL_FIXED_POINT_MODE_P (best_mode))
|
|
||||||
return lang_hooks.types.type_for_mode (best_mode, satp);
|
|
||||||
|
|
||||||
return lang_hooks.types.type_for_mode (best_mode, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -856,8 +850,7 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
|
||||||
if (!VECTOR_MODE_P (TYPE_MODE (type)) && op)
|
if (!VECTOR_MODE_P (TYPE_MODE (type)) && op)
|
||||||
{
|
{
|
||||||
tree vector_compute_type
|
tree vector_compute_type
|
||||||
= type_for_widest_vector_mode (TYPE_MODE (TREE_TYPE (type)), op,
|
= type_for_widest_vector_mode (TREE_TYPE (type), op);
|
||||||
TYPE_SATURATING (TREE_TYPE (type)));
|
|
||||||
if (vector_compute_type != NULL_TREE
|
if (vector_compute_type != NULL_TREE
|
||||||
&& (TYPE_VECTOR_SUBPARTS (vector_compute_type)
|
&& (TYPE_VECTOR_SUBPARTS (vector_compute_type)
|
||||||
< TYPE_VECTOR_SUBPARTS (compute_type))
|
< TYPE_VECTOR_SUBPARTS (compute_type))
|
||||||
|
|
Loading…
Reference in New Issue