This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
HP-UX IA64 Vectorizer patch (in common source)
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Oct 2005 14:25:01 -0700 (PDT)
- Subject: HP-UX IA64 Vectorizer patch (in common source)
- Reply-to: sje at cup dot hp dot com
I have been looking into the gcc.dg/vect/* test failures on IA64 HP-UX
and tracked the reduction failures to the attached piece of code. I
can't justify this patch with any explanation other than "it makes it
work". IA64 HP-UX (like Linux) has BITS_BIG_ENDIAN set to 0, but
BYTES_BIG_ENDIAN and WORDS_BIG_ENDIAN are 1 on HP-UX and 0 on Linux.
Can somone who is more familiar with this code look at it and tell me if
it looks OK or not? It caused no regressions on IA64 HP-UX or Linux and
fixed some bugs on HP-UX.
Steve Ellcey
sje@cup.hp.com
2005-10-03 Steve Ellcey <sje@cup.hp.com>
* tree-vect-transform.c (vect_create_epilog_for_reduction):
Use BYTES_BIG_ENDIAN instead of BITS_BIG_ENDIAN.
*** gcc.orig/gcc/tree-vect-transform.c Mon Oct 3 12:44:56 2005
--- gcc/gcc/tree-vect-transform.c Mon Oct 3 12:44:44 2005
*************** vect_create_epilog_for_reduction (tree v
*** 994,1000 ****
fprintf (vect_dump, "extract scalar result");
/* The result is in the low order bits. */
! if (BITS_BIG_ENDIAN)
bitpos = size_binop (MULT_EXPR,
bitsize_int (TYPE_VECTOR_SUBPARTS (vectype) - 1),
TYPE_SIZE (scalar_type));
--- 994,1000 ----
fprintf (vect_dump, "extract scalar result");
/* The result is in the low order bits. */
! if (BYTES_BIG_ENDIAN)
bitpos = size_binop (MULT_EXPR,
bitsize_int (TYPE_VECTOR_SUBPARTS (vectype) - 1),
TYPE_SIZE (scalar_type));