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