Changeset 10505


Ignore:
Timestamp:
Aug 21, 2008, 8:41:12 AM (11 years ago)
Author:
gb
Message:

Support memory operands of the form (:rcontext displacment), which
will expand into either (@ (%seg rcontext) displacement) or
(@ displacement (% rcontext)) according to whether or not
"rcontext" is a segment register (most platforms) or a GPR (win64).

(I haven't tested this yet; am checking it in to see if it works ...)

Location:
trunk/source/compiler/X86
Files:
2 edited

Legend:

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

    r10200 r10505  
    5050        (:%mmx (x86::encode-operand-type :regmmx))
    5151        (:@ (x86::encode-operand-type :anymem))
     52        (:rcontext (x86::encode-operand-type :anymem))
    5253        (:$1 (x86::encode-operand-type :imm1) )
    5354        (:$b (x86::encode-operand-type :imm8s ))
     
    278279                              (cons :@
    279280                                    (simplify-memory-operand (cdr op))))
     281                             ((eq (car op) :rcontext)
     282                              (list :rcontext
     283                                    (simplify-simple-operand (cadr op))))
    280284                             ((member (car op)
    281285                                      '(:% :%q :%l :%w :%b
  • trunk/source/compiler/X86/x86-lap.lisp

    r10207 r10505  
    705705;;; ($ x) -> immediate
    706706;;; (@ x) -> memory operand
     707;;; (:rcontext x) -> memory operand, using segment register or gpr
     708;;; (:self fn) -> self-reference
    707709;;; x -> labelref
    708710(defun parse-x86-operand (form)
     
    722724                     (setq type (x86::encode-operand-type :self)))
    723725                   (x86::make-x86-immediate-operand :type type
    724                                              :value expr))))
     726                                                    :value expr))))
     727              ((eq head :rcontext)
     728               (if (>= (backend-lisp-context-register *target-backend*)
     729                       x86::+x86-segment-register-offset+)
     730                 (parse-x86-memory-operand `((% :rcontext) ,(cadr form)))
     731                 (parse-x86-memory-operand `(,(cadr form) (% :rcontext)))))
    725732              ((setq designator (x86-register-designator form))
    726733               (destructuring-bind (reg) (cdr form)
Note: See TracChangeset for help on using the changeset viewer.