Determine the "original size" of the test expression for a
(vl-qmark-test-size x) → *
This is an ugly hack. (vl-qmark-test-size x) is given an
exprsesion
test ? then : else
Also,
Since oprewrite is applied before sizing,
We want to return the width of
To support this, oprewrite is set up so that it annotates the
Function:
(defun vl-qmark-test-size (x) (declare (xargs :guard (vl-expr-p x))) (let ((__function__ 'vl-qmark-test-size)) (declare (ignorable __function__)) (b* (((when (vl-fast-atom-p x)) (vl-expr->finalwidth x)) (op (vl-nonatom->op x)) (args (vl-nonatom->args x)) ((unless (and (or (eq op :vl-unary-bitnot) (eq op :vl-unary-bitor)) (assoc-equal "VL_CONDITIONAL_FIX" (vl-nonatom->atts x)))) (vl-expr->finalwidth x)) (arg1 (first args)) ((when (eq op :vl-unary-bitor)) (vl-expr->finalwidth arg1)) ((unless (and (not (vl-fast-atom-p arg1)) (eq (vl-nonatom->op arg1) :vl-unary-bitor) (assoc-equal "VL_CONDITIONAL_FIX" (vl-nonatom->atts arg1)))) (raise "Malformed oprewrite conditional fix? ~x0.~%" x))) (vl-expr->finalwidth (first (vl-nonatom->args arg1))))))