0.pre7.99:
[sbcl.git] / src / compiler / meta-vmdef.lisp
index c21db65..4979d4b 100644 (file)
   (declare (type list locations reserve-locations alternate-scs constant-scs))
   (declare (type boolean save-p))
   (unless (= (logcount alignment) 1)
-    (error "alignment not a power of two: ~D" alignment))
+    (error "alignment not a power of two: ~W" alignment))
 
   (let ((sb (meta-sb-or-lose sb-name)))
     (if (eq (sb-kind sb) :finite)
          (dolist (el locations)
            (declare (type unsigned-byte el))
            (unless (<= 1 (+ el element-size) size)
-             (error "SC element ~D out of bounds for ~S" el sb))))
+             (error "SC element ~W out of bounds for ~S" el sb))))
        (when locations
          (error ":LOCATIONS is meaningless in a ~S SB." (sb-kind sb))))
 
 
        (let ((old (svref *backend-sc-numbers* ',number)))
         (when (and old (not (eq (sc-name old) ',name)))
-          (warn "redefining SC number ~D from ~S to ~S" ',number
+          (warn "redefining SC number ~W from ~S to ~S" ',number
                 (sc-name old) ',name)))
 
        (setf (svref *backend-sc-numbers* ',number)
 (defmacro !def-primitive-type (name scs &key (type name))
   (declare (type symbol name) (type list scs))
   (let ((scns (mapcar #'meta-sc-number-or-lose scs))
-       (get-type `(specifier-type ',type)))
+       (ctype-form `(specifier-type ',type)))
     `(progn
        (/show0 "doing !DEF-PRIMITIVE-TYPE, NAME=..")
        (/primitive-print ,(symbol-name name))
         (setf (gethash ',name *backend-meta-primitive-type-names*)
               (make-primitive-type :name ',name
                                    :scs ',scns
-                                   :type ,get-type)))
+                                   :type ,ctype-form)))
        ,(once-only ((n-old `(gethash ',name *backend-primitive-type-names*))
-                   (n-type get-type))
+                   (n-type ctype-form))
          `(progn
             ;; If the PRIMITIVE-TYPE structure already exists, we
             ;; destructively modify it so that existing references in
   ;; name of the operand (which we bind to the TN)
   (name nil :type symbol)
   ;; the way this operand is used:
-  (kind (required-argument)
+  (kind (missing-arg)
        :type (member :argument :result :temporary
                      :more-argument :more-result))
   ;; If true, the name of an operand that this operand is targeted to.
                            :key #'operand-parse-name))))))
   (values))
 \f
-;;; the top-level parse function: clobber PARSE to represent the
+;;; the top level parse function: clobber PARSE to represent the
 ;;; specified options.
 (defun parse-define-vop (parse specs)
   (declare (type vop-parse parse) (list specs))
                                        (eq (car x) :constant)))
                               types)
                 num)
-       (error "expected ~D ~:[result~;argument~] type~P: ~S"
+       (error "expected ~W ~:[result~;argument~] type~P: ~S"
               num load-p types num)))
 
     (when more-op
         (more-result (when more-results (car (last all-results))))
         (conditional (vop-parse-conditional-p parse)))
 
-    `(
-      :type (specifier-type '(function () nil))
+    `(:type (specifier-type '(function () nil))
       :arg-types (list ,@(mapcar #'make-operand-type args))
       :more-args-type ,(when more-args (make-operand-type more-arg))
       :result-types ,(if conditional
   (defparameter *slot-inherit-alist*
     '((:generator-function . vop-info-generator-function))))
 
-;;; Something to help with inheriting VOP-Info slots. We return a
-;;; keyword/value pair that can be passed to the constructor. SLOT is
-;;; the keyword name of the slot, Parse is a form that evaluates to
-;;; the VOP-Parse structure for the VOP inherited. If PARSE is NIL,
-;;; then we do nothing. If the TEST form evaluates to true, then we
-;;; return a form that selects the named slot from the VOP-Info
-;;; structure corresponding to PARSE. Otherwise, we return the FORM so
-;;; that the slot is recomputed.
+;;; This is something to help with inheriting VOP-Info slots. We
+;;; return a keyword/value pair that can be passed to the constructor.
+;;; SLOT is the keyword name of the slot, Parse is a form that
+;;; evaluates to the VOP-Parse structure for the VOP inherited. If
+;;; PARSE is NIL, then we do nothing. If the TEST form evaluates to
+;;; true, then we return a form that selects the named slot from the
+;;; VOP-Info structure corresponding to PARSE. Otherwise, we return
+;;; the FORM so that the slot is recomputed.
 (defmacro inherit-vop-info (slot parse test form)
   `(if (and ,parse ,test)
        (list ,slot `(,',(or (cdr (assoc slot *slot-inherit-alist*))
 
     (let ((nvars (length (vop-parse-variant-vars parse))))
       (unless (= (length variant) nvars)
-       (error "expected ~D variant values: ~S" nvars variant)))
+       (error "expected ~W variant values: ~S" nvars variant)))
 
     `(make-vop-info
       :name ',(vop-parse-name parse)
            (make-generator-function parse)))
       :variant (list ,@variant))))
 \f
-;;; Define the symbol NAME to be a Virtual OPeration in the compiler. If
-;;; specified, INHERITS is the name of a VOP that we default unspecified
-;;; information from. Each SPEC is a list beginning with a keyword indicating
-;;; the interpretation of the other forms in the SPEC:
+;;; Define the symbol NAME to be a Virtual OPeration in the compiler.
+;;; If specified, INHERITS is the name of a VOP that we default
+;;; unspecified information from. Each SPEC is a list beginning with a
+;;; keyword indicating the interpretation of the other forms in the
+;;; SPEC:
 ;;;
 ;;; :Args {(Name {Key Value}*)}*
 ;;; :Results {(Name {Key Value}*)}*
 ;;;
 ;;; :Note {String | NIL}
 ;;;     A short noun-like phrase describing what this VOP "does", i.e.
-;;;     the implementation strategy. If supplied, efficency notes will
+;;;     the implementation strategy. If supplied, efficiency notes will
 ;;;     be generated when type uncertainty prevents :TRANSLATE from
-;;;     working. NIL inhibits any efficency note.
+;;;     working. NIL inhibits any efficiency note.
 ;;;
 ;;; :Arg-Types    {* | PType | (:OR PType*) | (:CONSTANT Type)}*
 ;;; :Result-Types {* | PType | (:OR PType*)}*
     (when (or (vop-parse-more-args parse) (vop-parse-more-results parse))
       (error "cannot use VOP with variable operand count templates"))
     (unless (= noperands (length operands))
-      (error "called with ~D operands, but was expecting ~D"
+      (error "called with ~W operands, but was expecting ~W"
             (length operands) noperands))
 
     (multiple-value-bind (acode abinds n-args)
                (<= (length fixed-results) result-count))
       (error "too many fixed results"))
     (unless (= (length info) info-count)
-      (error "expected ~D info args" info-count))
+      (error "expected ~W info args" info-count))
 
     (multiple-value-bind (acode abinds n-args)
        (make-operand-list fixed-args (car (last args)) nil)
                   (when (and ,tn-var (not (eq ,tn-var :more)))
                     (,n-bod ,tn-var)))))))))))
 
-;;; Iterate over all the IR2 blocks in the environment Env, in emit order.
-(defmacro do-environment-ir2-blocks ((block-var env &optional result)
-                                    &body body)
-  (once-only ((n-env env))
-    (once-only ((n-first `(node-block
-                          (lambda-bind
-                           (environment-function ,n-env)))))
+;;; Iterate over all the IR2 blocks in PHYSENV, in emit order.
+(defmacro do-physenv-ir2-blocks ((block-var physenv &optional result)
+                                &body body)
+  (once-only ((n-physenv physenv))
+    (once-only ((n-first `(lambda-block (physenv-lambda ,n-physenv))))
       (once-only ((n-tail `(block-info
                            (component-tail
                             (block-component ,n-first)))))
        `(do ((,block-var (block-info ,n-first)
                          (ir2-block-next ,block-var)))
             ((or (eq ,block-var ,n-tail)
-                 (not (eq (ir2-block-environment ,block-var) ,n-env)))
+                 (not (eq (ir2-block-physenv ,block-var) ,n-physenv)))
              ,result)
           ,@body)))))