public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: target/10465: [AIX] allow -mnatural-align option for AIX as well
@ 2003-04-25 20:11 dje
  0 siblings, 0 replies; 3+ messages in thread
From: dje @ 2003-04-25 20:11 UTC (permalink / raw)
  To: dje, foskey, gcc-bugs, gcc-prs, kevin.hendricks, nobody

Synopsis: [AIX] allow -mnatural-align option for AIX as well

Responsible-Changed-From-To: unassigned->dje
Responsible-Changed-By: dje
Responsible-Changed-When: Fri Apr 25 20:11:57 2003
Responsible-Changed-Why:
    AIX
State-Changed-From-To: open->suspended
State-Changed-By: dje
State-Changed-When: Fri Apr 25 20:11:57 2003
State-Changed-Why:
    Kevin Hendricks is working on this.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10465


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: target/10465: [AIX] allow -mnatural-align option for AIX as well
@ 2003-04-25 21:06 Kevin B. Hendricks
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin B. Hendricks @ 2003-04-25 21:06 UTC (permalink / raw)
  To: dje; +Cc: gcc-prs

The following reply was made to PR target/10465; it has been noted by GNATS.

From: "Kevin B. Hendricks" <kevin.hendricks@sympatico.ca>
To: dje@gcc.gnu.org,
 dje@gcc.gnu.org,
 foskey@optushome.com.au,
 gcc-bugs@gcc.gnu.org,
 gcc-prs@gcc.gnu.org,
 nobody@gcc.gnu.org,
 gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: target/10465: [AIX] allow -mnatural-align option for AIX as well
Date: Fri, 25 Apr 2003 17:03:33 -0400

 --Boundary-00=_lKaq+cYdvu3uje6
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Hi David,
 
 I have preliminary patches for darwin.h (tested) and aix.h (untested)
 that I will send to Ken for further testing.
 
 I am unsure as to what target_flags mask values are safe to use for aix.
 
 If they work, I still need to track down what changes need to be made in 
 documentation to explain what this does. 
 
 Both preliminary patches are attached (against gcc 3.3 checked out today).
 
 With the darwin patch in place and using gnu g++ 3.3 with -malign-natural
 the gnu darwin build now passes all of the OpenOffice.org alignment tests 
 with flying colors.
 
 So the same approach should work fine for AIX  (I hope!)
 
 Take care,
 
 Kevin
 
 
 
 
 On April 25, 2003 04:11 pm, dje@gcc.gnu.org wrote:
 > Synopsis: [AIX] allow -mnatural-align option for AIX as well
 > 
 > Responsible-Changed-From-To: unassigned->dje
 > Responsible-Changed-By: dje
 > Responsible-Changed-When: Fri Apr 25 20:11:57 2003
 > Responsible-Changed-Why:
 >     AIX
 > State-Changed-From-To: open->suspended
 > State-Changed-By: dje
 > State-Changed-When: Fri Apr 25 20:11:57 2003
 > State-Changed-Why:
 >     Kevin Hendricks is working on this.
 > 
 > 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10465
 > 
 > 
 
 --Boundary-00=_lKaq+cYdvu3uje6
 Content-Type: text/x-diff;
   charset="iso-8859-1";
   name="darwin_final_align.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename="darwin_final_align.patch"
 
 --- darwin.h.~1.30.2.1.~	Thu Dec 19 20:49:57 2002
 +++ darwin.h	Fri Apr 25 16:41:29 2003
 @@ -210,12 +210,14 @@
  /* Fix for emit_group_load (): force large constants to be pushed via regs.  */
  #define ALWAYS_PUSH_CONSTS_USING_REGS_P		1
  
 +/* This now supports a natural alignment mode */
  /* Darwin word-aligns FP doubles but doubleword-aligns 64-bit ints.  */
  #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
 +  (TARGET_ALIGN_NATURAL ? (COMPUTED) : \
    (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
  	      ? get_inner_array_type (FIELD) \
 -	      : TREE_TYPE (FIELD)) == DFmode \
 -   ? MIN ((COMPUTED), 32) : (COMPUTED))
 +	      :  TREE_TYPE (FIELD)) == DFmode \
 +               ? MIN ((COMPUTED), 32) : (COMPUTED)))
  
  /* Darwin increases natural record alignment to doubleword if the first
     field is an FP double while the FP fields remain word aligned.  */
 @@ -224,11 +226,24 @@
      || TREE_CODE (STRUCT) == UNION_TYPE			\
      || TREE_CODE (STRUCT) == QUAL_UNION_TYPE)		\
     && TYPE_FIELDS (STRUCT) != 0				\
 +   && TARGET_ALIGN_NATURAL == 0                         \
     && DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode	\
     ? MAX (MAX ((COMPUTED), (SPECIFIED)), 64)		\
     : (TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
     ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128)           \
     : MAX ((COMPUTED), (SPECIFIED)))
 +
 +
 +/* Macros related to the switches that specify the alignment of fields within structs.  */
 +#define MASK_ALIGN_NATURAL      0x08000000 
 +#define TARGET_ALIGN_NATURAL    (target_flags & MASK_ALIGN_NATURAL) 
 +
 +#undef SUBTARGET_SWITCHES 
 +#define SUBTARGET_SWITCHES                                             \
 +  {"align-natural",     MASK_ALIGN_NATURAL,                            \
 +       N_("Align structs and unions according to natural rules")},
 +/* end natural alignment */
 +
  
  /* XXX: Darwin supports neither .quad, or .llong, but it also doesn't
     support 64 bit PowerPC either, so this just keeps things happy.  */
 
 --Boundary-00=_lKaq+cYdvu3uje6
 Content-Type: text/x-diff;
   charset="iso-8859-1";
   name="aix_final_align.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename="aix_final_align.patch"
 
 --- aix.h.~1.34.~	Mon Nov 25 23:54:49 2002
 +++ aix.h	Fri Apr 25 16:52:43 2003
 @@ -129,11 +129,14 @@
  %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc"
  
  /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints.  */
 +/* This now supports a natural alignment mode */
  #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
 +  (TARGET_ALIGN_NATURAL ? (COMPUTED) : \
    (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
 -	      ? get_inner_array_type (FIELD) \
 -	      : TREE_TYPE (FIELD)) == DFmode \
 -   ? MIN ((COMPUTED), 32) : (COMPUTED))
 +              ? get_inner_array_type (FIELD) \
 +	      :  TREE_TYPE (FIELD)) == DFmode \
 +   ? MIN ((COMPUTED), 32) : (COMPUTED)))
 +
  
  /* AIX increases natural record alignment to doubleword if the first
     field is an FP double while the FP fields remain word aligned.  */
 @@ -142,6 +145,7 @@
      || TREE_CODE (STRUCT) == UNION_TYPE			\
      || TREE_CODE (STRUCT) == QUAL_UNION_TYPE)		\
     && TYPE_FIELDS (STRUCT) != 0				\
 +   && TARGET_ALIGN_NATURAL == 0                         \
     && DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode	\
     ? MAX (MAX ((COMPUTED), (SPECIFIED)), 64)		\
     : MAX ((COMPUTED), (SPECIFIED)))
 @@ -154,12 +158,19 @@
  #undef TARGET_XL_CALL
  #define MASK_XL_CALL		0x40000000
  #define	TARGET_XL_CALL		(target_flags & MASK_XL_CALL)
 +
 +/* Enable natural alignment of fields within structs.  */
 +#undef TARGET_ALIGN_NATURAL
 +#define MASK_ALIGN_NATURAL      0x80000000 
 +#define TARGET_ALIGN_NATURAL    (target_flags & MASK_ALIGN_NATURAL) 
  #undef  SUBTARGET_SWITCHES
  #define SUBTARGET_SWITCHES		\
    {"xl-call", 		MASK_XL_CALL,					\
     N_("Always pass floating-point arguments in memory") },		\
    {"no-xl-call",	- MASK_XL_CALL,					\
     N_("Don't always pass floating-point arguments in memory") },	\
 +  {"align-natural",     MASK_ALIGN_NATURAL,                             \
 +   N_("Align structs and unions according to natural rules")},          \
    SUBSUBTARGET_SWITCHES
  #define SUBSUBTARGET_SWITCHES 
  
 
 --Boundary-00=_lKaq+cYdvu3uje6--
 


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: target/10465: [AIX] allow -mnatural-align option for AIX as well
@ 2003-05-19 21:34 dje
  0 siblings, 0 replies; 3+ messages in thread
From: dje @ 2003-05-19 21:34 UTC (permalink / raw)
  To: dje, foskey, gcc-bugs, gcc-prs, kevin.hendricks

Synopsis: [AIX] allow -mnatural-align option for AIX as well

State-Changed-From-To: suspended->closed
State-Changed-By: dje
State-Changed-When: Mon May 19 21:31:23 2003
State-Changed-Why:
    Feature added to GCC 3.4 experimental

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10465


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-19 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-25 20:11 target/10465: [AIX] allow -mnatural-align option for AIX as well dje
2003-04-25 21:06 Kevin B. Hendricks
2003-05-19 21:34 dje

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).