X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fmeta-vmdef.lisp;h=346a62ce1522a4339c65f6753f96e32473fb2076;hb=f12b298a4ce9090470000360b49523e56475a680;hp=5515de7fa8eea84fd1e42e7539d441c784ef4727;hpb=609612f7a0817cdb0d3ec59d5aebb0894606b3f6;p=sbcl.git diff --git a/src/compiler/meta-vmdef.lisp b/src/compiler/meta-vmdef.lisp index 5515de7..346a62c 100644 --- a/src/compiler/meta-vmdef.lisp +++ b/src/compiler/meta-vmdef.lisp @@ -389,7 +389,9 @@ (operands nil :type list) ;; names of variables that should be declared IGNORE (ignores () :type list) - ;; true if this is a :CONDITIONAL VOP + ;; true if this is a :CONDITIONAL VOP. T if a branchful VOP, + ;; a list of condition descriptor otherwise. See $ARCH/pred.lisp + ;; for more information. (conditional-p nil) ;; argument and result primitive types. These are pulled out of the ;; operands, since we often want to change them without respecifying @@ -1083,7 +1085,7 @@ (setf (vop-parse-result-types parse) ()) (setf (vop-parse-results parse) ()) (setf (vop-parse-more-results parse) nil) - (setf (vop-parse-conditional-p parse) t)) + (setf (vop-parse-conditional-p parse) (or (rest spec) t))) (:temporary (parse-temporary spec parse)) (:generator @@ -1460,9 +1462,12 @@ `(: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 - :conditional - `(list ,@(mapcar #'make-operand-type results))) + :result-types ,(cond ((eq conditional t) + :conditional) + (conditional + `'(:conditional . ,conditional)) + (t + `(list ,@(mapcar #'make-operand-type results)))) :more-results-type ,(when more-results (make-operand-type more-result))))) @@ -1572,7 +1577,7 @@ ;;; (:ARGUMENT N)/(:RESULT N). These options are necessary ;;; primarily when operands are read or written out of order. ;;; -;;; :CONDITIONAL +;;; :CONDITIONAL [Condition-descriptor+] ;;; This is used in place of :RESULTS with conditional branch VOPs. ;;; There are no result values: the result is a transfer of control. ;;; The target label is passed as the first :INFO arg. The second @@ -1580,6 +1585,10 @@ ;;; A side effect is to set the PREDICATE attribute for functions ;;; in the :TRANSLATE option. ;;; +;;; If some condition descriptors are provided, this is a flag-setting +;;; VOP. Descriptors are interpreted in an architecture-dependent +;;; manner. See the BRANCH-IF VOP in $ARCH/pred.lisp. +;;; ;;; :TEMPORARY ({Key Value}*) Name* ;;; Allocate a temporary TN for each Name, binding that variable to ;;; the TN within the body of the generators. In addition to :TARGET @@ -1590,7 +1599,7 @@ ;;; :OFFSET SB-Offset ;;; Force the temporary to be allocated in the specified SC ;;; with the specified offset. Offset is evaluated at -;;; macroexpand time. If Offset is emitted, the register +;;; macroexpand time. If Offset is omitted, the register ;;; allocator chooses a free location in SC. If both SC and ;;; Offset are omitted, then the temporary is packed according ;;; to its primitive type. @@ -1600,7 +1609,7 @@ ;;; Similar to the argument/result option, this specifies the ;;; start and end of the temporaries' lives. The defaults are ;;; :LOAD and :SAVE, i.e. the duration of the VOP. The other -;;; intervening phases are :ARGUMENT,:EVAL and :RESULT. +;;; intervening phases are :ARGUMENT, :EVAL and :RESULT. ;;; Non-zero sub-phases can be specified by a list, e.g. by ;;; default the second argument's life ends at (:ARGUMENT 1). ;;; @@ -1682,7 +1691,7 @@ ;;; :MOVE-ARGS {NIL | :FULL-CALL | :LOCAL-CALL | :KNOWN-RETURN} ;;; Indicates if and how the more args should be moved into a ;;; different frame. -(def!macro define-vop ((name &optional inherits) &rest specs) +(def!macro define-vop ((name &optional inherits) &body specs) (declare (type symbol name)) ;; Parse the syntax into a VOP-PARSE structure, and then expand into ;; code that creates the appropriate VOP-INFO structure at load time. @@ -1879,7 +1888,7 @@ ;;; beginning with T specifies a default. If it appears, it must be ;;; last. If no default is specified, and no clause matches, then an ;;; error is signalled. -(def!macro sc-case (tn &rest forms) +(def!macro sc-case (tn &body forms) (let ((n-sc (gensym)) (n-tn (gensym))) (collect ((clauses))