This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SSE types and structures
> On Thu, Jun 13, 2002 at 10:24:21AM -0700, Richard Henderson wrote:
> > You should probably look at TREE_CODE == REAL_TYPE and
> > COMPLEX_TYPE instead of TYPE_MODE.
>
> Also, long long used to be 32-bit aligned.
Hi,
here is another incarnation. It rules out DFmodes/DImodes (and the
complex versions) and keeps alignment for anything else. I've tested
that the XFmodes works just fine, TImodes gets new alignment, but I
guess it is OK. The remaining problem is __m64.
I will give it some more serious testing later today. Hope this one
will be working as expected. I would like to get this properly for
release branch to avoid ABI changes once the new features become widely
used.
Fri Jun 14 15:33:40 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386-protos.h (x86_field_alignment): Declare.
* i386.c (x86_field_alignment): Define.
* i386.h (ADJUST_FIELD_ALIGNMENT): New.
(BIGGEST_FIELD_ALIGNMENT): Kill.
Index: i386-protos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386-protos.h,v
retrieving revision 1.74
diff -c -3 -p -r1.74 i386-protos.h
*** i386-protos.h 23 May 2002 21:55:25 -0000 1.74
--- i386-protos.h 14 Jun 2002 13:32:20 -0000
*************** extern unsigned int i386_pe_section_type
*** 205,210 ****
--- 205,211 ----
int));
extern void i386_pe_asm_named_section PARAMS ((const char *, unsigned int));
extern void x86_output_mi_thunk PARAMS ((FILE *, int, tree));
+ extern int x86_field_alignemnt PARAMS ((tree, int));
#endif
extern rtx ix86_tls_get_addr PARAMS ((void));
Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.424
diff -c -3 -p -r1.424 i386.c
*** i386.c 13 Jun 2002 16:25:51 -0000 1.424
--- i386.c 14 Jun 2002 13:32:24 -0000
*************** x86_output_mi_thunk (file, delta, functi
*** 13803,13806 ****
--- 13803,13823 ----
}
}
+ int
+ x86_field_alignemnt (field, computed)
+ tree field;
+ int computed;
+ {
+ enum machine_mode mode;
+ if (TARGET_64BIT || DECL_USER_ALIGN (field) || TARGET_ALIGN_DOUBLE)
+ return computed;
+ mode = TYPE_MODE (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE
+ ? get_inner_array_type (field) : TREE_TYPE (field));
+ if ((mode == DFmode || mode == DCmode
+ || mode == DImode || mode == CDImode)
+ && !TARGET_ALIGN_DOUBLE)
+ return MIN (32, computed);
+ return computed;
+ }
+
#include "gt-i386.h"
Index: i386.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.h,v
retrieving revision 1.272
diff -c -3 -p -r1.272 i386.h
*** i386.h 12 Jun 2002 14:51:09 -0000 1.272
--- i386.h 14 Jun 2002 13:32:25 -0000
*************** extern int x86_prefetch_sse;
*** 714,726 ****
/* The published ABIs say that doubles should be aligned on word
boundaries, so lower the aligment for structure fields unless
-malign-double is set. */
! /* BIGGEST_FIELD_ALIGNMENT is also used in libobjc, where it must be
! constant. Use the smaller value in that context. */
! #ifndef IN_TARGET_LIBS
! #define BIGGEST_FIELD_ALIGNMENT (TARGET_64BIT ? 128 : (TARGET_ALIGN_DOUBLE ? 64 : 32))
! #else
! #define BIGGEST_FIELD_ALIGNMENT 32
! #endif
/* If defined, a C expression to compute the alignment given to a
constant that is being placed in memory. EXP is the constant
--- 714,722 ----
/* The published ABIs say that doubles should be aligned on word
boundaries, so lower the aligment for structure fields unless
-malign-double is set. */
!
! #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
! x86_field_alignemnt (FIELD, COMPUTED)
/* If defined, a C expression to compute the alignment given to a
constant that is being placed in memory. EXP is the constant