Access the |X86ISA|::|WP| field of a cr0bits bit structure.
Function:
(defun cr0bits->wp$inline (x) (declare (xargs :guard (cr0bits-p x))) (mbe :logic (let ((x (cr0bits-fix x))) (part-select x :low 16 :width 1)) :exec (the (unsigned-byte 1) (logand (the (unsigned-byte 1) 1) (the (unsigned-byte 16) (ash (the (unsigned-byte 32) x) -16))))))
Theorem:
(defthm bitp-of-cr0bits->wp (b* ((wp (cr0bits->wp$inline x))) (bitp wp)) :rule-classes :rewrite)
Theorem:
(defthm cr0bits->wp$inline-of-cr0bits-fix-x (equal (cr0bits->wp$inline (cr0bits-fix x)) (cr0bits->wp$inline x)))
Theorem:
(defthm cr0bits->wp$inline-cr0bits-equiv-congruence-on-x (implies (cr0bits-equiv x x-equiv) (equal (cr0bits->wp$inline x) (cr0bits->wp$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cr0bits->wp-of-cr0bits (equal (cr0bits->wp (cr0bits pe mp em ts et ne res1 wp res2 am res3 nw cd pg)) (bfix wp)))
Theorem:
(defthm cr0bits->wp-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x cr0bits-equiv-under-mask) (cr0bits-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 65536) 0)) (equal (cr0bits->wp x) (cr0bits->wp y))))