(imul-spec-8 dst src) → (mv * * * *)
Function:
(defun imul-spec-8 (dst src) (declare (type (unsigned-byte 8) dst) (type (unsigned-byte 8) src)) (let ((__function__ 'imul-spec-8)) (declare (ignorable __function__)) (b* ((dst-int (the (signed-byte 8) (ntoi 8 dst))) (src-int (the (signed-byte 8) (ntoi 8 src))) (product-int (the (signed-byte 16) (* (the (signed-byte 8) dst-int) (the (signed-byte 8) src-int)))) (product (the (unsigned-byte 16) (n-size 16 product-int))) (product-high (mbe :logic (part-select product :low 8 :width 8) :exec (the (unsigned-byte 8) (ash (the (unsigned-byte 16) product) -8)))) (product-low (mbe :logic (part-select product :low 0 :width 8) :exec (the (unsigned-byte 8) (logand 255 product)))) (product-low-int (the (signed-byte 8) (ntoi 8 product-low))) (cf-and-of (the (unsigned-byte 1) (bool->bit (not (equal (the (signed-byte 8) product-low-int) (the (signed-byte 16) product-int))))))) (mv product-high product-low product cf-and-of))))
Theorem:
(defthm n08-mv-nth-0-imul-spec-8 (unsigned-byte-p 8 (mv-nth 0 (imul-spec-8 dst src))) :rule-classes (:rewrite (:type-prescription :corollary (natp (mv-nth 0 (imul-spec-8 dst src))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (and (<= 0 (mv-nth 0 (imul-spec-8 dst src))) (< (mv-nth 0 (imul-spec-8 dst src)) 256)) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))
Theorem:
(defthm mv-nth-1-imul-spec-8 (unsigned-byte-p 8 (mv-nth 1 (imul-spec-8 dst src))) :rule-classes (:rewrite (:type-prescription :corollary (natp (mv-nth 1 (imul-spec-8 dst src))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (and (<= 0 (mv-nth 1 (imul-spec-8 dst src))) (< (mv-nth 1 (imul-spec-8 dst src)) 256)) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))
Theorem:
(defthm mv-nth-2-imul-spec-8 (unsigned-byte-p 16 (mv-nth 2 (imul-spec-8 dst src))) :rule-classes (:rewrite (:type-prescription :corollary (natp (mv-nth 2 (imul-spec-8 dst src))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (and (<= 0 (mv-nth 2 (imul-spec-8 dst src))) (< (mv-nth 2 (imul-spec-8 dst src)) 65536)) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))
Theorem:
(defthm mv-nth-3-imul-spec-8 (unsigned-byte-p 1 (mv-nth 3 (imul-spec-8 dst src))) :rule-classes (:rewrite (:type-prescription :corollary (natp (mv-nth 3 (imul-spec-8 dst src))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (and (<= 0 (mv-nth 3 (imul-spec-8 dst src))) (< (mv-nth 3 (imul-spec-8 dst src)) 2)) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))