Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com X-Apparently-From: Message-ID: <3BE30B9B.C7F614E7@yahoo.com> Date: Fri, 02 Nov 2001 16:09:47 -0500 From: Earnie Boyd X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin-developers AT cygwin DOT com Subject: Re: -mpreferred-stack-boundary=2? References: <20011102001706 DOT A10347 AT redhat DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Christopher Faylor wrote: > > I just added the -mpreferred-stack-boundary=2 option to Makefile.common. > Is there a good reason not to do this? From the description in > gcc.info, it seems like the cases that they are talking about don't > affect the cygwin part of things, although it would conceivably be iffy > to use this switch in the newlib. > > The code size reduction is noticeable. > Hmm... In my use of this switch I set the value to 8. I did this based on the documentation for this switch in the info file. `-mpreferred-stack-boundary=NUM' Attempt to keep the stack boundary aligned to a 2 raised to NUM byte boundary. If `-mpreferred-stack-boundary' is not specified, the default is 4 (16 bytes or 128 bits). The stack is required to be aligned on a 4 byte boundary. On Pentium and PentiumPro, `double' and `long double' values should be aligned to an 8 byte boundary (see `-malign-double') or suffer significant run time performance penalties. On Pentium III, the Streaming SIMD Extention (SSE) data type `__m128' suffers similar penalties if it is not 16 byte aligned. To ensure proper alignment of this values on the stack, the stack boundary must be as aligned as that required by any value stored on the stack. Further, every function must be generated such that it keeps the stack aligned. Thus calling a function compiled with a higher preferred stack boundary from a function compiled with a lower preferred stack boundary will most likely misalign the stack. It is recommended that libraries that use callbacks always use the default setting. This extra alignment does consume extra stack space. Code that is sensitive to stack space usage, such as embedded systems and operating system kernels, may want to reduce the preferred alignment to `-mpreferred-stack-boundary=2'. The bits on pentium suggest that I didn't want 2, I don't have results for tests using 8 bit it felt faster. -- Earnie. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com