Read a signed 32-bit integer from an
The register index consists of 5 bits. We read an unsigned 32-bit integer from the register, and convert it to signed.
Function:
(defun read32-xreg-signed (reg stat) (declare (xargs :guard (and (ubyte5p reg) (state32p stat)))) (let ((__function__ 'read32-xreg-signed)) (declare (ignorable __function__)) (logext 32 (read32-xreg-unsigned reg stat))))
Theorem:
(defthm sbyte32p-of-read32-xreg-signed (b* ((val (read32-xreg-signed reg stat))) (sbyte32p val)) :rule-classes :rewrite)
Theorem:
(defthm read32-xreg-signed-of-ubyte5-fix-reg (equal (read32-xreg-signed (ubyte5-fix reg) stat) (read32-xreg-signed reg stat)))
Theorem:
(defthm read32-xreg-signed-ubyte5-equiv-congruence-on-reg (implies (ubyte5-equiv reg reg-equiv) (equal (read32-xreg-signed reg stat) (read32-xreg-signed reg-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm read32-xreg-signed-of-state32-fix-stat (equal (read32-xreg-signed reg (state32-fix stat)) (read32-xreg-signed reg stat)))
Theorem:
(defthm read32-xreg-signed-state32-equiv-congruence-on-stat (implies (state32-equiv stat stat-equiv) (equal (read32-xreg-signed reg stat) (read32-xreg-signed reg stat-equiv))) :rule-classes :congruence)