Changeset 10753


Ignore:
Timestamp:
Sep 15, 2008, 11:16:09 PM (11 years ago)
Author:
gb
Message:

Pass the backend to MATCH-TEMPLATE-TYPES in LOOKUP-X86-OPCODE.
Accept a "backend" argument in FIXUP-OPCODE-ORDINALS and FIXUP-X86-VINSN-TEMPLATES
and pass it down to MATCH-TEMPLATE-TYPES.

File:
1 edited

Legend:

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

    r10505 r10753  
    7373                 (type2 (optype (car operands))))
    7474            (dolist (template templates)
    75               (when (x86::match-template-types template type0 type1 type2)
     75              (when (x86::match-template-types template type0 type1 type2 backend)
    7676                (collect ((types))
    7777                  (if type0 (types type0))
     
    8181                                  (types))))))))))))
    8282
    83 (defun fixup-opcode-ordinals (vinsn-template opcode-templates)
     83(defun fixup-opcode-ordinals (vinsn-template opcode-templates &optional (backend *target-backend*))
    8484  (let* ((changed ()))
    8585    (dolist (vinsn-opcode (vinsn-template-opcode-alist vinsn-template))
     
    8989            (error "Unknown X86 instruction - ~a.  Odd, because it was once a known instruction." name))
    9090        (let* ((new-ordinal (dolist (template opcode-templates)
    91                               (when (x86::match-template-types template type0 type1 type2)
     91                              (when (x86::match-template-types template type0 type1 type2 backend)
    9292                                (return (x86::x86-opcode-template-ordinal template))))))
    9393          (unless new-ordinal
     
    121121(defparameter *report-missing-vinsns* nil)
    122122
    123 (defun fixup-x86-vinsn-templates (template-hash opcode-templates)
     123(defun fixup-x86-vinsn-templates (template-hash opcode-templates &optional (backend *target-backend*))
    124124  (maphash #'(lambda (name vinsn-template)
    125125               (if (not (cdr vinsn-template))
    126126                 (when *report-missing-vinsns*
    127127                   (warn "Reference to undefined vinsn ~s" name))
    128                  (fixup-opcode-ordinals (cdr vinsn-template) opcode-templates)))
     128                 (fixup-opcode-ordinals (cdr vinsn-template) opcode-templates backend)))
    129129           template-hash))
    130130
Note: See TracChangeset for help on using the changeset viewer.