;;; If there is any CHECK-xxx template for TYPE, then return it,
;;; otherwise return NIL.
;;; If there is any CHECK-xxx template for TYPE, then return it,
;;; otherwise return NIL.
(defun type-check-template (type)
(declare (type ctype type))
(multiple-value-bind (check-ptype exact) (primitive-type type)
(if exact
(primitive-type-check check-ptype)
(defun type-check-template (type)
(declare (type ctype type))
(multiple-value-bind (check-ptype exact) (primitive-type type)
(if exact
(primitive-type-check check-ptype)
(defun emit-type-check (node block value result type)
(declare (type tn value result) (type node node) (type ir2-block block)
(type ctype type))
(defun emit-type-check (node block value result type)
(declare (type tn value result) (type node node) (type ir2-block block)
(type ctype type))
- (multiple-value-bind (template type-needed) (type-check-template type)
- (if type-needed
- (emit-load-template node block template value result (list type))
- (emit-move-template node block template value result)))
+ (emit-move-template node block (type-check-template type) value result)