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