Unsigned right shift of an
(int-long-ushiftr operand-left operand-right) → result
We first convert the left operand to unsigned.
Only the low 5 bits of the distance are used [JLS14:15.19].
Function:
(defun int-long-ushiftr (operand-left operand-right) (declare (xargs :guard (and (int-valuep operand-left) (long-valuep operand-right)))) (b* ((x (int-value->int operand-left)) (y (long-value->int operand-right))) (int-value (logext 32 (ash (loghead 32 x) (- (loghead 5 y)))))))
Theorem:
(defthm int-valuep-of-int-long-ushiftr (b* ((result (int-long-ushiftr operand-left operand-right))) (int-valuep result)) :rule-classes :rewrite)
Theorem:
(defthm int-long-ushiftr-of-int-value-fix-operand-left (equal (int-long-ushiftr (int-value-fix operand-left) operand-right) (int-long-ushiftr operand-left operand-right)))
Theorem:
(defthm int-long-ushiftr-int-value-equiv-congruence-on-operand-left (implies (int-value-equiv operand-left operand-left-equiv) (equal (int-long-ushiftr operand-left operand-right) (int-long-ushiftr operand-left-equiv operand-right))) :rule-classes :congruence)
Theorem:
(defthm int-long-ushiftr-of-long-value-fix-operand-right (equal (int-long-ushiftr operand-left (long-value-fix operand-right)) (int-long-ushiftr operand-left operand-right)))
Theorem:
(defthm int-long-ushiftr-long-value-equiv-congruence-on-operand-right (implies (long-value-equiv operand-right operand-right-equiv) (equal (int-long-ushiftr operand-left operand-right) (int-long-ushiftr operand-left operand-right-equiv))) :rule-classes :congruence)