Size constraints on a memory address of some instruction byte
(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
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.
Function:
(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:
(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:
(defthm rip-guard-okp-for-64-bit-modep (equal (rip-guard-okp 0 rip) (signed-byte-p 48 rip)))
Theorem:
(defthm rip-guard-okp-for-compatibility-mode (equal (rip-guard-okp 1 rip) (unsigned-byte-p 32 rip)))