Changeset 15024


Ignore:
Timestamp:
Oct 17, 2011, 1:22:23 PM (8 years ago)
Author:
gb
Message:

x8664-vinsns.lisp: don't (necessarily) clobber ra0 in PUSH-LABEL vinsn,
use an arbitrary node reg as a temp.
vreg.lisp: PRINT-LREG writes to specified stream always.
x862.lisp: n-UNTARGETED-REG-FORMS: can introduce conflicts right-to-left,too.

Location:
trunk/source/compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8664/x8664-vinsns.lisp

    r15022 r15024  
    1 ;;;-*- Mode: Lisp; Package: (X86 :use CL) -*-
     1;;;-*- Mode: Lisp; Package: CCL -*-
    22;;;
    33;;;   Copyright (C) 2005-2009 Clozure Associates and contributors.
     
    17801780
    17811781(define-x8664-vinsn (vpush-label :push :node :vsp) (()
    1782                                                  ((label :label)))
    1783   (leaq (:@ (:^ label) (:%q x8664::fn)) (:%q x8664::ra0))
    1784   (pushq (:%q x8664::ra0)))
     1782                                                    ((label :label))
     1783                                                    ((temp :lisp)))
     1784  (leaq (:@ (:^ label) (:%q x8664::fn)) (:%q temp))
     1785  (pushq (:%q temp)))
    17851786
    17861787;; ????
  • trunk/source/compiler/X86/x862.lisp

    r15022 r15024  
    36023602  (with-x86-local-vinsn-macros (seg)
    36033603    (let* ((avar (nx2-lexical-reference-p aform))
    3604            (adest areg)
    3605            (bdest breg)
     3604           (adest nil)
     3605           (bdest nil)
    36063606           (atriv (and (x862-trivial-p bform) (nx2-node-gpr-p breg)))
    36073607           (aconst (and (not atriv) (or (x86-side-effect-free-form-p aform)
    36083608                                        (if avar (nx2-var-not-set-by-form-p avar bform)))))
    36093609           (apushed (not (or atriv aconst))))
    3610       (progn
    3611         (unless aconst
     3610      (unless aconst
    36123611          (if atriv
    36133612            (progn
     
    36223621        (setq bdest (x862-one-untargeted-reg-form seg bform breg restricted)
    36233622              restricted (x862-restrict-node-target bdest restricted))
    3624         (when (same-x86-reg-p bdest areg)         
    3625           (setq areg breg)
    3626           (when apushed
    3627             (setq adest areg)))
     3623        (unless adest
     3624          (when (same-x86-reg-p bdest areg)         
     3625            (setq areg breg))
    36283626        (if aconst
    36293627          (setq adest (x862-one-untargeted-reg-form seg aform areg restricted))
    36303628          (when apushed
    3631             (x862-elide-pushes seg apushed (x862-pop-register seg areg)))))
     3629            (x862-elide-pushes seg apushed (x862-pop-register seg (setq adest areg))))))
    36323630      (values adest bdest))))
    36333631
     
    37713769                         (let ((bvar (nx2-lexical-reference-p bform)))
    37723770                           (and bvar (nx2-var-not-set-by-form-p bvar cform))))))
    3773            (adest areg)
    3774            (bdest breg)
    3775            (cdest creg)
     3771           (adest nil)
     3772           (bdest nil)
     3773           (cdest nil)
    37763774           (apushed nil)
    37773775           (bpushed nil))
    3778       (if (and aform (not aconst))
     3776      (when (and aform (not aconst))
    37793777        (if atriv
    37803778          (progn
     
    37883786                         seg
    37893787                         (x862-one-untargeted-reg-form seg aform areg)))))
    3790       (if (and bform (not bconst))
     3788      (when (and bform (not bconst))
    37913789        (if btriv
    37923790          (progn
    37933791            (setq bdest (x862-one-untargeted-reg-form seg bform ($ breg) restricted)
    37943792                  restricted (x862-restrict-node-target bdest restricted))
     3793            (unless adest
     3794              (when (same-x86-reg-p bdest areg)
     3795                (setq areg breg)))
    37953796            (when (same-x86-reg-p bdest creg)
    3796               (setq creg breg))
    3797             (when (same-x86-reg-p bdest areg)
    3798               (setq areg breg)))
     3797              (setq creg breg)))
    37993798          (setq bpushed (x862-push-register
    38003799                         seg (x862-one-untargeted-reg-form seg bform breg)))))
     
    38023801            restricted (x862-restrict-node-target cdest restricted))
    38033802      (when (same-x86-reg-p cdest areg)
    3804         (setq areg creg)
    3805         (when apushed
    3806           (setq adest areg)))
     3803        (setq areg creg))
    38073804      (when (same-x86-reg-p cdest breg)
    3808         (setq breg creg)
    3809         (when bpushed
    3810           (setq bdest breg)))
     3805        (setq breg creg))
    38113806      (unless btriv
    38123807        (if bconst
     
    38153810                  restricted (x862-restrict-node-target bdest restricted))
    38163811            (when (same-x86-reg-p bdest areg)
    3817               (setq areg breg)
    3818               (when apushed
    3819                 (setq adest areg))))
    3820           (x862-elide-pushes seg bpushed (x862-pop-register seg breg))))
     3812              (setq areg breg)))
     3813          (x862-elide-pushes seg bpushed (x862-pop-register seg (setq bdest breg)))))
    38213814      (unless atriv
    38223815        (if aconst
    38233816          (setq adest (x862-one-untargeted-reg-form seg aform areg restricted))
    3824           (x862-elide-pushes seg apushed (x862-pop-register seg areg))))
     3817          (x862-elide-pushes seg apushed (x862-pop-register seg (setq adest areg)))))
    38253818      (values adest bdest cdest))))
    38263819
     
    38633856                         (and cvar
    38643857                              (nx2-var-not-set-by-form-p cvar dform))))))
    3865          (adest areg)
    3866          (bdest breg)
    3867          (cdest creg)
    3868          (ddest dreg)
     3858         (adest nil)
     3859         (bdest nil)
     3860         (cdest nil)
     3861         (ddest nil)
    38693862         (apushed nil)
    38703863         (bpushed nil)
    3871          (cpushed nil))
    3872     (if (and aform (not aconst))
     3864         (cpushed nil))         
     3865    (when (and aform (not aconst))
    38733866      (if atriv
    38743867        (progn
    38753868          (setq adest (x862-one-untargeted-reg-form seg aform areg restricted)
    38763869                restricted (x862-restrict-node-target adest restricted))
    3877           (when (same-x86-reg-p adest breg)
     3870          (when (same-x86-reg-p breg adest)
    38783871            (setq breg areg))
    3879           (when (same-x86-reg-p adest creg)
     3872          (when (same-x86-reg-p creg adest)
    38803873            (setq creg areg))
    3881           (when (same-x86-reg-p adest dreg)
     3874          (when (same-x86-reg-p dreg adest)
    38823875            (setq dreg areg)))
    38833876        (setq apushed (x862-push-register seg (x862-one-untargeted-reg-form seg aform areg)))))
    3884     (if (and bform (not bconst))
     3877    (when (and bform (not bconst))
    38853878      (if btriv
    38863879        (progn
    38873880          (setq bdest (x862-one-untargeted-reg-form seg bform breg restricted)
    38883881                restricted (x862-restrict-node-target bdest restricted))
    3889           (when (same-x86-reg-p bdest creg)
     3882          (unless adest
     3883            (when (same-x86-reg-p areg bdest)
     3884              (setq areg breg)))
     3885          (when (same-x86-reg-p creg bdest)
    38903886            (setq creg breg))
    3891           (when (same-x86-reg-p bdest dreg)
     3887          (when (same-x86-reg-p dreg bdest)
    38923888            (setq dreg breg)))
    38933889        (setq bpushed (x862-push-register seg (x862-one-untargeted-reg-form seg bform breg)))))
    3894     (if (and cform (not cconst))
     3890    (when (and cform (not cconst))
    38953891      (if ctriv
    38963892        (progn
    38973893          (setq cdest (x862-one-untargeted-reg-form seg cform creg restricted)
    38983894                restricted (x862-restrict-node-target cdest restricted))
     3895          (unless adest
     3896            (when (same-x86-reg-p cdest areg)
     3897              (setq areg creg)))
     3898          (unless bdest
     3899            (when (same-x86-reg-p cdest breg)
     3900              (setq breg creg)))
    38993901          (when (same-x86-reg-p cdest dreg)
    39003902            (setq dreg creg)))
     
    39023904    (setq ddest (x862-one-untargeted-reg-form seg dform dreg restricted)
    39033905          restricted (x862-restrict-node-target ddest restricted))
    3904     (when (same-x86-reg-p ddest areg)
    3905       (setq areg dreg)
    3906       (when apushed
    3907         (setq adest areg)))
    3908     (when (same-x86-reg-p ddest breg)
    3909       (setq breg dreg)
    3910       (when bpushed
    3911         (setq bdest breg)))
    3912     (when (same-x86-reg-p ddest creg)
    3913       (setq creg dreg)
    3914       (when cpushed
    3915         (setq cdest creg)))
    3916     (unless ctriv
     3906    (unless adest
     3907      (when (same-x86-reg-p ddest areg)
     3908        (setq areg dreg)))
     3909    (unless bdest
     3910      (when (same-x86-reg-p ddest breg)
     3911        (setq breg dreg)))
     3912    (unless cdest
     3913      (when (same-x86-reg-p ddest creg)
     3914        (setq creg dreg)))
     3915    (unless ctriv
    39173916      (if cconst
    39183917        (progn
    39193918          (setq cdest (x862-one-untargeted-reg-form seg cform creg restricted)
    39203919                restricted (x862-restrict-node-target cdest restricted))
    3921           (when (same-x86-reg-p cdest breg)
    3922             (setq breg creg)
    3923             (when bpushed
    3924               (setq bdest breg))))
    3925         (x862-elide-pushes seg cpushed (x862-pop-register seg creg))))
    3926     (unless btriv
     3920          (unless adest
     3921            (when (same-x86-reg-p cdest areg)
     3922              (setq areg creg)))
     3923          (unless bdest
     3924            (when (same-x86-reg-p cdest breg)
     3925              (setq breg creg))))
     3926        (x862-elide-pushes seg cpushed (x862-pop-register seg (setq cdest creg)))))
     3927    (unless btriv
    39273928      (if bconst
    39283929        (progn
    39293930          (setq bdest (x862-one-untargeted-reg-form seg bform breg restricted)
    39303931                restricted (x862-restrict-node-target bdest restricted))
    3931           (when (same-x86-reg-p bdest areg)
    3932             (setq areg bdest)
    3933             (when apushed
    3934               (setq adest areg))))
    3935         (x862-elide-pushes seg bpushed (x862-pop-register seg breg))))
     3932          (unless adest
     3933            (when (same-x86-reg-p bdest areg)
     3934              (setq areg breg))))
     3935        (x862-elide-pushes seg bpushed (x862-pop-register seg (setq bdest breg)))))
    39363936    (unless atriv
    39373937      (if aconst
    39383938        (setq adest (x862-one-untargeted-reg-form seg aform areg restricted))
    3939         (x862-elide-pushes seg apushed (x862-pop-register seg areg))))
     3939        (x862-elide-pushes seg apushed (x862-pop-register seg (setq adest areg)))))
    39403940    (values adest bdest cdest ddest)))
    39413941
  • trunk/source/compiler/vreg.lisp

    r15022 r15024  
    9696          (format s (if (lreg-wired l) "[~s]" "{~s}") value)
    9797          (when mode-name
    98             (format t "/~a" mode-name)))
     98            (format s "/~a" mode-name)))
    9999        (progn
    100100          (if mode-name
Note: See TracChangeset for help on using the changeset viewer.