Access the |X86ISA|::|BASE| field of a sib bit structure.
Function:
(defun sib->base$inline (x) (declare (xargs :guard (sib-p x))) (mbe :logic (let ((x (sib-fix x))) (part-select x :low 0 :width 3)) :exec (the (unsigned-byte 3) (logand (the (unsigned-byte 3) 7) (the (unsigned-byte 8) x)))))
Theorem:
(defthm 3bits-p-of-sib->base (b* ((base (sib->base$inline x))) (3bits-p base)) :rule-classes :rewrite)
Theorem:
(defthm sib->base$inline-of-sib-fix-x (equal (sib->base$inline (sib-fix x)) (sib->base$inline x)))
Theorem:
(defthm sib->base$inline-sib-equiv-congruence-on-x (implies (sib-equiv x x-equiv) (equal (sib->base$inline x) (sib->base$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm sib->base-of-sib (equal (sib->base (sib base index scale)) (3bits-fix base)))
Theorem:
(defthm sib->base-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x sib-equiv-under-mask) (sib-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 7) 0)) (equal (sib->base x) (sib->base y))))