This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Provide macro to override limiting field alignment
- From: Fred Forsman <forsman at apple dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 10 Dec 2001 18:35:26 -0800
- Subject: Re: [PATCH] Provide macro to override limiting field alignment
On Monday, December 10, 2001, at 05:59 PM, Richard Henderson wrote:
> On Mon, Dec 10, 2001 at 04:26:44PM -0800, Fred Forsman wrote:
>> This patch introduces a macro (LIMIT_FIELD_ALIGN) to limit the
>> of fields to maximum_field_alignment.
> Are you suggesting that perhaps "#pragma pack(N)" shouldn't do exactly
> what the user told us to do? This doesn't seem well conceived.
In my proposed patch the LIMIT_FIELD_ALIGN macro is used to replace
statements of the form
x = MIN (x, maximum_field_alignment);
x = LIMIT_FIELD_ALIGN (x);
As is, this does not change any behavior. It does, however, provide a
hook for handling the alignment of vector (AltiVec) data on the PowerPC,
where there is a "usual" maximum_field_alignment of 32 bits which must
be overridden for vector data. In the case of such vector data, the
vector alignment requirements take precedence above all else since the
processor masks off any unaligned bits of address in a vector access.
BTW, on Darwin we support two alignment modes, the default "power"
alignment (in which maximum_field_alignment is 0, but in fact usually
constrained to 32) and "mac68k" (in which maximum_field_alignment is
16). Vector data in both of these alignment modes is treated as an
exception to the usual rules and is 128-bit aligned.
I'd appreciate your suggestions on how to treat this issue.