• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
          • Register-readers-and-writers
            • Zmms-reads-and-writes
            • Gprs-reads-and-writes
            • Mmx-registers-reads-and-writes
            • Xmms-reads-and-writes
            • Rflags-reads-and-writes
            • Gpr-indices
            • Vex-vvvv-reg-index
              • Msr-reads-and-writes
              • Ctr-reads-and-writes
            • X86-modes
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Register-readers-and-writers

    Vex-vvvv-reg-index

    Register index specified by the VEX.vvvv bits.

    Signature
    (vex-vvvv-reg-index vvvv) → index
    Returns
    index — Type (natp index).

    The VEX.vvvv bits specify a register index in inverted (i.e. ones' complement) form: see Intel Manual Volume 2 Section 2.3.6 (Dec 2023). We introduce this function to perform the ones' complement, for greater abstraction.

    Definitions and Theorems

    Function: vex-vvvv-reg-index

    (defun vex-vvvv-reg-index (vvvv)
      (declare (type (unsigned-byte 4) vvvv))
      (let ((__function__ 'vex-vvvv-reg-index))
        (declare (ignorable __function__))
        (loghead 4 (lognot vvvv))))

    Theorem: natp-of-vex-vvvv-reg-index

    (defthm natp-of-vex-vvvv-reg-index
      (b* ((index (vex-vvvv-reg-index vvvv)))
        (natp index))
      :rule-classes :rewrite)

    Theorem: n04p-of-vex-vvvv-reg-index

    (defthm n04p-of-vex-vvvv-reg-index
     (unsigned-byte-p 4 (vex-vvvv-reg-index vvvv))
     :rule-classes
     (:rewrite
      (:type-prescription
          :corollary (natp (vex-vvvv-reg-index vvvv))
          :hints
          (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp))))
      (:linear
       :corollary (and (<= 0 (vex-vvvv-reg-index vvvv))
                       (< (vex-vvvv-reg-index vvvv) 16))
       :hints
       (("Goal"
            :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))