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