,@(unless (eq (reg-spec-kind reg) :res)
`(:target ,(reg-spec-temp reg)))))
-(defun emit-vop (name options vars)
+(defun emit-assemble-vop (name options vars)
(let* ((args (remove :arg vars :key #'reg-spec-kind :test #'neq))
(temps (remove :temp vars :key #'reg-spec-kind :test #'neq))
(results (remove :res vars :key #'reg-spec-kind :test #'neq))
(let ((regs (mapcar (lambda (var) (apply #'parse-reg-spec var)) vars)))
(if *emit-assembly-code-not-vops-p*
(emit-assemble name options regs code)
- (emit-vop name options regs)))))
+ (emit-assemble-vop name options regs)))))
(let ((end (ir2-block-last-vop 2block))
(move (template-or-lose 'move)))
(multiple-value-bind (first last)
- (funcall (template-emit-function move) node 2block
- move (reference-tn src nil)
- (reference-tn dst t))
+ (emit-vop node 2block move
+ (reference-tn src nil)
+ (reference-tn dst t))
(insert-vop-sequence first last 2block end))))))
(load-and-coerce arg-if value-if)
(load-and-coerce arg-else value-else))
(let ((target (find-operand (operand-parse-target op) parse
'(:temporary :result))))
;; KLUDGE: These formulas must be consistent with those in
- ;; %EMIT-GENERIC-VOP, and this is currently maintained by
+ ;; EMIT-VOP, and this is currently maintained by
;; hand. -- WHN 2002-01-30, paraphrasing APD
(targets (+ (* index max-vop-tn-refs)
(ecase (operand-parse-kind target)
:element-type '(specializable ,te-type)))))))))
(defun make-emit-function-and-friends (parse)
- `(:emit-function #'emit-generic-vop
- :temps ,(compute-temporaries-description parse)
+ `(:temps ,(compute-temporaries-description parse)
,@(compute-ref-ordering parse)))
\f
;;;; generator functions
(n-block block)
(n-template template))
`(multiple-value-bind (,first ,last)
- (funcall (template-emit-function ,n-template)
- ,n-node ,n-block ,n-template ,args ,results
- ,@(when info `(,info)))
+ (emit-vop ,n-node ,n-block ,n-template ,args ,results
+ ,@(when info `(,info)))
(insert-vop-sequence ,first ,last ,n-block nil)))))
;;; VOP Name Node Block Arg* Info* Result*
(let ((arg (reference-tn x nil))
(result (reference-tn y t)))
(multiple-value-bind (first last)
- (funcall (template-emit-function template) node block template arg
- result)
+ (emit-vop node block template arg result)
(insert-vop-sequence first last block before)
last)))
(let ((arg (reference-tn x nil))
(result (reference-tn y t)))
(multiple-value-bind (first last)
- (funcall (template-emit-function template) node block template arg
- result info)
+ (emit-vop node block template arg result info)
(insert-vop-sequence first last block before)
last)))
(y-ref (reference-tn y t)))
(setf (tn-ref-across x-ref) f-ref)
(multiple-value-bind (first last)
- (funcall (template-emit-function template) node block template x-ref
- y-ref)
+ (emit-vop node block template x-ref y-ref)
(insert-vop-sequence first last block before)
last)))
(type template template) (type tn y))
(let ((y-ref (reference-tn y t)))
(multiple-value-bind (first last)
- (funcall (template-emit-function template) node block template nil
- y-ref)
+ (emit-vop node block template nil y-ref)
(insert-vop-sequence first last block before)
last)))
;;;; generation of emit functions
(eval-when (:compile-toplevel :load-toplevel :execute)
- ;; We need the EVAL-WHEN because %EMIT-GENERIC-VOP (below)
+ ;; We need the EVAL-WHEN because EMIT-VOP (below)
;; uses #.MAX-VOP-TN-REFS, not just MAX-VOP-TN-REFS.
;; -- AL 20010218
;;
(def!constant sc-bits (integer-length (1- sc-number-limit)))
-(defun emit-generic-vop (node block template args results &optional info)
- (%emit-generic-vop node block template args results info))
-
-(defun %emit-generic-vop (node block template args results info)
+;; a function that emits the VOPs for this template. Arguments:
+;; 1] Node for source context.
+;; 2] IR2-BLOCK that we place the VOP in.
+;; 3] This structure.
+;; 4] Head of argument TN-REF list.
+;; 5] Head of result TN-REF list.
+;; 6] If INFO-ARG-COUNT is non-zero, then a list of the magic
+;; arguments.
+;;
+;; Two values are returned: the first and last VOP emitted. This vop
+;; sequence must be linked into the VOP Next/Prev chain for the
+;; block. At least one VOP is always emitted.
+(defun emit-vop (node block template args results &optional info)
(let* ((vop (make-vop block node template args results))
(num-args (vop-info-num-args template))
(last-arg (1- num-args))
;; the number of trailing arguments to VOP or %PRIMITIVE that we
;; bundle into a list and pass into the emit function. This provides
;; a way to pass uninterpreted stuff directly to the code generator.
- (info-arg-count 0 :type index)
- ;; a function that emits the VOPs for this template. Arguments:
- ;; 1] Node for source context.
- ;; 2] IR2-BLOCK that we place the VOP in.
- ;; 3] This structure.
- ;; 4] Head of argument TN-REF list.
- ;; 5] Head of result TN-REF list.
- ;; 6] If INFO-ARG-COUNT is non-zero, then a list of the magic
- ;; arguments.
- ;;
- ;; Two values are returned: the first and last VOP emitted. This vop
- ;; sequence must be linked into the VOP Next/Prev chain for the
- ;; block. At least one VOP is always emitted.
- (emit-function (missing-arg) :type function))
+ (info-arg-count 0 :type index))
(defprinter (template)
name
arg-types
;; counts as one, and all the more args/results together count as 1.
(num-args 0 :type index)
(num-results 0 :type index)
- ;; a vector of the temporaries the vop needs. See EMIT-GENERIC-VOP
+ ;; a vector of the temporaries the vop needs. See EMIT-VOP
;; in vmdef for information on how the temps are encoded.
(temps nil :type (or null (specializable-vector (unsigned-byte 16))))
;; the order all the refs for this vop should be put in. Each