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