This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
i386 alignment tweaks...
- To: egcs-patches at egcs dot cygnus dot com, rth at cygnus dot com
- Subject: i386 alignment tweaks...
- From: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Date: Thu, 13 Jan 2000 13:27:33 +0100
Hi
I've been experimenting a bit with using fild/fist instruction to
move DImode values and using them in memset/memcpy expanders.
I've run into problems with gcc roudning alignment
to BIGGEST_ALIGNMENT, that is defined to 32 only.
From the docs I think, we can define BIGGEST_ALIGNMENT to real biggest
alignment (128 bits for XFmode) and use BIFFEST_FIELD_ALIGNMENT to
preserve ABI compatibility.
This can avoid unnecesary roudning, but I am not sure that it will
not break ABI (while grepping gcc sources one of places I am not sure
about are bitfields).
Patch also sets alignment of QImode arrays to 128 bit in order to
allow use fast string operations like some other machine definitions
does.
St leden 12 03:31:05 CET 2000 Jan Hubicka <jh@suse.cz>
* i386.h (BIGGEST_ALIGNMENT): Set to 128.
(BIGGEST_FIELD_ALIGNMENT): Set to (TARGET_ALIGN_DOUBLE ? 64 : 32)
(DATA_ALIGNMENT, LOCAL_ALIGNMENT): Set alignment of QImode arrays
to 128.
*** i386.h.old Wed Jan 12 00:03:59 2000
--- i386.h Wed Jan 12 03:02:48 2000
*************** extern int ix86_arch;
*** 446,457 ****
/* Minimum size in bits of the largest boundary to which any
and all fundamental data types supported by the hardware
might need to be aligned. No data type wants to be aligned
! rounder than this. The i386 supports 64-bit floating point
! quantities, but these can be aligned on any 32-bit boundary.
! The published ABIs say that doubles should be aligned on word
! boundaries, but the Pentium gets better performance with them
! aligned on 64 bit boundaries. */
! #define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
/* If defined, a C expression to compute the alignment given to a
constant that is being placed in memory. CONSTANT is the constant
--- 448,465 ----
/* Minimum size in bits of the largest boundary to which any
and all fundamental data types supported by the hardware
might need to be aligned. No data type wants to be aligned
! rounder than this.
!
! Pentium+ preferrs DFmode values to be alignmed to 64 bit boundary
! and Pentium Pro XFmode values at 128 bit boundaries. */
!
! #define BIGGEST_ALIGNMENT 128
!
! /* The published ABIs say that doubles should be aligned on word
! boundaries, so lower the aligmnet for structure fields unless
! -malign_double is set. */
!
! #define BIGGEST_FIELD_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
/* If defined, a C expression to compute the alignment given to a
constant that is being placed in memory. CONSTANT is the constant
*************** extern int ix86_arch;
*** 502,507 ****
--- 510,517 ----
? 64 \
: (TYPE_MODE (TREE_TYPE (TYPE)) == XFmode && (ALIGN) < 128) \
? 128 \
+ : (TYPE_MODE (TREE_TYPE (TYPE)) == QImode && (ALIGN) < 128) \
+ ? 128 \
: (ALIGN)) \
: TREE_CODE (TYPE) == COMPLEX_TYPE \
? ((TYPE_MODE (TYPE) == DCmode && (ALIGN) < 64) \
*************** extern int ix86_arch;
*** 542,547 ****
--- 552,559 ----
? 64 \
: (TYPE_MODE (TREE_TYPE (TYPE)) == XFmode && (ALIGN) < 128) \
? 128 \
+ : (TYPE_MODE (TREE_TYPE (TYPE)) == QImode && (ALIGN) < 128) \
+ ? 128 \
: (ALIGN)) \
: TREE_CODE (TYPE) == COMPLEX_TYPE \
? ((TYPE_MODE (TYPE) == DCmode && (ALIGN) < 64) \