
IA-32 Intel® Architecture Optimization
D-2
alignment for
__m64
and
double
type data by enforcing that these
64-bit data items are at least eight-byte aligned (they will now be
16-byte aligned).
For variables allocated in the stack frame, the compiler cannot
guarantee the base of the variable is aligned unless it also ensures that
the stack frame itself is 16-byte aligned. Previous IA-32 software
conventions, as implemented in most compilers, only ensure that
individual stack frames are 4-byte aligned. Therefore, a function called
from a Microsoft-compiled function, for example, can only assume that
the frame pointer it used is 4-byte aligned.
Earlier versions of the Intel C++ Compiler for Win32 Systems have
attempted to provide 8-byte aligned stack frames by dynamically
adjusting the stack frame pointer in the prologue of
main
and preserving
8-byte alignment of the functions it compiles. This technique is limited
in its applicability for the following reasons:
•
The
main
function must be compiled by the Intel C++ Compiler.
•
There may be no functions in the call tree compiled by some other
compiler (as might be the case for routines registered as callbacks).
•
Support is not provided for proper alignment of parameters.
The solution to this problem is to have the function’s entry point assume
only 4-byte alignment. If the function has a need for 8-byte or 16-byte
alignment, then code can be inserted to dynamically align the stack
appropriately, resulting in one of the stack frames shown in Figure D-1.
Summary of Contents for ARCHITECTURE IA-32
Page 1: ...IA 32 Intel Architecture Optimization Reference Manual Order Number 248966 013US April 2006...
Page 220: ...IA 32 Intel Architecture Optimization 3 40...
Page 434: ...IA 32 Intel Architecture Optimization 9 20...
Page 514: ...IA 32 Intel Architecture Optimization B 60...
Page 536: ...IA 32 Intel Architecture Optimization C 22...