• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
        • Implemented-opcodes
        • To-do
        • Proof-utilities
        • Peripherals
        • Model-validation
        • Modelcalls
        • Concrete-simulation-examples
        • Utils
          • Structures
            • Rflagsbits
            • Cr4bits
            • Xcr0bits
            • Cr0bits
            • Prefixes
            • Ia32_eferbits
            • Evex-byte1
            • Cr3bits
            • Evex-byte3
            • Vex3-byte2
            • Vex3-byte1
            • Vex2-byte1
            • Evex-prefixes
            • Evex-byte2
            • Vex-prefixes
              • !vex-prefixes->byte1
              • !vex-prefixes->byte2
              • !vex-prefixes->byte0
              • Vex-prefixes-p
              • Vex-prefixes->byte2
              • Vex-prefixes->byte1
              • Vex-prefixes->byte0
              • Vex-prefixes-fix
            • Sib
            • Modr/m-structures
            • Vex-prefixes-layout-structures
            • Sib-structures
            • Legacy-prefixes-layout-structure
            • Evex-prefixes-layout-structures
            • Cr8bits
            • Opcode-maps-structures
            • Segmentation-bitstructs
            • 8bits
            • 2bits
            • 4bits
            • 16bits
            • Paging-bitstructs
            • 3bits
            • 11bits
            • 40bits
            • 5bits
            • 32bits
            • 19bits
            • 10bits
            • 7bits
            • 64bits
            • 54bits
            • 45bits
            • 36bits
            • 31bits
            • 24bits
            • 22bits
            • 17bits
            • 13bits
            • 12bits
            • 6bits
            • Vex->x
            • Vex->b
            • Vex-prefixes-map-p
            • Vex-prefixes-byte0-p
            • Vex->w
            • Vex->vvvv
            • Vex->r
            • Fp-bitstructs
            • Cr4bits-debug
            • Vex->pp
            • Vex->l
            • Rflagsbits-debug
            • Evex->v-prime
            • Evex->z
            • Evex->w
            • Evex->vvvv
            • Evex->vl/rc
            • Evex->pp
            • Evex->aaa
            • Xcr0bits-debug
            • Vex3-byte1-equiv-under-mask
            • Vex3-byte2-equiv-under-mask
            • Vex2-byte1-equiv-under-mask
            • Vex-prefixes-equiv-under-mask
            • Rflagsbits-equiv-under-mask
            • Ia32_eferbits-equiv-under-mask
            • Evex-prefixes-equiv-under-mask
            • Evex-byte3-equiv-under-mask
            • Evex-byte2-equiv-under-mask
            • Evex-byte1-equiv-under-mask
            • Cr0bits-debug
            • Xcr0bits-equiv-under-mask
            • Sib-equiv-under-mask
            • Prefixes-equiv-under-mask
            • Cr8bits-equiv-under-mask
            • Cr4bits-equiv-under-mask
            • Cr3bits-equiv-under-mask
            • Cr0bits-equiv-under-mask
            • Vex3-byte1-debug
            • Prefixes-debug
            • Ia32_eferbits-debug
            • Evex-byte1-debug
            • Vex3-byte2-debug
            • Vex2-byte1-debug
            • Vex-prefixes-debug
            • Evex-prefixes-debug
            • Evex-byte3-debug
            • Evex-byte2-debug
            • Cr3bits-debug
            • Sib-debug
            • Cr8bits-debug
          • Utilities
        • Debugging-code-proofs
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Structures

Vex-prefixes

An 24-bit unsigned bitstruct type.

This is a bitstruct type introduced by defbitstruct, represented as a unsigned 24-bit integer.

Fields
byte0 — 8bits
Can either be #xC4 or #xC5
byte1 — 8bits
Byte 1 of VEX prefixes
byte2 — 8bits
Relevant only for 3-byte VEX prefixes

Definitions and Theorems

Function: vex-prefixes-p$inline

(defun vex-prefixes-p$inline (x)
  (declare (xargs :guard t))
  (mbe :logic (unsigned-byte-p 24 x)
       :exec (and (natp x) (< x 16777216))))

Theorem: vex-prefixes-p-when-unsigned-byte-p

(defthm vex-prefixes-p-when-unsigned-byte-p
  (implies (unsigned-byte-p 24 x)
           (vex-prefixes-p x)))

Theorem: unsigned-byte-p-when-vex-prefixes-p

(defthm unsigned-byte-p-when-vex-prefixes-p
  (implies (vex-prefixes-p x)
           (unsigned-byte-p 24 x)))

Theorem: vex-prefixes-p-compound-recognizer

(defthm vex-prefixes-p-compound-recognizer
  (implies (vex-prefixes-p x) (natp x))
  :rule-classes :compound-recognizer)

Function: vex-prefixes-fix$inline

(defun vex-prefixes-fix$inline (x)
  (declare (xargs :guard (vex-prefixes-p x)))
  (mbe :logic (loghead 24 x) :exec x))

Theorem: vex-prefixes-p-of-vex-prefixes-fix

(defthm vex-prefixes-p-of-vex-prefixes-fix
  (b* ((fty::fixed (vex-prefixes-fix$inline x)))
    (vex-prefixes-p fty::fixed))
  :rule-classes :rewrite)

Theorem: vex-prefixes-fix-when-vex-prefixes-p

(defthm vex-prefixes-fix-when-vex-prefixes-p
  (implies (vex-prefixes-p x)
           (equal (vex-prefixes-fix x) x)))

Function: vex-prefixes-equiv$inline

(defun vex-prefixes-equiv$inline (x y)
  (declare (xargs :guard (and (vex-prefixes-p x)
                              (vex-prefixes-p y))))
  (equal (vex-prefixes-fix x)
         (vex-prefixes-fix y)))

Theorem: vex-prefixes-equiv-is-an-equivalence

(defthm vex-prefixes-equiv-is-an-equivalence
  (and (booleanp (vex-prefixes-equiv x y))
       (vex-prefixes-equiv x x)
       (implies (vex-prefixes-equiv x y)
                (vex-prefixes-equiv y x))
       (implies (and (vex-prefixes-equiv x y)
                     (vex-prefixes-equiv y z))
                (vex-prefixes-equiv x z)))
  :rule-classes (:equivalence))

Theorem: vex-prefixes-equiv-implies-equal-vex-prefixes-fix-1

(defthm vex-prefixes-equiv-implies-equal-vex-prefixes-fix-1
  (implies (vex-prefixes-equiv x x-equiv)
           (equal (vex-prefixes-fix x)
                  (vex-prefixes-fix x-equiv)))
  :rule-classes (:congruence))

Theorem: vex-prefixes-fix-under-vex-prefixes-equiv

(defthm vex-prefixes-fix-under-vex-prefixes-equiv
  (vex-prefixes-equiv (vex-prefixes-fix x)
                      x)
  :rule-classes (:rewrite :rewrite-quoted-constant))

Function: vex-prefixes$inline

(defun vex-prefixes$inline (byte0 byte1 byte2)
  (declare (xargs :guard (and (8bits-p byte0)
                              (8bits-p byte1)
                              (8bits-p byte2))))
  (b* ((byte0 (mbe :logic (8bits-fix byte0)
                   :exec byte0))
       (byte1 (mbe :logic (8bits-fix byte1)
                   :exec byte1))
       (byte2 (mbe :logic (8bits-fix byte2)
                   :exec byte2)))
    (logapp 8 byte0 (logapp 8 byte1 byte2))))

Theorem: vex-prefixes-p-of-vex-prefixes

(defthm vex-prefixes-p-of-vex-prefixes
  (b* ((vex-prefixes (vex-prefixes$inline byte0 byte1 byte2)))
    (vex-prefixes-p vex-prefixes))
  :rule-classes :rewrite)

Theorem: vex-prefixes$inline-of-8bits-fix-byte0

(defthm vex-prefixes$inline-of-8bits-fix-byte0
  (equal (vex-prefixes$inline (8bits-fix byte0)
                              byte1 byte2)
         (vex-prefixes$inline byte0 byte1 byte2)))

Theorem: vex-prefixes$inline-8bits-equiv-congruence-on-byte0

(defthm vex-prefixes$inline-8bits-equiv-congruence-on-byte0
  (implies (8bits-equiv byte0 byte0-equiv)
           (equal (vex-prefixes$inline byte0 byte1 byte2)
                  (vex-prefixes$inline byte0-equiv byte1 byte2)))
  :rule-classes :congruence)

Theorem: vex-prefixes$inline-of-8bits-fix-byte1

(defthm vex-prefixes$inline-of-8bits-fix-byte1
  (equal (vex-prefixes$inline byte0 (8bits-fix byte1)
                              byte2)
         (vex-prefixes$inline byte0 byte1 byte2)))

Theorem: vex-prefixes$inline-8bits-equiv-congruence-on-byte1

(defthm vex-prefixes$inline-8bits-equiv-congruence-on-byte1
  (implies (8bits-equiv byte1 byte1-equiv)
           (equal (vex-prefixes$inline byte0 byte1 byte2)
                  (vex-prefixes$inline byte0 byte1-equiv byte2)))
  :rule-classes :congruence)

Theorem: vex-prefixes$inline-of-8bits-fix-byte2

(defthm vex-prefixes$inline-of-8bits-fix-byte2
  (equal (vex-prefixes$inline byte0 byte1 (8bits-fix byte2))
         (vex-prefixes$inline byte0 byte1 byte2)))

Theorem: vex-prefixes$inline-8bits-equiv-congruence-on-byte2

(defthm vex-prefixes$inline-8bits-equiv-congruence-on-byte2
  (implies (8bits-equiv byte2 byte2-equiv)
           (equal (vex-prefixes$inline byte0 byte1 byte2)
                  (vex-prefixes$inline byte0 byte1 byte2-equiv)))
  :rule-classes :congruence)

Function: vex-prefixes-equiv-under-mask$inline

(defun vex-prefixes-equiv-under-mask$inline (x x1 mask)
  (declare (xargs :guard (and (vex-prefixes-p x)
                              (vex-prefixes-p x1)
                              (integerp mask))))
  (fty::int-equiv-under-mask (vex-prefixes-fix x)
                             (vex-prefixes-fix x1)
                             mask))

Function: vex-prefixes->byte0$inline

(defun vex-prefixes->byte0$inline (x)
  (declare (xargs :guard (vex-prefixes-p x)))
  (mbe :logic
       (let ((x (vex-prefixes-fix x)))
         (part-select x :low 0 :width 8))
       :exec (the (unsigned-byte 8)
                  (logand (the (unsigned-byte 8) 255)
                          (the (unsigned-byte 24) x)))))

Theorem: 8bits-p-of-vex-prefixes->byte0

(defthm 8bits-p-of-vex-prefixes->byte0
  (b* ((byte0 (vex-prefixes->byte0$inline x)))
    (8bits-p byte0))
  :rule-classes :rewrite)

Theorem: vex-prefixes->byte0$inline-of-vex-prefixes-fix-x

(defthm vex-prefixes->byte0$inline-of-vex-prefixes-fix-x
  (equal (vex-prefixes->byte0$inline (vex-prefixes-fix x))
         (vex-prefixes->byte0$inline x)))

Theorem: vex-prefixes->byte0$inline-vex-prefixes-equiv-congruence-on-x

(defthm
      vex-prefixes->byte0$inline-vex-prefixes-equiv-congruence-on-x
  (implies (vex-prefixes-equiv x x-equiv)
           (equal (vex-prefixes->byte0$inline x)
                  (vex-prefixes->byte0$inline x-equiv)))
  :rule-classes :congruence)

Theorem: vex-prefixes->byte0-of-vex-prefixes

(defthm vex-prefixes->byte0-of-vex-prefixes
  (equal (vex-prefixes->byte0 (vex-prefixes byte0 byte1 byte2))
         (8bits-fix byte0)))

Theorem: vex-prefixes->byte0-of-write-with-mask

(defthm vex-prefixes->byte0-of-write-with-mask
  (implies (and (fty::bitstruct-read-over-write-hyps
                     x vex-prefixes-equiv-under-mask)
                (vex-prefixes-equiv-under-mask x y fty::mask)
                (equal (logand (lognot fty::mask) 255)
                       0))
           (equal (vex-prefixes->byte0 x)
                  (vex-prefixes->byte0 y))))

Function: vex-prefixes->byte1$inline

(defun vex-prefixes->byte1$inline (x)
 (declare (xargs :guard (vex-prefixes-p x)))
 (mbe
    :logic
    (let ((x (vex-prefixes-fix x)))
      (part-select x :low 8 :width 8))
    :exec (the (unsigned-byte 8)
               (logand (the (unsigned-byte 8) 255)
                       (the (unsigned-byte 16)
                            (ash (the (unsigned-byte 24) x) -8))))))

Theorem: 8bits-p-of-vex-prefixes->byte1

(defthm 8bits-p-of-vex-prefixes->byte1
  (b* ((byte1 (vex-prefixes->byte1$inline x)))
    (8bits-p byte1))
  :rule-classes :rewrite)

Theorem: vex-prefixes->byte1$inline-of-vex-prefixes-fix-x

(defthm vex-prefixes->byte1$inline-of-vex-prefixes-fix-x
  (equal (vex-prefixes->byte1$inline (vex-prefixes-fix x))
         (vex-prefixes->byte1$inline x)))

Theorem: vex-prefixes->byte1$inline-vex-prefixes-equiv-congruence-on-x

(defthm
      vex-prefixes->byte1$inline-vex-prefixes-equiv-congruence-on-x
  (implies (vex-prefixes-equiv x x-equiv)
           (equal (vex-prefixes->byte1$inline x)
                  (vex-prefixes->byte1$inline x-equiv)))
  :rule-classes :congruence)

Theorem: vex-prefixes->byte1-of-vex-prefixes

(defthm vex-prefixes->byte1-of-vex-prefixes
  (equal (vex-prefixes->byte1 (vex-prefixes byte0 byte1 byte2))
         (8bits-fix byte1)))

Theorem: vex-prefixes->byte1-of-write-with-mask

(defthm vex-prefixes->byte1-of-write-with-mask
  (implies (and (fty::bitstruct-read-over-write-hyps
                     x vex-prefixes-equiv-under-mask)
                (vex-prefixes-equiv-under-mask x y fty::mask)
                (equal (logand (lognot fty::mask) 65280)
                       0))
           (equal (vex-prefixes->byte1 x)
                  (vex-prefixes->byte1 y))))

Function: vex-prefixes->byte2$inline

(defun vex-prefixes->byte2$inline (x)
  (declare (xargs :guard (vex-prefixes-p x)))
  (mbe :logic
       (let ((x (vex-prefixes-fix x)))
         (part-select x :low 16 :width 8))
       :exec (the (unsigned-byte 8)
                  (logand (the (unsigned-byte 8) 255)
                          (the (unsigned-byte 8)
                               (ash (the (unsigned-byte 24) x)
                                    -16))))))

Theorem: 8bits-p-of-vex-prefixes->byte2

(defthm 8bits-p-of-vex-prefixes->byte2
  (b* ((byte2 (vex-prefixes->byte2$inline x)))
    (8bits-p byte2))
  :rule-classes :rewrite)

Theorem: vex-prefixes->byte2$inline-of-vex-prefixes-fix-x

(defthm vex-prefixes->byte2$inline-of-vex-prefixes-fix-x
  (equal (vex-prefixes->byte2$inline (vex-prefixes-fix x))
         (vex-prefixes->byte2$inline x)))

Theorem: vex-prefixes->byte2$inline-vex-prefixes-equiv-congruence-on-x

(defthm
      vex-prefixes->byte2$inline-vex-prefixes-equiv-congruence-on-x
  (implies (vex-prefixes-equiv x x-equiv)
           (equal (vex-prefixes->byte2$inline x)
                  (vex-prefixes->byte2$inline x-equiv)))
  :rule-classes :congruence)

Theorem: vex-prefixes->byte2-of-vex-prefixes

(defthm vex-prefixes->byte2-of-vex-prefixes
  (equal (vex-prefixes->byte2 (vex-prefixes byte0 byte1 byte2))
         (8bits-fix byte2)))

Theorem: vex-prefixes->byte2-of-write-with-mask

(defthm vex-prefixes->byte2-of-write-with-mask
  (implies (and (fty::bitstruct-read-over-write-hyps
                     x vex-prefixes-equiv-under-mask)
                (vex-prefixes-equiv-under-mask x y fty::mask)
                (equal (logand (lognot fty::mask) 16711680)
                       0))
           (equal (vex-prefixes->byte2 x)
                  (vex-prefixes->byte2 y))))

Theorem: vex-prefixes-fix-in-terms-of-vex-prefixes

(defthm vex-prefixes-fix-in-terms-of-vex-prefixes
  (equal (vex-prefixes-fix x)
         (change-vex-prefixes x)))

Function: !vex-prefixes->byte0$inline

(defun !vex-prefixes->byte0$inline (byte0 x)
  (declare (xargs :guard (and (8bits-p byte0)
                              (vex-prefixes-p x))))
  (mbe :logic
       (b* ((byte0 (mbe :logic (8bits-fix byte0)
                        :exec byte0))
            (x (vex-prefixes-fix x)))
         (part-install byte0 x :width 8 :low 0))
       :exec (the (unsigned-byte 24)
                  (logior (the (unsigned-byte 24)
                               (logand (the (unsigned-byte 24) x)
                                       (the (signed-byte 9) -256)))
                          (the (unsigned-byte 8) byte0)))))

Theorem: vex-prefixes-p-of-!vex-prefixes->byte0

(defthm vex-prefixes-p-of-!vex-prefixes->byte0
  (b* ((new-x (!vex-prefixes->byte0$inline byte0 x)))
    (vex-prefixes-p new-x))
  :rule-classes :rewrite)

Theorem: !vex-prefixes->byte0$inline-of-8bits-fix-byte0

(defthm !vex-prefixes->byte0$inline-of-8bits-fix-byte0
  (equal (!vex-prefixes->byte0$inline (8bits-fix byte0)
                                      x)
         (!vex-prefixes->byte0$inline byte0 x)))

Theorem: !vex-prefixes->byte0$inline-8bits-equiv-congruence-on-byte0

(defthm !vex-prefixes->byte0$inline-8bits-equiv-congruence-on-byte0
  (implies (8bits-equiv byte0 byte0-equiv)
           (equal (!vex-prefixes->byte0$inline byte0 x)
                  (!vex-prefixes->byte0$inline byte0-equiv x)))
  :rule-classes :congruence)

Theorem: !vex-prefixes->byte0$inline-of-vex-prefixes-fix-x

(defthm !vex-prefixes->byte0$inline-of-vex-prefixes-fix-x
  (equal (!vex-prefixes->byte0$inline byte0 (vex-prefixes-fix x))
         (!vex-prefixes->byte0$inline byte0 x)))

Theorem: !vex-prefixes->byte0$inline-vex-prefixes-equiv-congruence-on-x

(defthm
     !vex-prefixes->byte0$inline-vex-prefixes-equiv-congruence-on-x
  (implies (vex-prefixes-equiv x x-equiv)
           (equal (!vex-prefixes->byte0$inline byte0 x)
                  (!vex-prefixes->byte0$inline byte0 x-equiv)))
  :rule-classes :congruence)

Theorem: !vex-prefixes->byte0-is-vex-prefixes

(defthm !vex-prefixes->byte0-is-vex-prefixes
  (equal (!vex-prefixes->byte0 byte0 x)
         (change-vex-prefixes x :byte0 byte0)))

Theorem: vex-prefixes->byte0-of-!vex-prefixes->byte0

(defthm vex-prefixes->byte0-of-!vex-prefixes->byte0
  (b* ((?new-x (!vex-prefixes->byte0$inline byte0 x)))
    (equal (vex-prefixes->byte0 new-x)
           (8bits-fix byte0))))

Theorem: !vex-prefixes->byte0-equiv-under-mask

(defthm !vex-prefixes->byte0-equiv-under-mask
  (b* ((?new-x (!vex-prefixes->byte0$inline byte0 x)))
    (vex-prefixes-equiv-under-mask new-x x -256)))

Function: !vex-prefixes->byte1$inline

(defun !vex-prefixes->byte1$inline (byte1 x)
 (declare (xargs :guard (and (8bits-p byte1)
                             (vex-prefixes-p x))))
 (mbe
     :logic
     (b* ((byte1 (mbe :logic (8bits-fix byte1)
                      :exec byte1))
          (x (vex-prefixes-fix x)))
       (part-install byte1 x :width 8 :low 8))
     :exec (the (unsigned-byte 24)
                (logior (the (unsigned-byte 24)
                             (logand (the (unsigned-byte 24) x)
                                     (the (signed-byte 17) -65281)))
                        (the (unsigned-byte 16)
                             (ash (the (unsigned-byte 8) byte1)
                                  8))))))

Theorem: vex-prefixes-p-of-!vex-prefixes->byte1

(defthm vex-prefixes-p-of-!vex-prefixes->byte1
  (b* ((new-x (!vex-prefixes->byte1$inline byte1 x)))
    (vex-prefixes-p new-x))
  :rule-classes :rewrite)

Theorem: !vex-prefixes->byte1$inline-of-8bits-fix-byte1

(defthm !vex-prefixes->byte1$inline-of-8bits-fix-byte1
  (equal (!vex-prefixes->byte1$inline (8bits-fix byte1)
                                      x)
         (!vex-prefixes->byte1$inline byte1 x)))

Theorem: !vex-prefixes->byte1$inline-8bits-equiv-congruence-on-byte1

(defthm !vex-prefixes->byte1$inline-8bits-equiv-congruence-on-byte1
  (implies (8bits-equiv byte1 byte1-equiv)
           (equal (!vex-prefixes->byte1$inline byte1 x)
                  (!vex-prefixes->byte1$inline byte1-equiv x)))
  :rule-classes :congruence)

Theorem: !vex-prefixes->byte1$inline-of-vex-prefixes-fix-x

(defthm !vex-prefixes->byte1$inline-of-vex-prefixes-fix-x
  (equal (!vex-prefixes->byte1$inline byte1 (vex-prefixes-fix x))
         (!vex-prefixes->byte1$inline byte1 x)))

Theorem: !vex-prefixes->byte1$inline-vex-prefixes-equiv-congruence-on-x

(defthm
     !vex-prefixes->byte1$inline-vex-prefixes-equiv-congruence-on-x
  (implies (vex-prefixes-equiv x x-equiv)
           (equal (!vex-prefixes->byte1$inline byte1 x)
                  (!vex-prefixes->byte1$inline byte1 x-equiv)))
  :rule-classes :congruence)

Theorem: !vex-prefixes->byte1-is-vex-prefixes

(defthm !vex-prefixes->byte1-is-vex-prefixes
  (equal (!vex-prefixes->byte1 byte1 x)
         (change-vex-prefixes x :byte1 byte1)))

Theorem: vex-prefixes->byte1-of-!vex-prefixes->byte1

(defthm vex-prefixes->byte1-of-!vex-prefixes->byte1
  (b* ((?new-x (!vex-prefixes->byte1$inline byte1 x)))
    (equal (vex-prefixes->byte1 new-x)
           (8bits-fix byte1))))

Theorem: !vex-prefixes->byte1-equiv-under-mask

(defthm !vex-prefixes->byte1-equiv-under-mask
  (b* ((?new-x (!vex-prefixes->byte1$inline byte1 x)))
    (vex-prefixes-equiv-under-mask new-x x -65281)))

Function: !vex-prefixes->byte2$inline

(defun !vex-prefixes->byte2$inline (byte2 x)
 (declare (xargs :guard (and (8bits-p byte2)
                             (vex-prefixes-p x))))
 (mbe
  :logic
  (b* ((byte2 (mbe :logic (8bits-fix byte2)
                   :exec byte2))
       (x (vex-prefixes-fix x)))
    (part-install byte2 x :width 8 :low 16))
  :exec (the (unsigned-byte 24)
             (logior (the (unsigned-byte 24)
                          (logand (the (unsigned-byte 24) x)
                                  (the (signed-byte 25) -16711681)))
                     (the (unsigned-byte 24)
                          (ash (the (unsigned-byte 8) byte2)
                               16))))))

Theorem: vex-prefixes-p-of-!vex-prefixes->byte2

(defthm vex-prefixes-p-of-!vex-prefixes->byte2
  (b* ((new-x (!vex-prefixes->byte2$inline byte2 x)))
    (vex-prefixes-p new-x))
  :rule-classes :rewrite)

Theorem: !vex-prefixes->byte2$inline-of-8bits-fix-byte2

(defthm !vex-prefixes->byte2$inline-of-8bits-fix-byte2
  (equal (!vex-prefixes->byte2$inline (8bits-fix byte2)
                                      x)
         (!vex-prefixes->byte2$inline byte2 x)))

Theorem: !vex-prefixes->byte2$inline-8bits-equiv-congruence-on-byte2

(defthm !vex-prefixes->byte2$inline-8bits-equiv-congruence-on-byte2
  (implies (8bits-equiv byte2 byte2-equiv)
           (equal (!vex-prefixes->byte2$inline byte2 x)
                  (!vex-prefixes->byte2$inline byte2-equiv x)))
  :rule-classes :congruence)

Theorem: !vex-prefixes->byte2$inline-of-vex-prefixes-fix-x

(defthm !vex-prefixes->byte2$inline-of-vex-prefixes-fix-x
  (equal (!vex-prefixes->byte2$inline byte2 (vex-prefixes-fix x))
         (!vex-prefixes->byte2$inline byte2 x)))

Theorem: !vex-prefixes->byte2$inline-vex-prefixes-equiv-congruence-on-x

(defthm
     !vex-prefixes->byte2$inline-vex-prefixes-equiv-congruence-on-x
  (implies (vex-prefixes-equiv x x-equiv)
           (equal (!vex-prefixes->byte2$inline byte2 x)
                  (!vex-prefixes->byte2$inline byte2 x-equiv)))
  :rule-classes :congruence)

Theorem: !vex-prefixes->byte2-is-vex-prefixes

(defthm !vex-prefixes->byte2-is-vex-prefixes
  (equal (!vex-prefixes->byte2 byte2 x)
         (change-vex-prefixes x :byte2 byte2)))

Theorem: vex-prefixes->byte2-of-!vex-prefixes->byte2

(defthm vex-prefixes->byte2-of-!vex-prefixes->byte2
  (b* ((?new-x (!vex-prefixes->byte2$inline byte2 x)))
    (equal (vex-prefixes->byte2 new-x)
           (8bits-fix byte2))))

Theorem: !vex-prefixes->byte2-equiv-under-mask

(defthm !vex-prefixes->byte2-equiv-under-mask
  (b* ((?new-x (!vex-prefixes->byte2$inline byte2 x)))
    (vex-prefixes-equiv-under-mask new-x x 65535)))

Function: vex-prefixes-debug$inline

(defun vex-prefixes-debug$inline (x)
  (declare (xargs :guard (vex-prefixes-p x)))
  (b* (((vex-prefixes x)))
    (cons (cons 'byte0 x.byte0)
          (cons (cons 'byte1 x.byte1)
                (cons (cons 'byte2 x.byte2) nil)))))

Subtopics

!vex-prefixes->byte1
Update the |X86ISA|::|BYTE1| field of a vex-prefixes bit structure.
!vex-prefixes->byte2
Update the |X86ISA|::|BYTE2| field of a vex-prefixes bit structure.
!vex-prefixes->byte0
Update the |X86ISA|::|BYTE0| field of a vex-prefixes bit structure.
Vex-prefixes-p
Recognizer for vex-prefixes bit structures.
Vex-prefixes->byte2
Access the |X86ISA|::|BYTE2| field of a vex-prefixes bit structure.
Vex-prefixes->byte1
Access the |X86ISA|::|BYTE1| field of a vex-prefixes bit structure.
Vex-prefixes->byte0
Access the |X86ISA|::|BYTE0| field of a vex-prefixes bit structure.
Vex-prefixes-fix
Fixing function for vex-prefixes bit structures.