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