• 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
              • !vex2-byte1->vvvv
              • !vex2-byte1->r
              • !vex2-byte1->pp
              • !vex2-byte1->l
              • Vex2-byte1-p
              • Vex2-byte1->vvvv
              • Vex2-byte1-fix
              • Vex2-byte1->r
              • Vex2-byte1->pp
              • Vex2-byte1->l
            • Evex-prefixes
            • Evex-byte2
            • 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

Vex2-byte1

An 8-bit unsigned bitstruct type.

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

Fields
pp — 2bits
Opcode extension providing equivalent functionality of a SIMD prefix;
#b00 - None; #b01 - #x66; #b10 - #xF3; #b11 - #xF2
l — bit
Vector Length;
0 - scalar or 128-bit vector; 1 - 256-bit vector
vvvv — 4bits
A register specifier (in 1's complement form) or 1111 if unused.
r — bit
REX.R in 1's complement (inverted) form;
1: Same as REX.R=0 (must be 1 in 32-bit mode);
0: Same as REX.R=1 (64-bit mode only).
In protected and compatibility modes, the bit must be set to 1, otherwise the instruction is LES or LDS.

Definitions and Theorems

Function: vex2-byte1-p$inline

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

Theorem: vex2-byte1-p-when-unsigned-byte-p

(defthm vex2-byte1-p-when-unsigned-byte-p
  (implies (unsigned-byte-p 8 x)
           (vex2-byte1-p x)))

Theorem: unsigned-byte-p-when-vex2-byte1-p

(defthm unsigned-byte-p-when-vex2-byte1-p
  (implies (vex2-byte1-p x)
           (unsigned-byte-p 8 x)))

Theorem: vex2-byte1-p-compound-recognizer

(defthm vex2-byte1-p-compound-recognizer
  (implies (vex2-byte1-p x) (natp x))
  :rule-classes :compound-recognizer)

Function: vex2-byte1-fix$inline

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

Theorem: vex2-byte1-p-of-vex2-byte1-fix

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

Theorem: vex2-byte1-fix-when-vex2-byte1-p

(defthm vex2-byte1-fix-when-vex2-byte1-p
  (implies (vex2-byte1-p x)
           (equal (vex2-byte1-fix x) x)))

Function: vex2-byte1-equiv$inline

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

Theorem: vex2-byte1-equiv-is-an-equivalence

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

Theorem: vex2-byte1-equiv-implies-equal-vex2-byte1-fix-1

(defthm vex2-byte1-equiv-implies-equal-vex2-byte1-fix-1
  (implies (vex2-byte1-equiv x x-equiv)
           (equal (vex2-byte1-fix x)
                  (vex2-byte1-fix x-equiv)))
  :rule-classes (:congruence))

Theorem: vex2-byte1-fix-under-vex2-byte1-equiv

(defthm vex2-byte1-fix-under-vex2-byte1-equiv
  (vex2-byte1-equiv (vex2-byte1-fix x) x)
  :rule-classes (:rewrite :rewrite-quoted-constant))

Function: vex2-byte1$inline

(defun vex2-byte1$inline (pp l vvvv r)
  (declare (xargs :guard (and (2bits-p pp)
                              (bitp l)
                              (4bits-p vvvv)
                              (bitp r))))
  (b* ((pp (mbe :logic (2bits-fix pp) :exec pp))
       (l (mbe :logic (bfix l) :exec l))
       (vvvv (mbe :logic (4bits-fix vvvv)
                  :exec vvvv))
       (r (mbe :logic (bfix r) :exec r)))
    (logapp 2 pp (logapp 1 l (logapp 4 vvvv r)))))

Theorem: vex2-byte1-p-of-vex2-byte1

(defthm vex2-byte1-p-of-vex2-byte1
  (b* ((vex2-byte1 (vex2-byte1$inline pp l vvvv r)))
    (vex2-byte1-p vex2-byte1))
  :rule-classes :rewrite)

Theorem: vex2-byte1$inline-of-2bits-fix-pp

(defthm vex2-byte1$inline-of-2bits-fix-pp
  (equal (vex2-byte1$inline (2bits-fix pp)
                            l vvvv r)
         (vex2-byte1$inline pp l vvvv r)))

Theorem: vex2-byte1$inline-2bits-equiv-congruence-on-pp

(defthm vex2-byte1$inline-2bits-equiv-congruence-on-pp
  (implies (2bits-equiv pp pp-equiv)
           (equal (vex2-byte1$inline pp l vvvv r)
                  (vex2-byte1$inline pp-equiv l vvvv r)))
  :rule-classes :congruence)

Theorem: vex2-byte1$inline-of-bfix-l

(defthm vex2-byte1$inline-of-bfix-l
  (equal (vex2-byte1$inline pp (bfix l) vvvv r)
         (vex2-byte1$inline pp l vvvv r)))

Theorem: vex2-byte1$inline-bit-equiv-congruence-on-l

(defthm vex2-byte1$inline-bit-equiv-congruence-on-l
  (implies (bit-equiv l l-equiv)
           (equal (vex2-byte1$inline pp l vvvv r)
                  (vex2-byte1$inline pp l-equiv vvvv r)))
  :rule-classes :congruence)

Theorem: vex2-byte1$inline-of-4bits-fix-vvvv

(defthm vex2-byte1$inline-of-4bits-fix-vvvv
  (equal (vex2-byte1$inline pp l (4bits-fix vvvv)
                            r)
         (vex2-byte1$inline pp l vvvv r)))

Theorem: vex2-byte1$inline-4bits-equiv-congruence-on-vvvv

(defthm vex2-byte1$inline-4bits-equiv-congruence-on-vvvv
  (implies (4bits-equiv vvvv vvvv-equiv)
           (equal (vex2-byte1$inline pp l vvvv r)
                  (vex2-byte1$inline pp l vvvv-equiv r)))
  :rule-classes :congruence)

Theorem: vex2-byte1$inline-of-bfix-r

(defthm vex2-byte1$inline-of-bfix-r
  (equal (vex2-byte1$inline pp l vvvv (bfix r))
         (vex2-byte1$inline pp l vvvv r)))

Theorem: vex2-byte1$inline-bit-equiv-congruence-on-r

(defthm vex2-byte1$inline-bit-equiv-congruence-on-r
  (implies (bit-equiv r r-equiv)
           (equal (vex2-byte1$inline pp l vvvv r)
                  (vex2-byte1$inline pp l vvvv r-equiv)))
  :rule-classes :congruence)

Function: vex2-byte1-equiv-under-mask$inline

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

Function: vex2-byte1->pp$inline

(defun vex2-byte1->pp$inline (x)
  (declare (xargs :guard (vex2-byte1-p x)))
  (mbe :logic
       (let ((x (vex2-byte1-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-vex2-byte1->pp

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

Theorem: vex2-byte1->pp$inline-of-vex2-byte1-fix-x

(defthm vex2-byte1->pp$inline-of-vex2-byte1-fix-x
  (equal (vex2-byte1->pp$inline (vex2-byte1-fix x))
         (vex2-byte1->pp$inline x)))

Theorem: vex2-byte1->pp$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: vex2-byte1->pp-of-vex2-byte1

(defthm vex2-byte1->pp-of-vex2-byte1
  (equal (vex2-byte1->pp (vex2-byte1 pp l vvvv r))
         (2bits-fix pp)))

Theorem: vex2-byte1->pp-of-write-with-mask

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

Function: vex2-byte1->l$inline

(defun vex2-byte1->l$inline (x)
 (declare (xargs :guard (vex2-byte1-p x)))
 (mbe
     :logic
     (let ((x (vex2-byte1-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-vex2-byte1->l

(defthm bitp-of-vex2-byte1->l
  (b* ((l (vex2-byte1->l$inline x)))
    (bitp l))
  :rule-classes :rewrite)

Theorem: vex2-byte1->l$inline-of-vex2-byte1-fix-x

(defthm vex2-byte1->l$inline-of-vex2-byte1-fix-x
  (equal (vex2-byte1->l$inline (vex2-byte1-fix x))
         (vex2-byte1->l$inline x)))

Theorem: vex2-byte1->l$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: vex2-byte1->l-of-vex2-byte1

(defthm vex2-byte1->l-of-vex2-byte1
  (equal (vex2-byte1->l (vex2-byte1 pp l vvvv r))
         (bfix l)))

Theorem: vex2-byte1->l-of-write-with-mask

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

Function: vex2-byte1->vvvv$inline

(defun vex2-byte1->vvvv$inline (x)
 (declare (xargs :guard (vex2-byte1-p x)))
 (mbe
     :logic
     (let ((x (vex2-byte1-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-vex2-byte1->vvvv

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

Theorem: vex2-byte1->vvvv$inline-of-vex2-byte1-fix-x

(defthm vex2-byte1->vvvv$inline-of-vex2-byte1-fix-x
  (equal (vex2-byte1->vvvv$inline (vex2-byte1-fix x))
         (vex2-byte1->vvvv$inline x)))

Theorem: vex2-byte1->vvvv$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: vex2-byte1->vvvv-of-vex2-byte1

(defthm vex2-byte1->vvvv-of-vex2-byte1
  (equal (vex2-byte1->vvvv (vex2-byte1 pp l vvvv r))
         (4bits-fix vvvv)))

Theorem: vex2-byte1->vvvv-of-write-with-mask

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

Function: vex2-byte1->r$inline

(defun vex2-byte1->r$inline (x)
 (declare (xargs :guard (vex2-byte1-p x)))
 (mbe
     :logic
     (let ((x (vex2-byte1-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-vex2-byte1->r

(defthm bitp-of-vex2-byte1->r
  (b* ((r (vex2-byte1->r$inline x)))
    (bitp r))
  :rule-classes :rewrite)

Theorem: vex2-byte1->r$inline-of-vex2-byte1-fix-x

(defthm vex2-byte1->r$inline-of-vex2-byte1-fix-x
  (equal (vex2-byte1->r$inline (vex2-byte1-fix x))
         (vex2-byte1->r$inline x)))

Theorem: vex2-byte1->r$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: vex2-byte1->r-of-vex2-byte1

(defthm vex2-byte1->r-of-vex2-byte1
  (equal (vex2-byte1->r (vex2-byte1 pp l vvvv r))
         (bfix r)))

Theorem: vex2-byte1->r-of-write-with-mask

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

Theorem: vex2-byte1-fix-in-terms-of-vex2-byte1

(defthm vex2-byte1-fix-in-terms-of-vex2-byte1
  (equal (vex2-byte1-fix x)
         (change-vex2-byte1 x)))

Function: !vex2-byte1->pp$inline

(defun !vex2-byte1->pp$inline (pp x)
  (declare (xargs :guard (and (2bits-p pp) (vex2-byte1-p x))))
  (mbe :logic
       (b* ((pp (mbe :logic (2bits-fix pp) :exec pp))
            (x (vex2-byte1-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: vex2-byte1-p-of-!vex2-byte1->pp

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

Theorem: !vex2-byte1->pp$inline-of-2bits-fix-pp

(defthm !vex2-byte1->pp$inline-of-2bits-fix-pp
  (equal (!vex2-byte1->pp$inline (2bits-fix pp)
                                 x)
         (!vex2-byte1->pp$inline pp x)))

Theorem: !vex2-byte1->pp$inline-2bits-equiv-congruence-on-pp

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

Theorem: !vex2-byte1->pp$inline-of-vex2-byte1-fix-x

(defthm !vex2-byte1->pp$inline-of-vex2-byte1-fix-x
  (equal (!vex2-byte1->pp$inline pp (vex2-byte1-fix x))
         (!vex2-byte1->pp$inline pp x)))

Theorem: !vex2-byte1->pp$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: !vex2-byte1->pp-is-vex2-byte1

(defthm !vex2-byte1->pp-is-vex2-byte1
  (equal (!vex2-byte1->pp pp x)
         (change-vex2-byte1 x :pp pp)))

Theorem: vex2-byte1->pp-of-!vex2-byte1->pp

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

Theorem: !vex2-byte1->pp-equiv-under-mask

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

Function: !vex2-byte1->l$inline

(defun !vex2-byte1->l$inline (l x)
 (declare (xargs :guard (and (bitp l) (vex2-byte1-p x))))
 (mbe :logic
      (b* ((l (mbe :logic (bfix l) :exec l))
           (x (vex2-byte1-fix x)))
        (part-install l 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) l) 2))))))

Theorem: vex2-byte1-p-of-!vex2-byte1->l

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

Theorem: !vex2-byte1->l$inline-of-bfix-l

(defthm !vex2-byte1->l$inline-of-bfix-l
  (equal (!vex2-byte1->l$inline (bfix l) x)
         (!vex2-byte1->l$inline l x)))

Theorem: !vex2-byte1->l$inline-bit-equiv-congruence-on-l

(defthm !vex2-byte1->l$inline-bit-equiv-congruence-on-l
  (implies (bit-equiv l l-equiv)
           (equal (!vex2-byte1->l$inline l x)
                  (!vex2-byte1->l$inline l-equiv x)))
  :rule-classes :congruence)

Theorem: !vex2-byte1->l$inline-of-vex2-byte1-fix-x

(defthm !vex2-byte1->l$inline-of-vex2-byte1-fix-x
  (equal (!vex2-byte1->l$inline l (vex2-byte1-fix x))
         (!vex2-byte1->l$inline l x)))

Theorem: !vex2-byte1->l$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: !vex2-byte1->l-is-vex2-byte1

(defthm !vex2-byte1->l-is-vex2-byte1
  (equal (!vex2-byte1->l l x)
         (change-vex2-byte1 x :l l)))

Theorem: vex2-byte1->l-of-!vex2-byte1->l

(defthm vex2-byte1->l-of-!vex2-byte1->l
  (b* ((?new-x (!vex2-byte1->l$inline l x)))
    (equal (vex2-byte1->l new-x) (bfix l))))

Theorem: !vex2-byte1->l-equiv-under-mask

(defthm !vex2-byte1->l-equiv-under-mask
  (b* ((?new-x (!vex2-byte1->l$inline l x)))
    (vex2-byte1-equiv-under-mask new-x x -5)))

Function: !vex2-byte1->vvvv$inline

(defun !vex2-byte1->vvvv$inline (vvvv x)
  (declare (xargs :guard (and (4bits-p vvvv) (vex2-byte1-p x))))
  (mbe :logic
       (b* ((vvvv (mbe :logic (4bits-fix vvvv)
                       :exec vvvv))
            (x (vex2-byte1-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: vex2-byte1-p-of-!vex2-byte1->vvvv

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

Theorem: !vex2-byte1->vvvv$inline-of-4bits-fix-vvvv

(defthm !vex2-byte1->vvvv$inline-of-4bits-fix-vvvv
  (equal (!vex2-byte1->vvvv$inline (4bits-fix vvvv)
                                   x)
         (!vex2-byte1->vvvv$inline vvvv x)))

Theorem: !vex2-byte1->vvvv$inline-4bits-equiv-congruence-on-vvvv

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

Theorem: !vex2-byte1->vvvv$inline-of-vex2-byte1-fix-x

(defthm !vex2-byte1->vvvv$inline-of-vex2-byte1-fix-x
  (equal (!vex2-byte1->vvvv$inline vvvv (vex2-byte1-fix x))
         (!vex2-byte1->vvvv$inline vvvv x)))

Theorem: !vex2-byte1->vvvv$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: !vex2-byte1->vvvv-is-vex2-byte1

(defthm !vex2-byte1->vvvv-is-vex2-byte1
  (equal (!vex2-byte1->vvvv vvvv x)
         (change-vex2-byte1 x :vvvv vvvv)))

Theorem: vex2-byte1->vvvv-of-!vex2-byte1->vvvv

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

Theorem: !vex2-byte1->vvvv-equiv-under-mask

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

Function: !vex2-byte1->r$inline

(defun !vex2-byte1->r$inline (r x)
 (declare (xargs :guard (and (bitp r) (vex2-byte1-p x))))
 (mbe :logic
      (b* ((r (mbe :logic (bfix r) :exec r))
           (x (vex2-byte1-fix x)))
        (part-install r 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) r) 7))))))

Theorem: vex2-byte1-p-of-!vex2-byte1->r

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

Theorem: !vex2-byte1->r$inline-of-bfix-r

(defthm !vex2-byte1->r$inline-of-bfix-r
  (equal (!vex2-byte1->r$inline (bfix r) x)
         (!vex2-byte1->r$inline r x)))

Theorem: !vex2-byte1->r$inline-bit-equiv-congruence-on-r

(defthm !vex2-byte1->r$inline-bit-equiv-congruence-on-r
  (implies (bit-equiv r r-equiv)
           (equal (!vex2-byte1->r$inline r x)
                  (!vex2-byte1->r$inline r-equiv x)))
  :rule-classes :congruence)

Theorem: !vex2-byte1->r$inline-of-vex2-byte1-fix-x

(defthm !vex2-byte1->r$inline-of-vex2-byte1-fix-x
  (equal (!vex2-byte1->r$inline r (vex2-byte1-fix x))
         (!vex2-byte1->r$inline r x)))

Theorem: !vex2-byte1->r$inline-vex2-byte1-equiv-congruence-on-x

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

Theorem: !vex2-byte1->r-is-vex2-byte1

(defthm !vex2-byte1->r-is-vex2-byte1
  (equal (!vex2-byte1->r r x)
         (change-vex2-byte1 x :r r)))

Theorem: vex2-byte1->r-of-!vex2-byte1->r

(defthm vex2-byte1->r-of-!vex2-byte1->r
  (b* ((?new-x (!vex2-byte1->r$inline r x)))
    (equal (vex2-byte1->r new-x) (bfix r))))

Theorem: !vex2-byte1->r-equiv-under-mask

(defthm !vex2-byte1->r-equiv-under-mask
  (b* ((?new-x (!vex2-byte1->r$inline r x)))
    (vex2-byte1-equiv-under-mask new-x x 127)))

Function: vex2-byte1-debug$inline

(defun vex2-byte1-debug$inline (x)
  (declare (xargs :guard (vex2-byte1-p x)))
  (b* (((vex2-byte1 x)))
    (cons (cons 'pp x.pp)
          (cons (cons 'l x.l)
                (cons (cons 'vvvv x.vvvv)
                      (cons (cons 'r x.r) nil))))))

Subtopics

!vex2-byte1->vvvv
Update the |X86ISA|::|VVVV| field of a vex2-byte1 bit structure.
!vex2-byte1->r
Update the |ACL2|::|R| field of a vex2-byte1 bit structure.
!vex2-byte1->pp
Update the |X86ISA|::|PP| field of a vex2-byte1 bit structure.
!vex2-byte1->l
Update the |ACL2|::|L| field of a vex2-byte1 bit structure.
Vex2-byte1-p
Recognizer for vex2-byte1 bit structures.
Vex2-byte1->vvvv
Access the |X86ISA|::|VVVV| field of a vex2-byte1 bit structure.
Vex2-byte1-fix
Fixing function for vex2-byte1 bit structures.
Vex2-byte1->r
Access the |ACL2|::|R| field of a vex2-byte1 bit structure.
Vex2-byte1->pp
Access the |X86ISA|::|PP| field of a vex2-byte1 bit structure.
Vex2-byte1->l
Access the |ACL2|::|L| field of a vex2-byte1 bit structure.