Functions to detect and decode SIB bytes
Function:
(defun x86-decode-sib-p (modr/m 16-bit-addressp) (declare (type (unsigned-byte 8) modr/m)) (declare (xargs :guard (booleanp 16-bit-addressp))) (let ((__function__ 'x86-decode-sib-p)) (declare (ignorable __function__)) (and (not 16-bit-addressp) (b* ((r/m (modr/m->r/m modr/m)) (mod (modr/m->mod modr/m))) (and (int= r/m 4) (not (int= mod 3)))))))
Theorem:
(defthm booleanp-of-x86-decode-sib-p (implies (n08p modr/m) (b* ((bool (x86-decode-sib-p modr/m 16-bit-addressp))) (booleanp bool))) :rule-classes :rewrite)