Update the |X86ISA|::|IOPL| field of a rflagsbits bit structure.
(!rflagsbits->iopl iopl x) → new-x
Function:
(defun !rflagsbits->iopl$inline (iopl x) (declare (xargs :guard (and (2bits-p iopl) (rflagsbits-p x)))) (mbe :logic (b* ((iopl (mbe :logic (2bits-fix iopl) :exec iopl)) (x (rflagsbits-fix x))) (part-install iopl x :width 2 :low 12)) :exec (the (unsigned-byte 32) (logior (the (unsigned-byte 32) (logand (the (unsigned-byte 32) x) (the (signed-byte 15) -12289))) (the (unsigned-byte 14) (ash (the (unsigned-byte 2) iopl) 12))))))
Theorem:
(defthm rflagsbits-p-of-!rflagsbits->iopl (b* ((new-x (!rflagsbits->iopl$inline iopl x))) (rflagsbits-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !rflagsbits->iopl$inline-of-2bits-fix-iopl (equal (!rflagsbits->iopl$inline (2bits-fix iopl) x) (!rflagsbits->iopl$inline iopl x)))
Theorem:
(defthm !rflagsbits->iopl$inline-2bits-equiv-congruence-on-iopl (implies (2bits-equiv iopl iopl-equiv) (equal (!rflagsbits->iopl$inline iopl x) (!rflagsbits->iopl$inline iopl-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !rflagsbits->iopl$inline-of-rflagsbits-fix-x (equal (!rflagsbits->iopl$inline iopl (rflagsbits-fix x)) (!rflagsbits->iopl$inline iopl x)))
Theorem:
(defthm !rflagsbits->iopl$inline-rflagsbits-equiv-congruence-on-x (implies (rflagsbits-equiv x x-equiv) (equal (!rflagsbits->iopl$inline iopl x) (!rflagsbits->iopl$inline iopl x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !rflagsbits->iopl-is-rflagsbits (equal (!rflagsbits->iopl iopl x) (change-rflagsbits x :iopl iopl)))
Theorem:
(defthm rflagsbits->iopl-of-!rflagsbits->iopl (b* ((?new-x (!rflagsbits->iopl$inline iopl x))) (equal (rflagsbits->iopl new-x) (2bits-fix iopl))))
Theorem:
(defthm !rflagsbits->iopl-equiv-under-mask (b* ((?new-x (!rflagsbits->iopl$inline iopl x))) (rflagsbits-equiv-under-mask new-x x -12289)))