Semantics of the
Only little endian is supported for now.
We calculate the effective address.
We read an unsigned 16-bit integer from the effective address,
which is also implicitly zero-extended to 64 bits.
We write the result to
Function:
(defun exec64-lhu (rd rs1 imm stat) (declare (xargs :guard (and (ubyte5p rd) (ubyte5p rs1) (ubyte12p imm) (state64p stat)))) (let ((__function__ 'exec64-lhu)) (declare (ignorable __function__)) (b* ((addr (eff64-addr rs1 imm stat)) (result (read64-mem-ubyte16-lendian addr stat)) (stat (write64-xreg rd result stat)) (stat (inc64-pc stat))) stat)))
Theorem:
(defthm state64p-of-exec64-lhu (b* ((new-stat (exec64-lhu rd rs1 imm stat))) (state64p new-stat)) :rule-classes :rewrite)
Theorem:
(defthm exec64-lhu-of-ubyte5-fix-rd (equal (exec64-lhu (ubyte5-fix rd) rs1 imm stat) (exec64-lhu rd rs1 imm stat)))
Theorem:
(defthm exec64-lhu-ubyte5-equiv-congruence-on-rd (implies (ubyte5-equiv rd rd-equiv) (equal (exec64-lhu rd rs1 imm stat) (exec64-lhu rd-equiv rs1 imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-lhu-of-ubyte5-fix-rs1 (equal (exec64-lhu rd (ubyte5-fix rs1) imm stat) (exec64-lhu rd rs1 imm stat)))
Theorem:
(defthm exec64-lhu-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (exec64-lhu rd rs1 imm stat) (exec64-lhu rd rs1-equiv imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-lhu-of-ubyte12-fix-imm (equal (exec64-lhu rd rs1 (ubyte12-fix imm) stat) (exec64-lhu rd rs1 imm stat)))
Theorem:
(defthm exec64-lhu-ubyte12-equiv-congruence-on-imm (implies (acl2::ubyte12-equiv imm imm-equiv) (equal (exec64-lhu rd rs1 imm stat) (exec64-lhu rd rs1 imm-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-lhu-of-state64-fix-stat (equal (exec64-lhu rd rs1 imm (state64-fix stat)) (exec64-lhu rd rs1 imm stat)))
Theorem:
(defthm exec64-lhu-state64-equiv-congruence-on-stat (implies (state64-equiv stat stat-equiv) (equal (exec64-lhu rd rs1 imm stat) (exec64-lhu rd rs1 imm stat-equiv))) :rule-classes :congruence)