Re: user-defined alignment in gfortran
- From: Tim Prince <timothyprince@xxxxxxxxxxxxx>
- Date: Tue, 29 May 2007 03:37:57 GMT
Dr Ivan D. Reid wrote:
On Tue, 29 May 2007 00:22:30 +0000 (UTC), Timo SchneiderFor many gfortran targets, this is controlled in part by parameters built into binutils. Typical 32-bit targets didn't even begin to support 16-byte alignment until SSE came along. At one time, various 32-bit gcc targets had maximum alignments supported in binutils of 4 or 8 bytes. Many people claimed that support for more than 4-byte alignment violated the ABI, as long as the hardware provided automatic alignment fix-up.
<timos@xxxxxxxxxxxxxxxxxx>
wrote in <slrnf5ms51.2q2.timos@xxxxxxxxxxxxxxxx>:
How do I tell gfortran to allign a complex*16 array at 16 byte
boundaries? This is necessary on the Cell BE architecture for being able
to do DMA transfer. In C I can write __attribute__((aligned(16))) and
it works. How can I do that with gfortran?
I wouldn't think you'd have to. I'd expect it to happen
automagically. ...or are you trying to align things up within a derived
type? Usual advice in that case is to assign your type/structure from
the largest elements down to the smallest, with character*? at the end.
When you have support for 16-byte alignment built into binutils, the gcc/gfortran option -mpreferred-stack-boundary=4 [this means 2**4] should accomplish what you requested. In current 32- and 64-bit gfortran implementations, this is the default, unless you set -Os, which tries to conserve stack space by setting smaller alignments, and disabling support for vectorization.
.
- Follow-Ups:
- Re: user-defined alignment in gfortran
- From: Timo Schneider
- Re: user-defined alignment in gfortran
- References:
- user-defined alignment in gfortran
- From: Timo Schneider
- Re: user-defined alignment in gfortran
- From: Dr Ivan D. Reid
- user-defined alignment in gfortran
- Prev by Date: Re: user-defined alignment in gfortran
- Next by Date: Re: strange arguments passing problem (from vba to fortran dll)
- Previous by thread: Re: user-defined alignment in gfortran
- Next by thread: Re: user-defined alignment in gfortran
- Index(es):
Relevant Pages
|