Read form byte, word, doubleword, or quadword general-purpose register
(rgfi-size nbytes index rex x86) → val
Function:
(defun rgfi-size$inline (nbytes index rex x86) (declare (xargs :stobjs (x86))) (declare (type (unsigned-byte 4) nbytes) (type (unsigned-byte 4) index) (type (unsigned-byte 8) rex)) (declare (xargs :guard (and (reg-indexp index rex) (member nbytes '(1 2 4 8))))) (case nbytes (1 (rr08 index rex x86)) (2 (rr16 index x86)) (4 (rr32 index x86)) (8 (rr64 index x86)) (otherwise 0)))
Theorem:
(defthm natp-of-rgfi-size (b* ((val (rgfi-size$inline nbytes index rex x86))) (natp val)) :rule-classes :type-prescription)