Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How should _Decimal64 and _Decimal128 be aligned on stack?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
H.J.  
View profile  
 More options Mar 21 2008, 8:29 pm
From: "H.J." <hjl.to...@gmail.com>
Date: Fri, 21 Mar 2008 17:29:38 -0700 (PDT)
Local: Fri, Mar 21 2008 8:29 pm
Subject: How should _Decimal64 and _Decimal128 be aligned on stack?
When passing _Decimal64 or _Decimal128 to a function via stack, how
should they be aligned? Currently, gcc aligns them at 4byte boundary.
Is this desirable?

H.J.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
H.J. Lu  
View profile  
 More options Mar 22 2008, 12:00 am
From: "H.J. Lu" <hjl.to...@gmail.com>
Date: Fri, 21 Mar 2008 21:00:25 -0700
Local: Sat, Mar 22 2008 12:00 am
Subject: Re: How should _Decimal64 and _Decimal128 be aligned on stack?

On Fri, Mar 21, 2008 at 5:37 PM, Andrew Pinski <pins...@gmail.com> wrote:
> On Fri, Mar 21, 2008 at 5:29 PM, H.J. <hjl.to...@gmail.com> wrote:
>  > When passing _Decimal64 or _Decimal128 to a function via stack, how
>  >  should they be aligned? Currently, gcc aligns them at 4byte boundary.
>  >  Is this desirable?

>  Shouldn't it always be 4 byte aligned because the SysV ABI only talks
>  about word alignment?

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.

H.J.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Eager  
View profile  
 More options Mar 22 2008, 11:48 am
From: Michael Eager <ea...@eagercon.com>
Date: Sat, 22 Mar 2008 08:48:02 -0700
Local: Sat, Mar 22 2008 11:48 am
Subject: Re: How should _Decimal64 and _Decimal128 be aligned on stack?

H.J. Lu wrote:
> On Fri, Mar 21, 2008 at 5:37 PM, Andrew Pinski <pins...@gmail.com> wrote:
>> On Fri, Mar 21, 2008 at 5:29 PM, H.J. <hjl.to...@gmail.com> wrote:
>>  > When passing _Decimal64 or _Decimal128 to a function via stack, how
>>  >  should they be aligned? Currently, gcc aligns them at 4byte boundary.
>>  >  Is this desirable?

>>  Shouldn't it always be 4 byte aligned because the SysV ABI only talks
>>  about word alignment?

> 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.

Unless there is some hardware penalty in loading from
a 4-byte boundary rather than 8-byte boundary, then it
would seem that 4-byte alignment is simpler.  On the
other hand, it would seem that alignment of a data value
should be on the expected boundary whether it statically
allocated or passed to a function.

--
Michael Eager    ea...@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
H.J. Lu  
View profile  
 More options Mar 23 2008, 11:09 am
From: "H.J. Lu" <hjl.to...@gmail.com>
Date: Sun, 23 Mar 2008 08:09:18 -0700
Local: Sun, Mar 23 2008 11:09 am
Subject: Re: How should _Decimal64 and _Decimal128 be aligned on stack?

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.

H.J.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
H.J. Lu  
View profile  
 More options Mar 24 2008, 8:29 pm
From: "H.J. Lu" <hjl.to...@gmail.com>
Date: Mon, 24 Mar 2008 17:29:53 -0700
Local: Mon, Mar 24 2008 8:29 pm
Subject: Re: How should _Decimal64 and _Decimal128 be aligned on stack?

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.

H.J.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Kreitzer  
View profile  
 More options Apr 1 2008, 1:53 pm
From: Dave Kreitzer <david.l.kreit...@intel.com>
Date: Tue, 1 Apr 2008 10:53:39 -0700 (PDT)
Local: Tues, Apr 1 2008 1:53 pm
Subject: Re: How should _Decimal64 and _Decimal128 be aligned on stack?

> 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.

Rather than aligning _Decimal64 to its natural boundary, I think it is
more sensible to be consistent with the existing 8-byte scalar types,
i.e. double and long long.  That would mean aligning _Decimal64 to 4
bytes within structures and when passing to a function.

For _Decimal128, I agree with the conclusion to align to 16-bytes
within structures and as outgoing arguments.  That behavior is
consistent with the existing data types __m128, __m128d, and __m128i.

Dave Kreitzer
IA-32 and Intel 64 Code Generation
Intel Compiler Lab


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
H.J. Lu  
View profile  
 More options Apr 1 2008, 2:18 pm
From: "H.J. Lu" <hjl.to...@gmail.com>
Date: Tue, 1 Apr 2008 11:18:04 -0700
Local: Tues, Apr 1 2008 2:18 pm
Subject: Re: How should _Decimal64 and _Decimal128 be aligned on stack?
Hi David,

I added gcc mailing list.

H.J.
On Tue, Apr 1, 2008 at 10:53 AM, Dave Kreitzer

<david.l.kreit...@intel.com> wrote:

>  > 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.

>  Rather than aligning _Decimal64 to its natural boundary, I think it is
>  more sensible to be consistent with the existing 8-byte scalar types,
>  i.e. double and long long.  That would mean aligning _Decimal64 to 4
>  bytes within structures and when passing to a function.

That means to change the default alignment of  _Decimal64 to 4 bytes in
32bit mode.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »