Update the |X86ISA|::|BASE| field of a sib bit structure.
Function:
(defun !sib->base$inline (base x) (declare (xargs :guard (and (3bits-p base) (sib-p x)))) (mbe :logic (b* ((base (mbe :logic (3bits-fix base) :exec base)) (x (sib-fix x))) (part-install base x :width 3 :low 0)) :exec (the (unsigned-byte 8) (logior (the (unsigned-byte 8) (logand (the (unsigned-byte 8) x) (the (signed-byte 4) -8))) (the (unsigned-byte 3) base)))))
Theorem:
(defthm sib-p-of-!sib->base (b* ((new-x (!sib->base$inline base x))) (sib-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !sib->base$inline-of-3bits-fix-base (equal (!sib->base$inline (3bits-fix base) x) (!sib->base$inline base x)))
Theorem:
(defthm !sib->base$inline-3bits-equiv-congruence-on-base (implies (3bits-equiv base base-equiv) (equal (!sib->base$inline base x) (!sib->base$inline base-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !sib->base$inline-of-sib-fix-x (equal (!sib->base$inline base (sib-fix x)) (!sib->base$inline base x)))
Theorem:
(defthm !sib->base$inline-sib-equiv-congruence-on-x (implies (sib-equiv x x-equiv) (equal (!sib->base$inline base x) (!sib->base$inline base x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !sib->base-is-sib (equal (!sib->base base x) (change-sib x :base base)))
Theorem:
(defthm sib->base-of-!sib->base (b* ((?new-x (!sib->base$inline base x))) (equal (sib->base new-x) (3bits-fix base))))
Theorem:
(defthm !sib->base-equiv-under-mask (b* ((?new-x (!sib->base$inline base x))) (sib-equiv-under-mask new-x x -8)))