• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Introduction
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • Syscalls
          • Cpuid
          • X86isa-state
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
            • Effective-address-computations
            • Read-operands-and-write-results
            • Instruction-pointer-operations
            • Select-operand-size
            • Stack-pointer-operations
            • Select-segment-register
            • Prefix-modrm-sib-decoding
              • Modr/m-decoding
              • Mandatory-prefixes-computation
              • Modr/m-detection
              • 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
            • Check-instruction-length
            • Error-objects
            • Rip-guard-okp
            • Sib-decoding
          • Instructions
          • X86-modes
          • Segmentation
          • Register-readers-and-writers
          • Other-non-deterministic-computations
          • Environment
          • Paging
        • Implemented-opcodes
        • Proof-utilities
        • To-do
        • Concrete-simulation-examples
        • Model-validation
        • Utils
        • Debugging-code-proofs
      • Execloader
      • Axe
    • Testing-utilities
    • Math
  • Decoding-and-spec-utils

Prefix-modrm-sib-decoding

Decoding utilities for the prefixes, ModR/M, and SIB bytes

Legacy Prefix Decoding

Array *one-byte-prefixes-group-code-info-ar* is used for the efficient lookup of prefix group code information from the one-byte opcode map; see legacy-prefixes-decoding and opcode-maps.

Picking Mandatory Prefixes

See mandatory-prefixes-computation and instructions-with-mandatory-prefixes for details.

ModR/M and VEX Decoding

Arrays are created for the efficient lookup of modr/m-related information from the opcode maps. See ModR/M-decoding.

SIB Detecting and Decoding

See SIB-decoding for details.

Subtopics

Modr/m-decoding
Functions to detect and decode ModR/M bytes
Mandatory-prefixes-computation
Picking a mandatory prefix
Modr/m-detection
Utilities to detect which opcodes need a ModR/M byte
Legacy-prefixes-decoding
Functions to detect and decode legacy prefixes
Compute-mandatory-prefix-for-three-byte-opcode
Three-byte opcodes: picks the appropriate SIMD prefix as the mandatory prefix, if applicable
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
Based off opcode-maps, pre-computing the opcodes that have a valid instruction corresponding to the following prefixes: :NO-PREFIX :66 :F3 :F2.
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