• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
              • Reg-index
              • Reg-indexp
              • 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
    • Gpr-indices

    Reg-indexp

    Valid GPR index recognizer

    Signature
    (reg-indexp reg rex-byte) → *

    General-purpose register indices are 3 bits except in 64-bit mode, where they can have 4 bits depending on the rex prefix.

    Definitions and Theorems

    Function: reg-indexp

    (defun reg-indexp (reg rex-byte)
      (declare (type (unsigned-byte 8) rex-byte))
      (let ((__function__ 'reg-indexp))
        (declare (ignorable __function__))
        (if (eql rex-byte 0)
            (n03p reg)
          (n04p reg))))

    Theorem: reg-indexp-for-3-bits

    (defthm reg-indexp-for-3-bits
      (implies (and (syntaxp (quotep reg)) (n03p reg))
               (reg-indexp reg rex)))

    Theorem: reg-indexp-logand-7

    (defthm reg-indexp-logand-7
      (implies (n08p rex-byte)
               (reg-indexp (loghead 3 modr/m)
                           rex-byte)))