(wvm16 addr val x86) → (mv * x86)
Function:
(defun wvm16$inline (addr val x86) (declare (xargs :stobjs (x86))) (declare (type (signed-byte 48) addr) (type (unsigned-byte 16) val)) (if (mbt (canonical-address-p addr)) (let* ((1+addr (the (signed-byte 49) (1+ (the (signed-byte 48) addr))))) (if (mbe :logic (canonical-address-p 1+addr) :exec (< (the (signed-byte 49) 1+addr) 140737488355328)) (b* (((the (unsigned-byte 8) byte0) (mbe :logic (n08 val) :exec (logand 255 val))) ((the (unsigned-byte 8) byte1) (mbe :logic (part-select val :low 8 :width 8) :exec (logand 255 (ash val -8)))) (x86 (!memi (n48 addr) byte0 x86)) (x86 (!memi (n48 1+addr) byte1 x86))) (mv nil x86)) (mv 'wvm16 x86))) (mv 'wvm16 x86)))
Theorem:
(defthm wvm16-no-error (implies (and (canonical-address-p addr) (canonical-address-p (+ 3 addr))) (equal (mv-nth 0 (wvm16 addr val x86)) nil)))
Theorem:
(defthm x86p-mv-nth-1-wvm16 (implies (x86p x86) (x86p (mv-nth 1 (wvm16 addr val x86)))) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm xr-wmv16-app-view (implies (not (equal fld :mem)) (equal (xr fld index (mv-nth 1 (wvm16 addr val x86))) (xr fld index x86))))
Theorem:
(defthm wvm16-xw-app-view (implies (not (equal fld :mem)) (and (equal (mv-nth 0 (wvm16 addr val (xw fld index value x86))) (mv-nth 0 (wvm16 addr val x86))) (equal (mv-nth 1 (wvm16 addr val (xw fld index value x86))) (xw fld index value (mv-nth 1 (wvm16 addr val x86)))))))