• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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
            • Read-operands-and-write-results
            • Effective-address-computations
            • Select-operand-size
            • Instruction-pointer-operations
            • Stack-pointer-operations
            • Select-segment-register
            • Prefix-modrm-sib-decoding
              • Modr/m-decoding
              • Mandatory-prefixes-computation
              • Modr/m-detection
                • Compute-modr/m-for-opcodes
                  • Inst-needs-modr/m-p
                  • Operand-needs-modr/m-p
                  • Any-inst-needs-modr/m-p
                • Legacy-prefixes-decoding
                • Compute-mandatory-prefix-for-three-byte-opcode
                • 64-bit-compute-mandatory-prefix-for-0f-3a-three-byte-opcode
                • 64-bit-compute-mandatory-prefix-for-0f-38-three-byte-opcode
                • 32-bit-compute-mandatory-prefix-for-0f-3a-three-byte-opcode
                • 32-bit-compute-mandatory-prefix-for-0f-38-three-byte-opcode
                • 64-bit-compute-mandatory-prefix-for-two-byte-opcode
                • 32-bit-compute-mandatory-prefix-for-two-byte-opcode
                • Instructions-with-mandatory-prefixes
                • Compute-mandatory-prefix-for-0f-3a-three-byte-opcode
                • Compute-mandatory-prefix-for-0f-38-three-byte-opcode
                • Compute-mandatory-prefix-for-two-byte-opcode
              • Select-address-size
              • Rex-byte-from-vex-prefixes
              • Check-instruction-length
              • Error-objects
              • Rip-guard-okp
              • Sib-decoding
            • Instructions
            • Register-readers-and-writers
            • 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
    • Modr/m-detection

    Compute-modr/m-for-opcodes

    Signature
    (compute-modr/m-for-opcodes first-opcode num-opcodes inst-lst) 
      → 
    computed-table
    Arguments
    first-opcode — Guard (24bits-p first-opcode).
    num-opcodes — Guard (natp num-opcodes).
    inst-lst — Guard (inst-list-p inst-lst).
    Returns
    computed-table — Type (true-listp computed-table).

    Definitions and Theorems

    Function: compute-modr/m-for-opcodes

    (defun compute-modr/m-for-opcodes
           (first-opcode num-opcodes inst-lst)
      (declare (xargs :guard (and (24bits-p first-opcode)
                                  (natp num-opcodes)
                                  (inst-list-p inst-lst))))
      (let ((__function__ 'compute-modr/m-for-opcodes))
        (declare (ignorable __function__))
        (b* (((when (zp num-opcodes)) nil)
             (rest (if (24bits-p (1+ first-opcode))
                       (compute-modr/m-for-opcodes (1+ first-opcode)
                                                   (1- num-opcodes)
                                                   inst-lst)
                     (er hard? 'compute-modr/m-for-opcodes
                         "Illegal opcode ~s0.~%"
                         (str::hexify (1+ first-opcode)))))
             (same-opcode-insts (select-insts inst-lst
                                              :opcode first-opcode))
             ((when (endp same-opcode-insts))
              (cons 0 rest)))
          (cons (if (any-inst-needs-modr/m-p same-opcode-insts)
                    1
                  0)
                rest))))

    Theorem: true-listp-of-compute-modr/m-for-opcodes

    (defthm true-listp-of-compute-modr/m-for-opcodes
     (b*
      ((computed-table
        (compute-modr/m-for-opcodes first-opcode num-opcodes inst-lst)))
      (true-listp computed-table))
     :rule-classes :rewrite)