Fold constant offset into memory addressing mode.

Bug #1778602 reported by Andrzej Walczak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

Feature request.

Often SBCL(Python) generates this amd64 assembly for addressing memory with base, an index and a constant offset.

; 99: 48D1FF SAR RDI, 1
; 9C: 4805A0000000 ADD RAX, 160
; A2: 48D1F8 SAR RAX, 1
; A5: 0FB61438 MOVZX EDX, BYTE PTR [RAX+RDI]
; A9: 48D1E2 SHL RDX, 1

The 80 (160/2) constant could be folded into the addressing mode like this:

; 99: 48D1FF SAR RDI, 1
; XX: 48D1F8 SAR RAX, 1
; XX: XXXXXXXX MOVZX EDX, BYTE PTR [RAX+RDI+80]
; XX: 48D1E2 SHL RDX, 1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.