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