Semantics of the
We read a signed 32-bit integer from
Function:
(defun exec-sraw (rd rs1 rs2 stat feat) (declare (xargs :guard (and (ubyte5p rd) (ubyte5p rs1) (ubyte5p rs2) (statp stat) (featp feat)))) (declare (xargs :guard (and (feat-64p feat) (stat-validp stat feat)))) (let ((__function__ 'exec-sraw)) (declare (ignorable __function__)) (b* ((rs1-operand (read-xreg-signed32 (ubyte5-fix rs1) stat feat)) (rs2-operand (read-xreg-unsigned32 (ubyte5-fix rs2) stat feat)) (shift-amount (loghead 5 rs2-operand)) (result (ash rs1-operand (- shift-amount))) (stat (write-xreg-32 (ubyte5-fix rd) result stat feat)) (stat (inc4-pc stat feat))) stat)))
Theorem:
(defthm statp-of-exec-sraw (b* ((new-stat (exec-sraw rd rs1 rs2 stat feat))) (statp new-stat)) :rule-classes :rewrite)
Theorem:
(defthm stat-validp-of-exec-sraw (implies (stat-validp stat feat) (b* ((?new-stat (exec-sraw rd rs1 rs2 stat feat))) (stat-validp new-stat feat))))
Theorem:
(defthm exec-sraw-of-ubyte5-fix-rd (equal (exec-sraw (ubyte5-fix rd) rs1 rs2 stat feat) (exec-sraw rd rs1 rs2 stat feat)))
Theorem:
(defthm exec-sraw-ubyte5-equiv-congruence-on-rd (implies (ubyte5-equiv rd rd-equiv) (equal (exec-sraw rd rs1 rs2 stat feat) (exec-sraw rd-equiv rs1 rs2 stat feat))) :rule-classes :congruence)
Theorem:
(defthm exec-sraw-of-ubyte5-fix-rs1 (equal (exec-sraw rd (ubyte5-fix rs1) rs2 stat feat) (exec-sraw rd rs1 rs2 stat feat)))
Theorem:
(defthm exec-sraw-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (exec-sraw rd rs1 rs2 stat feat) (exec-sraw rd rs1-equiv rs2 stat feat))) :rule-classes :congruence)
Theorem:
(defthm exec-sraw-of-ubyte5-fix-rs2 (equal (exec-sraw rd rs1 (ubyte5-fix rs2) stat feat) (exec-sraw rd rs1 rs2 stat feat)))
Theorem:
(defthm exec-sraw-ubyte5-equiv-congruence-on-rs2 (implies (ubyte5-equiv rs2 rs2-equiv) (equal (exec-sraw rd rs1 rs2 stat feat) (exec-sraw rd rs1 rs2-equiv stat feat))) :rule-classes :congruence)
Theorem:
(defthm exec-sraw-of-stat-fix-stat (equal (exec-sraw rd rs1 rs2 (stat-fix stat) feat) (exec-sraw rd rs1 rs2 stat feat)))
Theorem:
(defthm exec-sraw-stat-equiv-congruence-on-stat (implies (stat-equiv stat stat-equiv) (equal (exec-sraw rd rs1 rs2 stat feat) (exec-sraw rd rs1 rs2 stat-equiv feat))) :rule-classes :congruence)
Theorem:
(defthm exec-sraw-of-feat-fix-feat (equal (exec-sraw rd rs1 rs2 stat (feat-fix feat)) (exec-sraw rd rs1 rs2 stat feat)))
Theorem:
(defthm exec-sraw-feat-equiv-congruence-on-feat (implies (feat-equiv feat feat-equiv) (equal (exec-sraw rd rs1 rs2 stat feat) (exec-sraw rd rs1 rs2 stat feat-equiv))) :rule-classes :congruence)