Semantics of the
We calculate the effective address.
We read the low 8 bits of
Function:
(defun exec32-sb (rs1 rs2 imm stat) (declare (xargs :guard (and (ubyte5p rs1) (ubyte5p rs2) (ubyte12p imm) (state32p stat)))) (let ((__function__ 'exec32-sb)) (declare (ignorable __function__)) (b* ((addr (eff32-addr rs1 imm stat)) (val (loghead 8 (read32-xreg-unsigned rs2 stat))) (stat (write32-mem-ubyte8 addr val stat)) (stat (inc32-pc stat))) stat)))
Theorem:
(defthm state32p-of-exec32-sb (b* ((new-stat (exec32-sb rs1 rs2 imm stat))) (state32p new-stat)) :rule-classes :rewrite)
Theorem:
(defthm exec32-sb-of-ubyte5-fix-rs1 (equal (exec32-sb (ubyte5-fix rs1) rs2 imm stat) (exec32-sb rs1 rs2 imm stat)))
Theorem:
(defthm exec32-sb-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (exec32-sb rs1 rs2 imm stat) (exec32-sb rs1-equiv rs2 imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec32-sb-of-ubyte5-fix-rs2 (equal (exec32-sb rs1 (ubyte5-fix rs2) imm stat) (exec32-sb rs1 rs2 imm stat)))
Theorem:
(defthm exec32-sb-ubyte5-equiv-congruence-on-rs2 (implies (ubyte5-equiv rs2 rs2-equiv) (equal (exec32-sb rs1 rs2 imm stat) (exec32-sb rs1 rs2-equiv imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec32-sb-of-ubyte12-fix-imm (equal (exec32-sb rs1 rs2 (ubyte12-fix imm) stat) (exec32-sb rs1 rs2 imm stat)))
Theorem:
(defthm exec32-sb-ubyte12-equiv-congruence-on-imm (implies (acl2::ubyte12-equiv imm imm-equiv) (equal (exec32-sb rs1 rs2 imm stat) (exec32-sb rs1 rs2 imm-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm exec32-sb-of-state32-fix-stat (equal (exec32-sb rs1 rs2 imm (state32-fix stat)) (exec32-sb rs1 rs2 imm stat)))
Theorem:
(defthm exec32-sb-state32-equiv-congruence-on-stat (implies (state32-equiv stat stat-equiv) (equal (exec32-sb rs1 rs2 imm stat) (exec32-sb rs1 rs2 imm stat-equiv))) :rule-classes :congruence)