Commit e72b4d1e authored by ram's avatar ram
Browse files

Added new :TN arg to OPERAND-RESTRICTION-OK so that we can use it

at IR2 time.
parent 28f77b96
...@@ -518,18 +518,20 @@ ...@@ -518,18 +518,20 @@
;;;; Known call annotation: ;;;; Known call annotation:
;;; OPERAND-RESTRICTION-OK -- Internal ;;; OPERAND-RESTRICTION-OK -- Interface
;;; ;;;
;;; Return true if Restr is satisfied by Type. Cont is continuation used to ;;; Return true if Restr is satisfied by Type. If T-OK is true, then a T
;;; test for constant arguments. If T-OK is true, then a T restriction allows ;;; restriction allows any operand type. This is also called by IR2tran when
;;; any operand type. This is also called by IR2tran when it determines ;;; it determines whether a result temporary needs to be made, and by
;;; whether a result temporary needs to be made. ;;; representation selection when it is deciding which move VOP to use.
;;; Cont and TN are used to test for constant arguments.
;;; ;;;
(proclaim '(inline operand-restriction-ok)) (proclaim '(inline operand-restriction-ok))
(defun operand-restriction-ok (restr type &key cont (t-ok t)) (defun operand-restriction-ok (restr type &key cont tn (t-ok t))
(declare (type (or (member *) cons) restr) (declare (type (or (member *) cons) restr)
(type primitive-type type) (type primitive-type type)
(type (or continuation null) cont)) (type (or continuation null) cont)
(type (or tn null) tn))
(if (eq restr '*) (if (eq restr '*)
t t
(ecase (first restr) (ecase (first restr)
...@@ -539,8 +541,14 @@ ...@@ -539,8 +541,14 @@
(eq mem type)) (eq mem type))
(return t)))) (return t))))
(:constant (:constant
(and (constant-continuation-p cont) (cond (cont
(funcall (second restr) (continuation-value cont))))))) (and (constant-continuation-p cont)
(funcall (second restr) (continuation-value cont))))
(tn
(and (eq (tn-kind tn) :constant)
(funcall (second restr) (tn-value tn))))
(t
(error "Neither CONT nor TN supplied.")))))))
;;; Template-Args-OK -- Internal ;;; Template-Args-OK -- Internal
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment