Changeset 14852 for trunk/source


Ignore:
Timestamp:
Jun 27, 2011, 5:25:23 PM (8 years ago)
Author:
rme
Message:

When assembling for a 32-bit x86 target, use the modrm encoding (and
not a sib) to specify a memory address that is just a displacement.

See ticket:860.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x86-asm.lisp

    r14838 r14852  
    471471           (cond ((null index)
    472472                  ;; Just a displacement.
    473                   (setf (ldb sib-index-byte sib) +no-index-register+))
     473                  (ccl::target-arch-case
     474                   (:x8632
     475                    ;; Don't use a sib in 32-bit mode.  In 64-bit
     476                    ;; mode, a sib is needed because this modrm
     477                    ;; encoding is used for rip-relative addressing.
     478                    (setf (ldb modrm-rm-byte rm-byte) +no-base-register+))
     479                   (:x8664
     480                    (setf (ldb sib-index-byte sib) +no-index-register+))))
    474481                 (t
    475482                  ;; No base, but index
Note: See TracChangeset for help on using the changeset viewer.