Semantics of the
We read an unsigned 32-bit integer from
Function:
(defun exec64-srliw (rd rs1 imm stat) (declare (xargs :guard (and (ubyte5p rd) (ubyte5p rs1) (ubyte5p imm) (state64p stat)))) (let ((__function__ 'exec64-srliw)) (declare (ignorable __function__)) (b* ((rs1-operand (read64-xreg-unsigned32 rs1 stat)) (shift-amount (ubyte5-fix imm)) (result (ash rs1-operand (- shift-amount))) (stat (write64-xreg-32 rd result stat)) (stat (inc64-pc stat))) stat)))
Theorem:
(defthm state64p-of-exec64-srliw (b* ((new-stat (exec64-srliw rd rs1 imm stat))) (state64p new-stat)) :rule-classes :rewrite)
Theorem:
(defthm exec64-srliw-of-ubyte5-fix-rd (equal (exec64-srliw (ubyte5-fix rd) rs1 imm stat) (exec64-srliw rd rs1 imm stat)))
Theorem:
(defthm exec64-srliw-ubyte5-equiv-congruence-on-rd (implies (ubyte5-equiv rd rd-equiv) (equal (exec64-srliw rd rs1 imm stat) (exec64-srliw rd-equiv rs1 imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-srliw-of-ubyte5-fix-rs1 (equal (exec64-srliw rd (ubyte5-fix rs1) imm stat) (exec64-srliw rd rs1 imm stat)))
Theorem:
(defthm exec64-srliw-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (exec64-srliw rd rs1 imm stat) (exec64-srliw rd rs1-equiv imm stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-srliw-of-ubyte5-fix-imm (equal (exec64-srliw rd rs1 (ubyte5-fix imm) stat) (exec64-srliw rd rs1 imm stat)))
Theorem:
(defthm exec64-srliw-ubyte5-equiv-congruence-on-imm (implies (ubyte5-equiv imm imm-equiv) (equal (exec64-srliw rd rs1 imm stat) (exec64-srliw rd rs1 imm-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-srliw-of-state64-fix-stat (equal (exec64-srliw rd rs1 imm (state64-fix stat)) (exec64-srliw rd rs1 imm stat)))
Theorem:
(defthm exec64-srliw-state64-equiv-congruence-on-stat (implies (state64-equiv stat stat-equiv) (equal (exec64-srliw rd rs1 imm stat) (exec64-srliw rd rs1 imm stat-equiv))) :rule-classes :congruence)