Care mask for an argument that matters fully, unless we don't care about any bits at all.
In various SVEX functions, such as
Similar things happen in, e.g., reduction operators, arithmetic operators (due to globally caring about whether there are any X/Z bits), etc., so this function ends up being widely used in the the functions that implement svex-argmasks.
Function:
(defun 4vmask-all-or-none$inline (outer-mask) (declare (xargs :guard (4vmask-p outer-mask))) (let ((__function__ '4vmask-all-or-none)) (declare (ignorable __function__)) (if (4vmask-empty outer-mask) 0 -1)))
Theorem:
(defthm 4vmask-p-of-4vmask-all-or-none (b* ((arg-mask (4vmask-all-or-none$inline outer-mask))) (4vmask-p arg-mask)) :rule-classes :rewrite)
Theorem:
(defthm 4vmask-all-or-none$inline-of-4vmask-fix-outer-mask (equal (4vmask-all-or-none$inline (4vmask-fix outer-mask)) (4vmask-all-or-none$inline outer-mask)))
Theorem:
(defthm 4vmask-all-or-none$inline-4vmask-equiv-congruence-on-outer-mask (implies (4vmask-equiv outer-mask outer-mask-equiv) (equal (4vmask-all-or-none$inline outer-mask) (4vmask-all-or-none$inline outer-mask-equiv))) :rule-classes :congruence)