Effective address for a load or store instruction [ISA:2.6].
We read an unsigned 32-bit integer from
Function:
(defun eff32-addr (rs1 imm stat) (declare (xargs :guard (and (ubyte5p rs1) (ubyte12p imm) (state32p stat)))) (let ((__function__ 'eff32-addr)) (declare (ignorable __function__)) (b* ((base (read32-xreg-unsigned rs1 stat)) (offset (loghead 32 (logext 12 (ubyte12-fix imm))))) (+ base offset))))
Theorem:
(defthm integerp-of-eff32-addr (b* ((addr (eff32-addr rs1 imm stat))) (integerp addr)) :rule-classes :rewrite)
Theorem:
(defthm eff32-addr-of-ubyte5-fix-rs1 (equal (eff32-addr (ubyte5-fix rs1) imm stat) (eff32-addr rs1 imm stat)))
Theorem:
(defthm eff32-addr-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (eff32-addr rs1 imm stat) (eff32-addr rs1-equiv imm stat))) :rule-classes :congruence)
Theorem:
(defthm eff32-addr-of-ubyte12-fix-imm (equal (eff32-addr rs1 (ubyte12-fix imm) stat) (eff32-addr rs1 imm stat)))
Theorem:
(defthm eff32-addr-ubyte12-equiv-congruence-on-imm (implies (acl2::ubyte12-equiv imm imm-equiv) (equal (eff32-addr rs1 imm stat) (eff32-addr rs1 imm-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm eff32-addr-of-state32-fix-stat (equal (eff32-addr rs1 imm (state32-fix stat)) (eff32-addr rs1 imm stat)))
Theorem:
(defthm eff32-addr-state32-equiv-congruence-on-stat (implies (state32-equiv stat stat-equiv) (equal (eff32-addr rs1 imm stat) (eff32-addr rs1 imm stat-equiv))) :rule-classes :congruence)