Intel ARCHITECTURE IA-32 User Manual Page 410

  • Download
  • Add to my manuals
  • Print
  • Page
    / 568
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 409
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.
Page view 409
1 2 ... 405 406 407 408 409 410 411 412 413 414 415 ... 567 568

Comments to this Manuals

No comments