Access the |X86ISA|::|SCALE| field of a sib bit structure.
Function:
(defun sib->scale$inline (x) (declare (xargs :guard (sib-p x))) (mbe :logic (let ((x (sib-fix x))) (part-select x :low 6 :width 2)) :exec (the (unsigned-byte 2) (logand (the (unsigned-byte 2) 3) (the (unsigned-byte 2) (ash (the (unsigned-byte 8) x) -6))))))
Theorem:
(defthm 2bits-p-of-sib->scale (b* ((scale (sib->scale$inline x))) (2bits-p scale)) :rule-classes :rewrite)
Theorem:
(defthm sib->scale$inline-of-sib-fix-x (equal (sib->scale$inline (sib-fix x)) (sib->scale$inline x)))
Theorem:
(defthm sib->scale$inline-sib-equiv-congruence-on-x (implies (sib-equiv x x-equiv) (equal (sib->scale$inline x) (sib->scale$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm sib->scale-of-sib (equal (sib->scale (sib base index scale)) (2bits-fix scale)))
Theorem:
(defthm sib->scale-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) 192) 0)) (equal (sib->scale x) (sib->scale y))))