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