This is the mail archive of the
mailing list for the GCC project.
Re: How should _Decimal64 and _Decimal128 be aligned on stack?
On Sun, Mar 23, 2008 at 8:09 AM, H.J. Lu <email@example.com> wrote:
> On Sun, Mar 23, 2008 at 11:41:00PM +1100, Ben Elliston wrote:
> > > DFP is beyond i386 psABI. Gcc aligns _Decimal32 to 4 byte, _Decimal64 to 8 bytes
> > > and _Decimal128 to 16bytes. The question is what is the best alignment for them
> > > when passing to a functions.
> > The original work I did for the x86-64 backend placed them at that
> > alignment because that is the required alignment for loading those
> > values into SSE registers. Right?
> That is a good question. For x86, _Decimal128 is passed on stack
> and aligned at 4 byte. For x86-64, _Decimal128 is passed in SSE
> registers. An implementation of _Decimal128 in 32bit may want
> to use SSE registers.
I think we should align _Decimal64 and _Decimal128 to their natural
alignments when passing a function. The same should apply to x86-64
when they are passed on stack.