Implements svex-argmasks for
(svmask-for-bitor mask args) → argmasks
See svmask-for-bitand. This is similar, except that since
we are dealing with
Function:
(defun svmask-for-bitor (mask args) (declare (xargs :guard (and (4vmask-p mask) (svexlist-p args)))) (let ((__function__ 'svmask-for-bitor)) (declare (ignorable __function__)) (b* (((svex-nths x y) args) (mask (4vmask-fix mask))) (b* (((s4vec xval) (svex-s4xeval x)) ((s4vec yval) (svex-s4xeval y)) (x-1 (sparseint-bitand xval.upper xval.lower)) (y-1 (sparseint-bitand yval.upper yval.lower)) (shared-1s (sparseint-bitand x-1 (sparseint-bitand y-1 mask))) (xm-non1 (sparseint-bitandc2 mask x-1)) (ym-non1 (sparseint-bitandc2 mask y-1)) ((when (sparseint-equal 0 shared-1s)) (list ym-non1 xm-non1)) (y-x (sparseint-bitandc2 yval.upper yval.lower)) (ym-x (sparseint-test-bitand mask y-x)) ((unless ym-x) (list ym-non1 (sparseint-bitor xm-non1 shared-1s)))) (list (sparseint-bitor ym-non1 shared-1s) xm-non1)))))
Theorem:
(defthm 4vmasklist-p-of-svmask-for-bitor (b* ((argmasks (svmask-for-bitor mask args))) (4vmasklist-p argmasks)) :rule-classes :rewrite)
Theorem:
(defthm svmask-for-bitor-of-4vmask-fix-mask (equal (svmask-for-bitor (4vmask-fix mask) args) (svmask-for-bitor mask args)))
Theorem:
(defthm svmask-for-bitor-4vmask-equiv-congruence-on-mask (implies (4vmask-equiv mask mask-equiv) (equal (svmask-for-bitor mask args) (svmask-for-bitor mask-equiv args))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-bitor-of-svexlist-fix-args (equal (svmask-for-bitor mask (svexlist-fix args)) (svmask-for-bitor mask args)))
Theorem:
(defthm svmask-for-bitor-svexlist-equiv-congruence-on-args (implies (svexlist-equiv args args-equiv) (equal (svmask-for-bitor mask args) (svmask-for-bitor mask args-equiv))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-bitor-correct (implies (and (equal (4veclist-mask (svmask-for-bitor mask args) (svexlist-eval args env)) (4veclist-mask (svmask-for-bitor mask args) args1)) (syntaxp (not (equal args1 (cons 'svexlist-eval (cons args (cons env 'nil))))))) (equal (4vec-mask mask (svex-apply 'bitor args1)) (4vec-mask mask (svex-apply 'bitor (svexlist-eval args env))))))