#154 (64-bit move can be made shorter) – The Yasm Modular Assembler Project

Ticket #154 (new enhancement)

Opened 5 months ago

64-bit move can be made shorter

Reported by: www.agner.org Owned by:
Priority: P2 Milestone:
Component: Core Version: 0.6.0
Severity: minor Keywords:
Cc:

Description

mov rax,1
is coded with a 32-bit sign-extended constant. The zero extended form is two bytes shorter. Note that mov eax,1 is the same as mov rax,1 because of implicit zero-extension.

mov rcx,0xaaaaaaaa
is coded with a full 64-bit constant. The zero-extended version is 5 bytes shorter.

The zero-extended version version is optimal when the constant is in the range
0 <= n < 232.
The sign-extended version is optimal in the range
-231 <= n < 0

Attachments

Add/Change #154 (64-bit move can be made shorter)

Author



Action
as new
 
Note: See TracTickets for help on using tickets.