Write to byte, word, doubleword, or quadword general-purpose register
(!rgfi-size nbytes index val rex x86) → x86
Function:
(defun !rgfi-size$inline (nbytes index val rex x86) (declare (xargs :stobjs (x86))) (declare (type (unsigned-byte 4) nbytes) (type (unsigned-byte 4) index) (type integer val) (type (unsigned-byte 8) rex)) (declare (xargs :guard (and (reg-indexp index rex) (member nbytes '(1 2 4 8)) (unsigned-byte-p (ash nbytes 3) val)))) (case nbytes (1 (wr08 index rex val x86)) (2 (wr16 index val x86)) (4 (wr32 index val x86)) (8 (wr64 index val x86)) (otherwise x86)))
Theorem:
(defthm x86p-of-!rgfi-size (implies (x86p x86) (b* ((x86 (!rgfi-size$inline nbytes index val rex x86))) (x86p x86))) :rule-classes :rewrite)