Access the |X86ISA|::|CPL| field of a tlb-key bit structure.
Function:
(defun tlb-key->cpl$inline (x) (declare (xargs :guard (tlb-key-p x))) (mbe :logic (let ((x (tlb-key-fix x))) (part-select x :low 8 :width 2)) :exec (the (unsigned-byte 2) (logand (the (unsigned-byte 2) 3) (the (unsigned-byte 38) (ash (the (unsigned-byte 46) x) -8))))))
Theorem:
(defthm 2bits-p-of-tlb-key->cpl (b* ((cpl (tlb-key->cpl$inline x))) (2bits-p cpl)) :rule-classes :rewrite)
Theorem:
(defthm tlb-key->cpl$inline-of-tlb-key-fix-x (equal (tlb-key->cpl$inline (tlb-key-fix x)) (tlb-key->cpl$inline 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 x) (tlb-key->cpl$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm tlb-key->cpl-of-tlb-key (equal (tlb-key->cpl (tlb-key wp smep smap ac nxe implicit-supervisor-access r-w-x cpl vpn)) (2bits-fix cpl)))
Theorem:
(defthm tlb-key->cpl-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x tlb-key-equiv-under-mask) (tlb-key-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 768) 0)) (equal (tlb-key->cpl x) (tlb-key->cpl y))))