Update the |X86ISA|::|SMEP| field of a cr4bits bit structure.
Function:
(defun !cr4bits->smep$inline (smep x) (declare (xargs :guard (and (bitp smep) (cr4bits-p x)))) (mbe :logic (b* ((smep (mbe :logic (bfix smep) :exec smep)) (x (cr4bits-fix x))) (part-install smep x :width 1 :low 20)) :exec (the (unsigned-byte 26) (logior (the (unsigned-byte 26) (logand (the (unsigned-byte 26) x) (the (signed-byte 22) -1048577))) (the (unsigned-byte 21) (ash (the (unsigned-byte 1) smep) 20))))))
Theorem:
(defthm cr4bits-p-of-!cr4bits->smep (b* ((new-x (!cr4bits->smep$inline smep x))) (cr4bits-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !cr4bits->smep$inline-of-bfix-smep (equal (!cr4bits->smep$inline (bfix smep) x) (!cr4bits->smep$inline smep x)))
Theorem:
(defthm !cr4bits->smep$inline-bit-equiv-congruence-on-smep (implies (bit-equiv smep smep-equiv) (equal (!cr4bits->smep$inline smep x) (!cr4bits->smep$inline smep-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !cr4bits->smep$inline-of-cr4bits-fix-x (equal (!cr4bits->smep$inline smep (cr4bits-fix x)) (!cr4bits->smep$inline smep x)))
Theorem:
(defthm !cr4bits->smep$inline-cr4bits-equiv-congruence-on-x (implies (cr4bits-equiv x x-equiv) (equal (!cr4bits->smep$inline smep x) (!cr4bits->smep$inline smep x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !cr4bits->smep-is-cr4bits (equal (!cr4bits->smep smep x) (change-cr4bits x :smep smep)))
Theorem:
(defthm cr4bits->smep-of-!cr4bits->smep (b* ((?new-x (!cr4bits->smep$inline smep x))) (equal (cr4bits->smep new-x) (bfix smep))))
Theorem:
(defthm !cr4bits->smep-equiv-under-mask (b* ((?new-x (!cr4bits->smep$inline smep x))) (cr4bits-equiv-under-mask new-x x -1048577)))