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