public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: g++ 3.4.0 cygwin, codegen SSE & alignement issues
@ 2004-04-29  4:49 Ross Ridge
  2004-04-29  6:12 ` DJ Delorie
  0 siblings, 1 reply; 7+ messages in thread
From: Ross Ridge @ 2004-04-29  4:49 UTC (permalink / raw)
  To: gcc

> Well, it's quicker to allocate a constant size stack frame than to
>dynamically calculate the alignment requirements, but only by two or
>three fairly trivial instructions.  And although aligning the frame just
>once at startup and keeping it aligned by always allocating aligned-size
>stack frames, in some situations stack memory is a limited resource, and
>particularly since not all code uses vector registers, there's a lot of
>stack memory usage to be saved by not making all the stack frames bigger
>just for the sake of the very few frames for functions that actually
>use the vector regs.  So I'd say it's probably one of those trade-offs
>for which there's no one 'right' answer.

I think a happy middle-way, at least for the i386 port, would be to
implement a special function attribute, say __attribute__((align_stack)),
that only dynamically aligns the stack of functions defined with the
attribute.

						Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge@csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/u/rridge/ 
 db  //	  

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: g++ 3.4.0 cygwin, codegen SSE & alignement issues
@ 2004-04-29  6:46 Ross Ridge
  0 siblings, 0 replies; 7+ messages in thread
From: Ross Ridge @ 2004-04-29  6:46 UTC (permalink / raw)
  To: gcc

Ross Ridge wrote:
> I think a happy middle-way, at least for the i386 port, would be to
> implement a special function attribute, say __attribute__((align_stack)),
> that only dynamically aligns the stack of functions defined with the
> attribute.

DJ Delorie wrote:
> The existing align-stack code is target independent.  Why not create a
> target independent attribute?  The x86 isn't the only target that has
> this problem, just the only one with an OS that makes it so obvious
> (although Windows runs on various embedded chips also).

Well, the existing target independent forced align-stack code, which only
handles main(), is less than ideal on i386 Windows targets.  It generates
an unnecessary call to __alloca and wastes 16-bytes of stack space.
This isn't a problem since it currently only happens in main(), but it
would probably better to have the forced, dynamic, stack alignment code
done more intelligently in the backend where all the other prologue
stack allocation is handled.

						Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge@csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/u/rridge/ 
 db  //	  

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

end of thread, other threads:[~2004-04-29  3:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <408FCABF.2050702@ompf.org>
2004-04-28 16:56 ` g++ 3.4.0 cygwin, codegen SSE & alignement issues Dave Korn
2004-04-28 17:04   ` Tim Prince
2004-04-28 19:17     ` Dave Korn
2004-04-28 20:42     ` Brian Ford
2004-04-29  4:49 Ross Ridge
2004-04-29  6:12 ` DJ Delorie
2004-04-29  6:46 Ross Ridge

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