Implements svex-argmasks for
(svmask-for-signx mask args) → argmasks
We are considering a
For
For
If we statically determine that
If we statically determine that
If we can't statically determine
BOZO for now we don't exploit this and simply say that we depend on all of
Function:
(defun svmask-for-signx (mask args) (declare (xargs :guard (and (4vmask-p mask) (svexlist-p args)))) (let ((__function__ 'svmask-for-signx)) (declare (ignorable __function__)) (b* (((svex-nths n x) args) (mask (4vmask-fix mask))) (b* (((when (sparseint-equal mask 0)) (list 0 0)) (nval (svex-s4xeval n)) ((unless (s4vec-2vec-p nval)) (list -1 (mask-for-generic-signx mask))) (nv (s4vec->upper nval)) ((when (sparseint-< nv 0)) (list -1 0)) (xmask (mask-for-fixed-signx mask (sparseint-val nv)))) (list -1 xmask)))))
Theorem:
(defthm 4vmasklist-p-of-svmask-for-signx (b* ((argmasks (svmask-for-signx mask args))) (4vmasklist-p argmasks)) :rule-classes :rewrite)
Theorem:
(defthm svmask-for-signx-of-4vmask-fix-mask (equal (svmask-for-signx (4vmask-fix mask) args) (svmask-for-signx mask args)))
Theorem:
(defthm svmask-for-signx-4vmask-equiv-congruence-on-mask (implies (4vmask-equiv mask mask-equiv) (equal (svmask-for-signx mask args) (svmask-for-signx mask-equiv args))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-signx-of-svexlist-fix-args (equal (svmask-for-signx mask (svexlist-fix args)) (svmask-for-signx mask args)))
Theorem:
(defthm svmask-for-signx-svexlist-equiv-congruence-on-args (implies (svexlist-equiv args args-equiv) (equal (svmask-for-signx mask args) (svmask-for-signx mask args-equiv))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-signx-correct (implies (and (equal (4veclist-mask (svmask-for-signx mask args) (svexlist-eval args env)) (4veclist-mask (svmask-for-signx mask args) args1)) (syntaxp (not (equal args1 (cons 'svexlist-eval (cons args (cons env 'nil))))))) (equal (4vec-mask mask (svex-apply 'signx args1)) (4vec-mask mask (svex-apply 'signx (svexlist-eval args env))))))