(mul-spec-64 dst src) → (mv * * *)
Function:
(defun mul-spec-64 (dst src) (declare (type (unsigned-byte 64) dst) (type (unsigned-byte 64) src)) (let ((__function__ 'mul-spec-64)) (declare (ignorable __function__)) (b* ((dst (mbe :logic (n-size 64 dst) :exec dst)) (src (mbe :logic (n-size 64 src) :exec src)) (product (the (unsigned-byte 128) (* dst src))) (product-high (mbe :logic (part-select product :low 64 :width 64) :exec (the (unsigned-byte 64) (ash (the (unsigned-byte 128) product) -64)))) (product-low (mbe :logic (part-select product :low 0 :width 64) :exec (the (unsigned-byte 64) (logand 18446744073709551615 product))))) (mv product-high product-low product))))
Theorem:
(defthm n64-mv-nth-0-mul-spec-64 (unsigned-byte-p 64 (mv-nth 0 (mul-spec-64 dst src))) :rule-classes (:rewrite (:type-prescription :corollary (natp (mv-nth 0 (mul-spec-64 dst src))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (and (<= 0 (mv-nth 0 (mul-spec-64 dst src))) (< (mv-nth 0 (mul-spec-64 dst src)) 18446744073709551616)) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))
Theorem:
(defthm mv-nth-1-mul-spec-64 (unsigned-byte-p 64 (mv-nth 1 (mul-spec-64 dst src))) :rule-classes (:rewrite (:type-prescription :corollary (natp (mv-nth 1 (mul-spec-64 dst src))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (and (<= 0 (mv-nth 1 (mul-spec-64 dst src))) (< (mv-nth 1 (mul-spec-64 dst src)) 18446744073709551616)) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))
Theorem:
(defthm mv-nth-2-mul-spec-64 (unsigned-byte-p 128 (mv-nth 2 (mul-spec-64 dst src))) :rule-classes (:rewrite (:type-prescription :corollary (natp (mv-nth 2 (mul-spec-64 dst src))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (and (<= 0 (mv-nth 2 (mul-spec-64 dst src))) (< (mv-nth 2 (mul-spec-64 dst src)) 340282366920938463463374607431768211456)) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))