Optimized implementation of 64-bit signed saturation.
(signed-saturate64 x) → *
Function:
(defun signed-saturate64$inline (x) (declare (xargs :guard (integerp x))) (let ((__function__ 'signed-saturate64)) (declare (ignorable __function__)) (mbe :logic (signed-saturate-fn 64 x) :exec (cond ((>= x 9223372036854775807) 9223372036854775807) ((<= x -9223372036854775808) 9223372036854775808) (t (the (unsigned-byte 64) (logand (the (signed-byte 64) x) 18446744073709551615)))))))