Update the |ACL2|::|B| field of a fp-statusbits bit structure.
(!fp-statusbits->b b x) → new-x
Function:
(defun !fp-statusbits->b$inline (b x) (declare (xargs :guard (and (bitp b) (fp-statusbits-p x)))) (mbe :logic (b* ((b (mbe :logic (bfix b) :exec b)) (x (fp-statusbits-fix x))) (part-install b x :width 1 :low 15)) :exec (the (unsigned-byte 16) (logior (the (unsigned-byte 16) (logand (the (unsigned-byte 16) x) (the (signed-byte 17) -32769))) (the (unsigned-byte 16) (ash (the (unsigned-byte 1) b) 15))))))
Theorem:
(defthm fp-statusbits-p-of-!fp-statusbits->b (b* ((new-x (!fp-statusbits->b$inline b x))) (fp-statusbits-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !fp-statusbits->b$inline-of-bfix-b (equal (!fp-statusbits->b$inline (bfix b) x) (!fp-statusbits->b$inline b x)))
Theorem:
(defthm !fp-statusbits->b$inline-bit-equiv-congruence-on-b (implies (bit-equiv b b-equiv) (equal (!fp-statusbits->b$inline b x) (!fp-statusbits->b$inline b-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !fp-statusbits->b$inline-of-fp-statusbits-fix-x (equal (!fp-statusbits->b$inline b (fp-statusbits-fix x)) (!fp-statusbits->b$inline b x)))
Theorem:
(defthm !fp-statusbits->b$inline-fp-statusbits-equiv-congruence-on-x (implies (fp-statusbits-equiv x x-equiv) (equal (!fp-statusbits->b$inline b x) (!fp-statusbits->b$inline b x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !fp-statusbits->b-is-fp-statusbits (equal (!fp-statusbits->b b x) (change-fp-statusbits x :b b)))
Theorem:
(defthm fp-statusbits->b-of-!fp-statusbits->b (b* ((?new-x (!fp-statusbits->b$inline b x))) (equal (fp-statusbits->b new-x) (bfix b))))
Theorem:
(defthm !fp-statusbits->b-equiv-under-mask (b* ((?new-x (!fp-statusbits->b$inline b x))) (fp-statusbits-equiv-under-mask new-x x 32767)))