25112 Rev. 3.06 September 2005

Software Optimization Guide for AMD64 Processors

4.108-Bit Sign-Extended Immediate Values

Optimization

Use 8-bit sign-extended immediate values instead of larger-size values.

Application

This optimization applies to:

32-bit software

64-bit software

Rationale

Using 8-bit sign-extended immediate values improves code density with no negative affects on the processor.

Example

Consider this instruction:

add bx, -5

Avoid encoding it as:

81 C3 FF FB

Instead, encode it as:

83 C3 FB

Chapter 4

Instruction-Decoding Optimizations

87

Page 103
Image 103
AMD 250 manual 10 8-Bit Sign-Extended Immediate Values