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