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