This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SSE types and structures


> On Sat, Jun 15, 2002 at 11:23:59PM +0200, Jan Hubicka wrote:
> > OK, I will do that separately.  Whats about the patch then?
> 
> I've lost which one you're referring to.
I believe this is the last incarnation.
It aligns DI/DF/XF modes and complex variants to the 32bit boundary,
while vector modes and TFmode is aligned to natural boundary.
We didn't get into conclusion about TFmodes. I still believe it makes
sense to increase the alignment, as only point of TFmodes is to get
alignment right and there is no released gcc version that supports them
reliably for 32bit compilation, but I can easilly add the mode into
list and I won't complain anymore :)

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]