Changeset 15035


Ignore:
Timestamp:
Oct 21, 2011, 11:30:30 PM (8 years ago)
Author:
gb
Message:

In X862-TWO-UNTARGETED-REG-FORMS: if we're called with a non-zero
restricted mask, we need to invalidate regmap entries between forms
(since generating code for the first form may reintroduce conflicting
entries.)

In X862-COPY-REGISTER: when copying between node registers, copy the
source's regmap entries to the destination.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x862.lisp

    r15032 r15035  
    35983598 
    35993599(defun x862-two-untargeted-reg-forms (seg aform areg bform breg &optional (restricted 0))
    3600   (unless (eql restricted 0)
    3601     (setq *x862-gpr-locations-valid-mask* (logandc2 *x862-gpr-locations-valid-mask* restricted)))
    3602   (with-x86-local-vinsn-macros (seg)
    3603     (let* ((avar (nx2-lexical-reference-p aform))
    3604            (adest nil)
    3605            (bdest nil)
    3606            (atriv (and (x862-trivial-p bform) (nx2-node-gpr-p breg)))
    3607            (aconst (and (not atriv) (or (x86-side-effect-free-form-p aform)
    3608                                         (if avar (nx2-var-not-set-by-form-p avar bform)))))
    3609            (apushed (not (or atriv aconst))))
    3610       (unless aconst
     3600  (let* ((restricted-by-caller restricted))
     3601    (with-x86-local-vinsn-macros (seg)
     3602      (let* ((avar (nx2-lexical-reference-p aform))
     3603             (adest nil)
     3604             (bdest nil)
     3605             (atriv (and (x862-trivial-p bform) (nx2-node-gpr-p breg)))
     3606             (aconst (and (not atriv) (or (x86-side-effect-free-form-p aform)
     3607                                          (if avar (nx2-var-not-set-by-form-p avar bform)))))
     3608             (apushed (not (or atriv aconst))))
     3609        (unless aconst
    36113610          (if atriv
    36123611            (progn
     3612              (unless (eql restricted-by-caller 0)
     3613                (setq *x862-gpr-locations-valid-mask* (logandc2 *x862-gpr-locations-valid-mask* restricted-by-caller)))
    36133614              (setq adest (x862-one-untargeted-reg-form seg aform areg restricted)
    36143615                    restricted (x862-restrict-node-target adest restricted))
     
    36173618            (setq apushed (x862-push-register
    36183619                           seg
    3619                            (x862-one-untargeted-reg-form seg aform areg)
     3620                           (x862-one-untargeted-reg-form seg aform areg restricted)
    36203621                           t))))
     3622        (unless (eql restricted-by-caller 0)
     3623          (setq *x862-gpr-locations-valid-mask* (logandc2 *x862-gpr-locations-valid-mask* restricted-by-caller)))
    36213624        (setq bdest (x862-one-untargeted-reg-form seg bform breg restricted)
    36223625              restricted (x862-restrict-node-target bdest restricted))
    36233626        (unless adest
     3627          (unless (eql restricted-by-caller 0)
     3628            (setq *x862-gpr-locations-valid-mask* (logandc2 *x862-gpr-locations-valid-mask* restricted-by-caller)))
    36243629          (when (same-x86-reg-p bdest areg)         
    36253630            (setq areg breg))
    3626         (if aconst
    3627           (setq adest (x862-one-untargeted-reg-form seg aform areg restricted))
    3628           (when apushed
    3629             (x862-elide-pushes seg apushed (x862-pop-register seg (setq adest areg))))))
    3630       (values adest bdest))))
     3631          (if aconst
     3632            (setq adest (x862-one-untargeted-reg-form seg aform areg restricted))
     3633            (when apushed
     3634              (x862-elide-pushes seg apushed (x862-pop-register seg (setq adest areg))))))
     3635        (values adest bdest)))))
    36313636
    36323637
     
    43544359              (if (eq src-mode dest-mode)
    43554360                (unless (eq src-gpr dest-gpr)
    4356                   (! copy-gpr dest src))
     4361                  (! copy-gpr dest src)
     4362                  (when (eql src-mode hard-reg-class-gpr-mode-node)
     4363                    (when (logbitp src-gpr *x862-gpr-locations-valid-mask*)
     4364                        (setf (svref *x862-gpr-locations* dest-gpr)
     4365                              (copy-list (svref *x862-gpr-locations* src-gpr))
     4366                              *x862-gpr-locations-valid-mask*
     4367                              (logior *x862-gpr-locations-valid-mask*
     4368                                      (ash 1 dest-gpr))))))
    43574369                ;; This is the "GPR <- GPR" case.  There are
    43584370                ;; word-size dependencies, but there's also
Note: See TracChangeset for help on using the changeset viewer.