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