• 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
          • 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
                • Modr/m-structures
                  • Modr/m
                    • !modr/m->r/m
                    • !modr/m->reg
                    • !modr/m->mod
                    • Modr/m-p
                    • Modr/m->reg
                    • Modr/m->mod
                    • Modr/m-fix
                      • Modr/m->r/m
                    • Modr/m-equiv-under-mask
                    • Modr/m-debug
                  • Three-byte-opcode-modr/m-p
                  • 64-bit-mode-0f-3a-three-byte-opcode-modr/m-p
                  • 64-bit-mode-0f-38-three-byte-opcode-modr/m-p
                  • 32-bit-mode-0f-3a-three-byte-opcode-modr/m-p
                  • 32-bit-mode-0f-38-three-byte-opcode-modr/m-p
                  • 64-bit-mode-two-byte-opcode-modr/m-p
                  • 32-bit-mode-two-byte-opcode-modr/m-p
                  • Two-byte-opcode-modr/m-p
                  • Show-no-modr/m-insts
                  • 64-bit-mode-one-byte-opcode-modr/m-p
                  • 32-bit-mode-one-byte-opcode-modr/m-p
                  • Vex-opcode-modr/m-p
                  • One-byte-opcode-modr/m-p
                • 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
              • 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

    Modr/m-fix

    Fixing function for modr/m bit structures.

    Signature
    (modr/m-fix x) → fty::fixed
    Arguments
    x — Guard (modr/m-p x).
    Returns
    fty::fixed — Type (modr/m-p fty::fixed).

    Definitions and Theorems

    Function: modr/m-fix$inline

    (defun modr/m-fix$inline (x)
      (declare (xargs :guard (modr/m-p x)))
      (mbe :logic (loghead 8 x) :exec x))

    Theorem: modr/m-p-of-modr/m-fix

    (defthm modr/m-p-of-modr/m-fix
      (b* ((fty::fixed (modr/m-fix$inline x)))
        (modr/m-p fty::fixed))
      :rule-classes :rewrite)

    Theorem: modr/m-fix-when-modr/m-p

    (defthm modr/m-fix-when-modr/m-p
      (implies (modr/m-p x)
               (equal (modr/m-fix x) x)))

    Function: modr/m-equiv$inline

    (defun modr/m-equiv$inline (x y)
      (declare (xargs :guard (and (modr/m-p x) (modr/m-p y))))
      (equal (modr/m-fix x) (modr/m-fix y)))

    Theorem: modr/m-equiv-is-an-equivalence

    (defthm modr/m-equiv-is-an-equivalence
      (and (booleanp (modr/m-equiv x y))
           (modr/m-equiv x x)
           (implies (modr/m-equiv x y)
                    (modr/m-equiv y x))
           (implies (and (modr/m-equiv x y)
                         (modr/m-equiv y z))
                    (modr/m-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: modr/m-equiv-implies-equal-modr/m-fix-1

    (defthm modr/m-equiv-implies-equal-modr/m-fix-1
      (implies (modr/m-equiv x x-equiv)
               (equal (modr/m-fix x)
                      (modr/m-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: modr/m-fix-under-modr/m-equiv

    (defthm modr/m-fix-under-modr/m-equiv
      (modr/m-equiv (modr/m-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))