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