Commit 0ed414a4 by Dorit Nuzman Committed by Dorit Nuzman

tree-vect-transform.c (vect_create_epilog_for_reduction): Set…

tree-vect-transform.c (vect_create_epilog_for_reduction): Set BIT_FIELD_REF_UNSIGNED for newly created BIT_FIELD_REFs.

	* tree-vect-transform.c (vect_create_epilog_for_reduction): Set
        BIT_FIELD_REF_UNSIGNED for newly created BIT_FIELD_REFs.

From-SVN: r102913
parent 323dff9a
2005-08-09 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_create_epilog_for_reduction): Set
BIT_FIELD_REF_UNSIGNED for newly created BIT_FIELD_REFs.
2005-08-09 Richard Guenther <rguenther@suse.de> 2005-08-09 Richard Guenther <rguenther@suse.de>
* c-common.c (builtin_function_2): Remove. * c-common.c (builtin_function_2): Remove.
......
2005-08-09 Dorit Nuzman <dorit@il.ibm.com>
* gcc.dg/vect/vect-reduc-1char.c: Reverse last change - change
input data back to what it was originally.
2005-08-09 Andrew Pinski <pinskia@physics.uc.edu> 2005-08-09 Andrew Pinski <pinskia@physics.uc.edu>
* objc.dg/try-catch-8.m: Enable for all targets. * objc.dg/try-catch-8.m: Enable for all targets.
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
#include "tree-vect.h" #include "tree-vect.h"
#define N 16 #define N 16
#define DIFF 122 #define DIFF 242
void void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result) main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
{ {
int i; int i;
unsigned char ub[N] = {1,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30}; unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned char udiff = 2; unsigned char udiff = 2;
unsigned char umax = x; unsigned char umax = x;
......
...@@ -1021,9 +1021,12 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op, ...@@ -1021,9 +1021,12 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
&& (integer_zerop (scalar_initial_def) && (integer_zerop (scalar_initial_def)
|| real_zerop (scalar_initial_def))) || real_zerop (scalar_initial_def)))
{ {
epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest, tree rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
build3 (BIT_FIELD_REF, scalar_type, bitsize_zero_node);
vec_temp, bitsize, bitsize_zero_node));
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest,
rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt); new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
TREE_OPERAND (epilog_stmt, 0) = new_temp; TREE_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT); bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
...@@ -1043,10 +1046,12 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op, ...@@ -1043,10 +1046,12 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
bit_offset += element_bitsize) bit_offset += element_bitsize)
{ {
tree bitpos = bitsize_int (bit_offset); tree bitpos = bitsize_int (bit_offset);
tree rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
bitpos);
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest, epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest,
build3 (BIT_FIELD_REF, scalar_type, rhs);
vec_temp, bitsize, bitpos));
new_name = make_ssa_name (new_scalar_dest, epilog_stmt); new_name = make_ssa_name (new_scalar_dest, epilog_stmt);
TREE_OPERAND (epilog_stmt, 0) = new_name; TREE_OPERAND (epilog_stmt, 0) = new_name;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT); bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
...@@ -1074,6 +1079,8 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op, ...@@ -1074,6 +1079,8 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
if (extract_scalar_result) if (extract_scalar_result)
{ {
tree rhs;
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "extract scalar result"); fprintf (vect_dump, "extract scalar result");
...@@ -1085,9 +1092,9 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op, ...@@ -1085,9 +1092,9 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
else else
bitpos = bitsize_zero_node; bitpos = bitsize_zero_node;
epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest, rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp, bitsize, bitpos);
build3 (BIT_FIELD_REF, scalar_type, BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
new_temp, bitsize, bitpos)); epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt); new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
TREE_OPERAND (epilog_stmt, 0) = new_temp; TREE_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT); bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment