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