EasyManuals Logo

Intel ARCHITECTURE IA-32 User Manual

Intel ARCHITECTURE IA-32
568 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #411 background imageLoading...
Page #411 background image
64-bit Mode Coding Guidelines 8
8-3
If the compiler can determine at compile time that the result of a
multiply will not exceed 64 bits, then the compiler should generate the
multiply instruction that produces a 64-bit result. If the compiler or
assembly programmer can not determine that the result will be less than
64 bits, then a multiply that produces a 128-bit result is necessary.
Assembly/Compiler Coding rule
Prefer 64-bit by 64-bit integer multiplies that produce 64-bit results over
multiplies that produce 128-bit results.
Sign Extension to Full 64-Bits
When in 64-bit mode, the architecture is optimized to sign-extend to
64 bits in a single uop. In 64-bit mode, when the destination is 32 bits,
the upper 32 bits must be zeroed.
Zeroing the upper 32 bits requires an extra uop and is less optimal than
sign extending to 64 bits. While sign extending to 64 bits makes the
instruction one byte longer, it reduces the number of uops that the trace
cache has to store, improving performance.
For example, to sign-extend a byte into esi, use:
movsx rsi, BYTE PTR[rax]
instead of:
movsx esi, BYTE PTR[rax]
If the next instruction uses the 32-bit form of esi register, the result will
be the same. This optimization can also be used to break an unintended
dependency. For example, if a program writes a 16-bit value to a register
and then writes the register with an 8-bit value, if bits 15:8 of the
destination are not needed, use the sign-extended version of writes when
available.
For example:
mov r8w, r9w ;Requires a merge to preserve
;bits 63:15.
mov r8b, r10b ;Requires a merge to preserve bits 63:8

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Intel ARCHITECTURE IA-32 and is the answer not in the manual?

Intel ARCHITECTURE IA-32 Specifications

General IconGeneral
Instruction Setx86
Instruction Set TypeCISC
Memory SegmentationSupported
Operating ModesReal mode, Protected mode, Virtual 8086 mode
Max Physical Address Size36 bits (with PAE)
Max Virtual Address Size32 bits
ArchitectureIA-32 (Intel Architecture 32-bit)
Addressable Memory4 GB (with Physical Address Extension up to 64 GB)
Floating Point Registers8 x 80-bit
MMX Registers8 x 64-bit
SSE Registers8 x 128-bit
RegistersGeneral-purpose registers (EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP), Segment registers (CS, DS, SS, ES, FS, GS), Instruction pointer (EIP), Flags register (EFLAGS)
Floating Point UnitYes (x87)

Related product manuals