Update the |X86ISA|::|SEG| field of a prefixes bit structure.
(!prefixes->seg seg x) → new-x
Function:
(defun !prefixes->seg$inline (seg x) (declare (xargs :guard (and (8bits-p seg) (prefixes-p x)))) (mbe :logic (b* ((seg (mbe :logic (8bits-fix seg) :exec seg)) (x (prefixes-fix x))) (part-install seg x :width 8 :low 20)) :exec (the (unsigned-byte 52) (logior (the (unsigned-byte 52) (logand (the (unsigned-byte 52) x) (the (signed-byte 29) -267386881))) (the (unsigned-byte 28) (ash (the (unsigned-byte 8) seg) 20))))))
Theorem:
(defthm prefixes-p-of-!prefixes->seg (b* ((new-x (!prefixes->seg$inline seg x))) (prefixes-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !prefixes->seg$inline-of-8bits-fix-seg (equal (!prefixes->seg$inline (8bits-fix seg) x) (!prefixes->seg$inline seg x)))
Theorem:
(defthm !prefixes->seg$inline-8bits-equiv-congruence-on-seg (implies (8bits-equiv seg seg-equiv) (equal (!prefixes->seg$inline seg x) (!prefixes->seg$inline seg-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !prefixes->seg$inline-of-prefixes-fix-x (equal (!prefixes->seg$inline seg (prefixes-fix x)) (!prefixes->seg$inline seg x)))
Theorem:
(defthm !prefixes->seg$inline-prefixes-equiv-congruence-on-x (implies (prefixes-equiv x x-equiv) (equal (!prefixes->seg$inline seg x) (!prefixes->seg$inline seg x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !prefixes->seg-is-prefixes (equal (!prefixes->seg seg x) (change-prefixes x :seg seg)))
Theorem:
(defthm prefixes->seg-of-!prefixes->seg (b* ((?new-x (!prefixes->seg$inline seg x))) (equal (prefixes->seg new-x) (8bits-fix seg))))
Theorem:
(defthm !prefixes->seg-equiv-under-mask (b* ((?new-x (!prefixes->seg$inline seg x))) (prefixes-equiv-under-mask new-x x -267386881)))