• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • 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
            • 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
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Decoding-and-spec-utils

    Rip-guard-okp

    Size constraints on a memory address of some instruction byte

    Signature
    (rip-guard-okp proc-mode rip) → *

    This function specifies the maximum size of a memory address that points to some instruction byte in a certain mode of operation. We usually use this function to specify the guard on start-rip or temp-rip --- that way, we can put in suitable type declarations in our specification functions.

    This function doesn't really specify whether a memory address that points to some instruction byte is valid or not --- that notion is much more complicated; see canonical-address-p, ea-to-la, and instruction-pointer-operations for details.

    Definitions and Theorems

    Function: rip-guard-okp

    (defun rip-guard-okp (proc-mode rip)
      (declare (type (integer 0 4) proc-mode)
               (type (signed-byte 48) rip))
      (let ((__function__ 'rip-guard-okp))
        (declare (ignorable __function__))
        (if (equal proc-mode 0)
            (signed-byte-p 48 rip)
          (unsigned-byte-p 32 rip))))

    Theorem: rip-guard-okp-equiv-for-non-64-bit-modes

    (defthm rip-guard-okp-equiv-for-non-64-bit-modes
      (implies (and (rip-guard-okp proc-mode-1 rip)
                    (not (equal proc-mode-1 0))
                    (not (equal proc-mode-2 0)))
               (rip-guard-okp proc-mode-2 rip)))

    Theorem: rip-guard-okp-for-64-bit-modep

    (defthm rip-guard-okp-for-64-bit-modep
      (equal (rip-guard-okp 0 rip)
             (signed-byte-p 48 rip)))

    Theorem: rip-guard-okp-for-compatibility-mode

    (defthm rip-guard-okp-for-compatibility-mode
      (equal (rip-guard-okp 1 rip)
             (unsigned-byte-p 32 rip)))