Date: Tue, 26 Jun 2001 16:27:54 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: DJGPP reserves wrong int size In-Reply-To: <3b37e92e.288745911@news.primus.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 26 Jun 2001, Graaagh the Mighty wrote: > >The purpose of that is to keep the stack aligned to a 32 byte > >boundary, which improves performance on today's high-end processors. > > Modern processors care about alignments as large as *256 bits*!? 64 > bits for doubles or for ints on 64 bit chips, I figured, but 256!? It's all in the Intel manuals; please read them. Due to various data prefetch penalties, they recommend that the stack be aligned on 16-byte boundary. I didn't analyze the code produced by GCC too deeply, but it might be considering the possibility that the stack frame is only aligned initially to 4 bytes, since greater alignment is normally not guaranteed, especially if you mix code produced by different compilers.