Access the |X86ISA|::|R/M| field of a modr/m bit structure.
Function:
(defun modr/m->r/m$inline (x) (declare (xargs :guard (modr/m-p x))) (mbe :logic (let ((x (modr/m-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-modr/m->r/m (b* ((r/m (modr/m->r/m$inline x))) (3bits-p r/m)) :rule-classes :rewrite)
Theorem:
(defthm modr/m->r/m$inline-of-modr/m-fix-x (equal (modr/m->r/m$inline (modr/m-fix x)) (modr/m->r/m$inline x)))
Theorem:
(defthm modr/m->r/m$inline-modr/m-equiv-congruence-on-x (implies (modr/m-equiv x x-equiv) (equal (modr/m->r/m$inline x) (modr/m->r/m$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm modr/m->r/m-of-modr/m (equal (modr/m->r/m (modr/m r/m reg mod)) (3bits-fix r/m)))
Theorem:
(defthm modr/m->r/m-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x modr/m-equiv-under-mask) (modr/m-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 7) 0)) (equal (modr/m->r/m x) (modr/m->r/m y))))