• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • 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
              • !evex-byte2->vvvv
              • !evex-byte2->res
              • !evex-byte2->w
              • !evex-byte2->pp
              • Evex-byte2-p
              • Evex-byte2->vvvv
              • Evex-byte2-fix
              • Evex-byte2->w
              • Evex-byte2->res
              • Evex-byte2->pp
            • Vex-prefixes
            • 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
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Structures

Evex-byte2

An 8-bit unsigned bitstruct type.

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

Fields
pp — 2bits
Compressed legacy escape -- identical to low two bits of VEX.pp.
res — bit
Reserved; Must be one.
vvvv — 4bits
NDS register specifier --- same as VEX.vvvv.
w — bit
Operand size promotion / opcode extension.

Definitions and Theorems

Function: evex-byte2-p$inline

(defun evex-byte2-p$inline (x)
  (declare (xargs :guard t))
  (mbe :logic (unsigned-byte-p 8 x)
       :exec (and (natp x) (< x 256))))

Theorem: evex-byte2-p-when-unsigned-byte-p

(defthm evex-byte2-p-when-unsigned-byte-p
  (implies (unsigned-byte-p 8 x)
           (evex-byte2-p x)))

Theorem: unsigned-byte-p-when-evex-byte2-p

(defthm unsigned-byte-p-when-evex-byte2-p
  (implies (evex-byte2-p x)
           (unsigned-byte-p 8 x)))

Theorem: evex-byte2-p-compound-recognizer

(defthm evex-byte2-p-compound-recognizer
  (implies (evex-byte2-p x) (natp x))
  :rule-classes :compound-recognizer)

Function: evex-byte2-fix$inline

(defun evex-byte2-fix$inline (x)
  (declare (xargs :guard (evex-byte2-p x)))
  (mbe :logic (loghead 8 x) :exec x))

Theorem: evex-byte2-p-of-evex-byte2-fix

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

Theorem: evex-byte2-fix-when-evex-byte2-p

(defthm evex-byte2-fix-when-evex-byte2-p
  (implies (evex-byte2-p x)
           (equal (evex-byte2-fix x) x)))

Function: evex-byte2-equiv$inline

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

Theorem: evex-byte2-equiv-is-an-equivalence

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

Theorem: evex-byte2-equiv-implies-equal-evex-byte2-fix-1

(defthm evex-byte2-equiv-implies-equal-evex-byte2-fix-1
  (implies (evex-byte2-equiv x x-equiv)
           (equal (evex-byte2-fix x)
                  (evex-byte2-fix x-equiv)))
  :rule-classes (:congruence))

Theorem: evex-byte2-fix-under-evex-byte2-equiv

(defthm evex-byte2-fix-under-evex-byte2-equiv
  (evex-byte2-equiv (evex-byte2-fix x) x)
  :rule-classes (:rewrite :rewrite-quoted-constant))

Function: evex-byte2$inline

(defun evex-byte2$inline (pp res vvvv w)
  (declare (xargs :guard (and (2bits-p pp)
                              (bitp res)
                              (4bits-p vvvv)
                              (bitp w))))
  (b* ((pp (mbe :logic (2bits-fix pp) :exec pp))
       (res (mbe :logic (bfix res) :exec res))
       (vvvv (mbe :logic (4bits-fix vvvv)
                  :exec vvvv))
       (w (mbe :logic (bfix w) :exec w)))
    (logapp 2 pp (logapp 1 res (logapp 4 vvvv w)))))

Theorem: evex-byte2-p-of-evex-byte2

(defthm evex-byte2-p-of-evex-byte2
  (b* ((evex-byte2 (evex-byte2$inline pp res vvvv w)))
    (evex-byte2-p evex-byte2))
  :rule-classes :rewrite)

Theorem: evex-byte2$inline-of-2bits-fix-pp

(defthm evex-byte2$inline-of-2bits-fix-pp
  (equal (evex-byte2$inline (2bits-fix pp)
                            res vvvv w)
         (evex-byte2$inline pp res vvvv w)))

Theorem: evex-byte2$inline-2bits-equiv-congruence-on-pp

(defthm evex-byte2$inline-2bits-equiv-congruence-on-pp
  (implies (2bits-equiv pp pp-equiv)
           (equal (evex-byte2$inline pp res vvvv w)
                  (evex-byte2$inline pp-equiv res vvvv w)))
  :rule-classes :congruence)

Theorem: evex-byte2$inline-of-bfix-res

(defthm evex-byte2$inline-of-bfix-res
  (equal (evex-byte2$inline pp (bfix res) vvvv w)
         (evex-byte2$inline pp res vvvv w)))

Theorem: evex-byte2$inline-bit-equiv-congruence-on-res

(defthm evex-byte2$inline-bit-equiv-congruence-on-res
  (implies (bit-equiv res res-equiv)
           (equal (evex-byte2$inline pp res vvvv w)
                  (evex-byte2$inline pp res-equiv vvvv w)))
  :rule-classes :congruence)

Theorem: evex-byte2$inline-of-4bits-fix-vvvv

(defthm evex-byte2$inline-of-4bits-fix-vvvv
  (equal (evex-byte2$inline pp res (4bits-fix vvvv)
                            w)
         (evex-byte2$inline pp res vvvv w)))

Theorem: evex-byte2$inline-4bits-equiv-congruence-on-vvvv

(defthm evex-byte2$inline-4bits-equiv-congruence-on-vvvv
  (implies (4bits-equiv vvvv vvvv-equiv)
           (equal (evex-byte2$inline pp res vvvv w)
                  (evex-byte2$inline pp res vvvv-equiv w)))
  :rule-classes :congruence)

Theorem: evex-byte2$inline-of-bfix-w

(defthm evex-byte2$inline-of-bfix-w
  (equal (evex-byte2$inline pp res vvvv (bfix w))
         (evex-byte2$inline pp res vvvv w)))

Theorem: evex-byte2$inline-bit-equiv-congruence-on-w

(defthm evex-byte2$inline-bit-equiv-congruence-on-w
  (implies (bit-equiv w w-equiv)
           (equal (evex-byte2$inline pp res vvvv w)
                  (evex-byte2$inline pp res vvvv w-equiv)))
  :rule-classes :congruence)

Function: evex-byte2-equiv-under-mask$inline

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

Function: evex-byte2->pp$inline

(defun evex-byte2->pp$inline (x)
  (declare (xargs :guard (evex-byte2-p x)))
  (mbe :logic
       (let ((x (evex-byte2-fix x)))
         (part-select x :low 0 :width 2))
       :exec (the (unsigned-byte 2)
                  (logand (the (unsigned-byte 2) 3)
                          (the (unsigned-byte 8) x)))))

Theorem: 2bits-p-of-evex-byte2->pp

(defthm 2bits-p-of-evex-byte2->pp
  (b* ((pp (evex-byte2->pp$inline x)))
    (2bits-p pp))
  :rule-classes :rewrite)

Theorem: evex-byte2->pp$inline-of-evex-byte2-fix-x

(defthm evex-byte2->pp$inline-of-evex-byte2-fix-x
  (equal (evex-byte2->pp$inline (evex-byte2-fix x))
         (evex-byte2->pp$inline x)))

Theorem: evex-byte2->pp$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: evex-byte2->pp-of-evex-byte2

(defthm evex-byte2->pp-of-evex-byte2
  (equal (evex-byte2->pp (evex-byte2 pp res vvvv w))
         (2bits-fix pp)))

Theorem: evex-byte2->pp-of-write-with-mask

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

Function: evex-byte2->res$inline

(defun evex-byte2->res$inline (x)
 (declare (xargs :guard (evex-byte2-p x)))
 (mbe
     :logic
     (let ((x (evex-byte2-fix x)))
       (part-select x :low 2 :width 1))
     :exec (the (unsigned-byte 1)
                (logand (the (unsigned-byte 1) 1)
                        (the (unsigned-byte 6)
                             (ash (the (unsigned-byte 8) x) -2))))))

Theorem: bitp-of-evex-byte2->res

(defthm bitp-of-evex-byte2->res
  (b* ((res (evex-byte2->res$inline x)))
    (bitp res))
  :rule-classes :rewrite)

Theorem: evex-byte2->res$inline-of-evex-byte2-fix-x

(defthm evex-byte2->res$inline-of-evex-byte2-fix-x
  (equal (evex-byte2->res$inline (evex-byte2-fix x))
         (evex-byte2->res$inline x)))

Theorem: evex-byte2->res$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: evex-byte2->res-of-evex-byte2

(defthm evex-byte2->res-of-evex-byte2
  (equal (evex-byte2->res (evex-byte2 pp res vvvv w))
         (bfix res)))

Theorem: evex-byte2->res-of-write-with-mask

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

Function: evex-byte2->vvvv$inline

(defun evex-byte2->vvvv$inline (x)
 (declare (xargs :guard (evex-byte2-p x)))
 (mbe
     :logic
     (let ((x (evex-byte2-fix x)))
       (part-select x :low 3 :width 4))
     :exec (the (unsigned-byte 4)
                (logand (the (unsigned-byte 4) 15)
                        (the (unsigned-byte 5)
                             (ash (the (unsigned-byte 8) x) -3))))))

Theorem: 4bits-p-of-evex-byte2->vvvv

(defthm 4bits-p-of-evex-byte2->vvvv
  (b* ((vvvv (evex-byte2->vvvv$inline x)))
    (4bits-p vvvv))
  :rule-classes :rewrite)

Theorem: evex-byte2->vvvv$inline-of-evex-byte2-fix-x

(defthm evex-byte2->vvvv$inline-of-evex-byte2-fix-x
  (equal (evex-byte2->vvvv$inline (evex-byte2-fix x))
         (evex-byte2->vvvv$inline x)))

Theorem: evex-byte2->vvvv$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: evex-byte2->vvvv-of-evex-byte2

(defthm evex-byte2->vvvv-of-evex-byte2
  (equal (evex-byte2->vvvv (evex-byte2 pp res vvvv w))
         (4bits-fix vvvv)))

Theorem: evex-byte2->vvvv-of-write-with-mask

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

Function: evex-byte2->w$inline

(defun evex-byte2->w$inline (x)
 (declare (xargs :guard (evex-byte2-p x)))
 (mbe
     :logic
     (let ((x (evex-byte2-fix x)))
       (part-select x :low 7 :width 1))
     :exec (the (unsigned-byte 1)
                (logand (the (unsigned-byte 1) 1)
                        (the (unsigned-byte 1)
                             (ash (the (unsigned-byte 8) x) -7))))))

Theorem: bitp-of-evex-byte2->w

(defthm bitp-of-evex-byte2->w
  (b* ((w (evex-byte2->w$inline x)))
    (bitp w))
  :rule-classes :rewrite)

Theorem: evex-byte2->w$inline-of-evex-byte2-fix-x

(defthm evex-byte2->w$inline-of-evex-byte2-fix-x
  (equal (evex-byte2->w$inline (evex-byte2-fix x))
         (evex-byte2->w$inline x)))

Theorem: evex-byte2->w$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: evex-byte2->w-of-evex-byte2

(defthm evex-byte2->w-of-evex-byte2
  (equal (evex-byte2->w (evex-byte2 pp res vvvv w))
         (bfix w)))

Theorem: evex-byte2->w-of-write-with-mask

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

Theorem: evex-byte2-fix-in-terms-of-evex-byte2

(defthm evex-byte2-fix-in-terms-of-evex-byte2
  (equal (evex-byte2-fix x)
         (change-evex-byte2 x)))

Function: !evex-byte2->pp$inline

(defun !evex-byte2->pp$inline (pp x)
  (declare (xargs :guard (and (2bits-p pp) (evex-byte2-p x))))
  (mbe :logic
       (b* ((pp (mbe :logic (2bits-fix pp) :exec pp))
            (x (evex-byte2-fix x)))
         (part-install pp x :width 2 :low 0))
       :exec (the (unsigned-byte 8)
                  (logior (the (unsigned-byte 8)
                               (logand (the (unsigned-byte 8) x)
                                       (the (signed-byte 3) -4)))
                          (the (unsigned-byte 2) pp)))))

Theorem: evex-byte2-p-of-!evex-byte2->pp

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

Theorem: !evex-byte2->pp$inline-of-2bits-fix-pp

(defthm !evex-byte2->pp$inline-of-2bits-fix-pp
  (equal (!evex-byte2->pp$inline (2bits-fix pp)
                                 x)
         (!evex-byte2->pp$inline pp x)))

Theorem: !evex-byte2->pp$inline-2bits-equiv-congruence-on-pp

(defthm !evex-byte2->pp$inline-2bits-equiv-congruence-on-pp
  (implies (2bits-equiv pp pp-equiv)
           (equal (!evex-byte2->pp$inline pp x)
                  (!evex-byte2->pp$inline pp-equiv x)))
  :rule-classes :congruence)

Theorem: !evex-byte2->pp$inline-of-evex-byte2-fix-x

(defthm !evex-byte2->pp$inline-of-evex-byte2-fix-x
  (equal (!evex-byte2->pp$inline pp (evex-byte2-fix x))
         (!evex-byte2->pp$inline pp x)))

Theorem: !evex-byte2->pp$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: !evex-byte2->pp-is-evex-byte2

(defthm !evex-byte2->pp-is-evex-byte2
  (equal (!evex-byte2->pp pp x)
         (change-evex-byte2 x :pp pp)))

Theorem: evex-byte2->pp-of-!evex-byte2->pp

(defthm evex-byte2->pp-of-!evex-byte2->pp
  (b* ((?new-x (!evex-byte2->pp$inline pp x)))
    (equal (evex-byte2->pp new-x)
           (2bits-fix pp))))

Theorem: !evex-byte2->pp-equiv-under-mask

(defthm !evex-byte2->pp-equiv-under-mask
  (b* ((?new-x (!evex-byte2->pp$inline pp x)))
    (evex-byte2-equiv-under-mask new-x x -4)))

Function: !evex-byte2->res$inline

(defun !evex-byte2->res$inline (res x)
 (declare (xargs :guard (and (bitp res) (evex-byte2-p x))))
 (mbe
    :logic
    (b* ((res (mbe :logic (bfix res) :exec res))
         (x (evex-byte2-fix x)))
      (part-install res x :width 1 :low 2))
    :exec (the (unsigned-byte 8)
               (logior (the (unsigned-byte 8)
                            (logand (the (unsigned-byte 8) x)
                                    (the (signed-byte 4) -5)))
                       (the (unsigned-byte 3)
                            (ash (the (unsigned-byte 1) res) 2))))))

Theorem: evex-byte2-p-of-!evex-byte2->res

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

Theorem: !evex-byte2->res$inline-of-bfix-res

(defthm !evex-byte2->res$inline-of-bfix-res
  (equal (!evex-byte2->res$inline (bfix res) x)
         (!evex-byte2->res$inline res x)))

Theorem: !evex-byte2->res$inline-bit-equiv-congruence-on-res

(defthm !evex-byte2->res$inline-bit-equiv-congruence-on-res
  (implies (bit-equiv res res-equiv)
           (equal (!evex-byte2->res$inline res x)
                  (!evex-byte2->res$inline res-equiv x)))
  :rule-classes :congruence)

Theorem: !evex-byte2->res$inline-of-evex-byte2-fix-x

(defthm !evex-byte2->res$inline-of-evex-byte2-fix-x
  (equal (!evex-byte2->res$inline res (evex-byte2-fix x))
         (!evex-byte2->res$inline res x)))

Theorem: !evex-byte2->res$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: !evex-byte2->res-is-evex-byte2

(defthm !evex-byte2->res-is-evex-byte2
  (equal (!evex-byte2->res res x)
         (change-evex-byte2 x :res res)))

Theorem: evex-byte2->res-of-!evex-byte2->res

(defthm evex-byte2->res-of-!evex-byte2->res
  (b* ((?new-x (!evex-byte2->res$inline res x)))
    (equal (evex-byte2->res new-x)
           (bfix res))))

Theorem: !evex-byte2->res-equiv-under-mask

(defthm !evex-byte2->res-equiv-under-mask
  (b* ((?new-x (!evex-byte2->res$inline res x)))
    (evex-byte2-equiv-under-mask new-x x -5)))

Function: !evex-byte2->vvvv$inline

(defun !evex-byte2->vvvv$inline (vvvv x)
  (declare (xargs :guard (and (4bits-p vvvv) (evex-byte2-p x))))
  (mbe :logic
       (b* ((vvvv (mbe :logic (4bits-fix vvvv)
                       :exec vvvv))
            (x (evex-byte2-fix x)))
         (part-install vvvv x :width 4 :low 3))
       :exec (the (unsigned-byte 8)
                  (logior (the (unsigned-byte 8)
                               (logand (the (unsigned-byte 8) x)
                                       (the (signed-byte 8) -121)))
                          (the (unsigned-byte 7)
                               (ash (the (unsigned-byte 4) vvvv)
                                    3))))))

Theorem: evex-byte2-p-of-!evex-byte2->vvvv

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

Theorem: !evex-byte2->vvvv$inline-of-4bits-fix-vvvv

(defthm !evex-byte2->vvvv$inline-of-4bits-fix-vvvv
  (equal (!evex-byte2->vvvv$inline (4bits-fix vvvv)
                                   x)
         (!evex-byte2->vvvv$inline vvvv x)))

Theorem: !evex-byte2->vvvv$inline-4bits-equiv-congruence-on-vvvv

(defthm !evex-byte2->vvvv$inline-4bits-equiv-congruence-on-vvvv
  (implies (4bits-equiv vvvv vvvv-equiv)
           (equal (!evex-byte2->vvvv$inline vvvv x)
                  (!evex-byte2->vvvv$inline vvvv-equiv x)))
  :rule-classes :congruence)

Theorem: !evex-byte2->vvvv$inline-of-evex-byte2-fix-x

(defthm !evex-byte2->vvvv$inline-of-evex-byte2-fix-x
  (equal (!evex-byte2->vvvv$inline vvvv (evex-byte2-fix x))
         (!evex-byte2->vvvv$inline vvvv x)))

Theorem: !evex-byte2->vvvv$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: !evex-byte2->vvvv-is-evex-byte2

(defthm !evex-byte2->vvvv-is-evex-byte2
  (equal (!evex-byte2->vvvv vvvv x)
         (change-evex-byte2 x :vvvv vvvv)))

Theorem: evex-byte2->vvvv-of-!evex-byte2->vvvv

(defthm evex-byte2->vvvv-of-!evex-byte2->vvvv
  (b* ((?new-x (!evex-byte2->vvvv$inline vvvv x)))
    (equal (evex-byte2->vvvv new-x)
           (4bits-fix vvvv))))

Theorem: !evex-byte2->vvvv-equiv-under-mask

(defthm !evex-byte2->vvvv-equiv-under-mask
  (b* ((?new-x (!evex-byte2->vvvv$inline vvvv x)))
    (evex-byte2-equiv-under-mask new-x x -121)))

Function: !evex-byte2->w$inline

(defun !evex-byte2->w$inline (w x)
 (declare (xargs :guard (and (bitp w) (evex-byte2-p x))))
 (mbe :logic
      (b* ((w (mbe :logic (bfix w) :exec w))
           (x (evex-byte2-fix x)))
        (part-install w x :width 1 :low 7))
      :exec (the (unsigned-byte 8)
                 (logior (the (unsigned-byte 8)
                              (logand (the (unsigned-byte 8) x)
                                      (the (signed-byte 9) -129)))
                         (the (unsigned-byte 8)
                              (ash (the (unsigned-byte 1) w) 7))))))

Theorem: evex-byte2-p-of-!evex-byte2->w

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

Theorem: !evex-byte2->w$inline-of-bfix-w

(defthm !evex-byte2->w$inline-of-bfix-w
  (equal (!evex-byte2->w$inline (bfix w) x)
         (!evex-byte2->w$inline w x)))

Theorem: !evex-byte2->w$inline-bit-equiv-congruence-on-w

(defthm !evex-byte2->w$inline-bit-equiv-congruence-on-w
  (implies (bit-equiv w w-equiv)
           (equal (!evex-byte2->w$inline w x)
                  (!evex-byte2->w$inline w-equiv x)))
  :rule-classes :congruence)

Theorem: !evex-byte2->w$inline-of-evex-byte2-fix-x

(defthm !evex-byte2->w$inline-of-evex-byte2-fix-x
  (equal (!evex-byte2->w$inline w (evex-byte2-fix x))
         (!evex-byte2->w$inline w x)))

Theorem: !evex-byte2->w$inline-evex-byte2-equiv-congruence-on-x

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

Theorem: !evex-byte2->w-is-evex-byte2

(defthm !evex-byte2->w-is-evex-byte2
  (equal (!evex-byte2->w w x)
         (change-evex-byte2 x :w w)))

Theorem: evex-byte2->w-of-!evex-byte2->w

(defthm evex-byte2->w-of-!evex-byte2->w
  (b* ((?new-x (!evex-byte2->w$inline w x)))
    (equal (evex-byte2->w new-x) (bfix w))))

Theorem: !evex-byte2->w-equiv-under-mask

(defthm !evex-byte2->w-equiv-under-mask
  (b* ((?new-x (!evex-byte2->w$inline w x)))
    (evex-byte2-equiv-under-mask new-x x 127)))

Function: evex-byte2-debug$inline

(defun evex-byte2-debug$inline (x)
  (declare (xargs :guard (evex-byte2-p x)))
  (b* (((evex-byte2 x)))
    (cons (cons 'pp x.pp)
          (cons (cons 'res x.res)
                (cons (cons 'vvvv x.vvvv)
                      (cons (cons 'w x.w) nil))))))

Subtopics

!evex-byte2->vvvv
Update the |X86ISA|::|VVVV| field of a evex-byte2 bit structure.
!evex-byte2->res
Update the |X86ISA|::|RES| field of a evex-byte2 bit structure.
!evex-byte2->w
Update the |ACL2|::|W| field of a evex-byte2 bit structure.
!evex-byte2->pp
Update the |X86ISA|::|PP| field of a evex-byte2 bit structure.
Evex-byte2-p
Recognizer for evex-byte2 bit structures.
Evex-byte2->vvvv
Access the |X86ISA|::|VVVV| field of a evex-byte2 bit structure.
Evex-byte2-fix
Fixing function for evex-byte2 bit structures.
Evex-byte2->w
Access the |ACL2|::|W| field of a evex-byte2 bit structure.
Evex-byte2->res
Access the |X86ISA|::|RES| field of a evex-byte2 bit structure.
Evex-byte2->pp
Access the |X86ISA|::|PP| field of a evex-byte2 bit structure.