Semantics of the
Only little endian is supported for now.
We calculate the effective address.
We read the low 16 bits of
Function:
(defun exec64-sh (rs1 rs2 imm stat) (declare (xargs :guard (and (ubyte5p rs1) (ubyte5p rs2) (ubyte12p imm) (state64p stat)))) (let ((__function__ 'exec64-sh)) (declare (ignorable __function__)) (b* ((addr (eff64-addr rs1 imm stat)) (val (loghead 16 (read64-xreg-unsigned rs2 stat))) (stat (write64-mem-ubyte16-lendian addr val stat)) (stat (inc64-pc stat))) stat)))
Theorem:
(defthm state64p-of-exec64-sh (b* ((new-stat (exec64-sh rs1 rs2 imm stat))) (state64p new-stat)) :rule-classes :rewrite)
Theorem:
(defthm exec64-sh-of-ubyte5-fix-rs1 (equal (exec64-sh (ubyte5-fix rs1) rs2 imm stat) (exec64-sh rs1 rs2 imm stat)))
Theorem:
(defthm exec64-sh-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (exec64-sh rs1 rs2 imm stat) (exec64-sh rs1-equiv rs2 imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-sh-of-ubyte5-fix-rs2 (equal (exec64-sh rs1 (ubyte5-fix rs2) imm stat) (exec64-sh rs1 rs2 imm stat)))
Theorem:
(defthm exec64-sh-ubyte5-equiv-congruence-on-rs2 (implies (ubyte5-equiv rs2 rs2-equiv) (equal (exec64-sh rs1 rs2 imm stat) (exec64-sh rs1 rs2-equiv imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-sh-of-ubyte12-fix-imm (equal (exec64-sh rs1 rs2 (ubyte12-fix imm) stat) (exec64-sh rs1 rs2 imm stat)))
Theorem:
(defthm exec64-sh-ubyte12-equiv-congruence-on-imm (implies (acl2::ubyte12-equiv imm imm-equiv) (equal (exec64-sh rs1 rs2 imm stat) (exec64-sh rs1 rs2 imm-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-sh-of-state64-fix-stat (equal (exec64-sh rs1 rs2 imm (state64-fix stat)) (exec64-sh rs1 rs2 imm stat)))
Theorem:
(defthm exec64-sh-state64-equiv-congruence-on-stat (implies (state64-equiv stat stat-equiv) (equal (exec64-sh rs1 rs2 imm stat) (exec64-sh rs1 rs2 imm stat-equiv))) :rule-classes :congruence)