IA-32 Intel® Architecture Optimization
8-2
This optimization holds true for the lower 8 general purpose registers:
EAX, ECX, EBX, EDX, ESP, EBP, ESI, EDI. To access the data in
registers r9-r15, the REX prefix is required. Using the 32-bit form there
does not reduce code size.
Assembly/Compiler Coding rule
Use the 32-bit versions of instructions in 64-bit mode to reduce code size
unless the 64-bit version is necessary to access 64-bit data or additional
registers.
Use Extra Registers to Reduce Register Pressure
64-bit mode makes 8 additional 64-bit general purpose registers and 8
additional XMM registers available to applications. To access the
additional registers, a single byte REX prefix is necessary. Using 8
additional registers can prevent the compiler from needing to spill
values onto the stack.
Note that the potential increase in code size, due to the REX prefix, can
increase cache misses. This can work against the benefit of using extra
registers to access the data. When eight registers are sufficient for an
algorithm, don’t use the registers that require an REX prefix. This will
keep the code size smaller.
Assembly/Compiler Coding rule
When they are needed to reduce register pressure, use the 8 extra general
purpose registers and 8 extra XMM registers for floating-point.
Use 64-Bit by 64-Bit Multiplies That Produce 128-Bit Results
Only When Necessary
Integer multiplies of 64-bit by 64-bit operands that produce a 128-bit
result cost more than multiplies that produce a 64-bit result. The upper
64-bits of a result take longer to compute than the lower 64 bits.
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...