;;; We don't want to do these DEFCONSTANTs at cross-compilation time,
;;; because the cross-compilation host might not support floating
-;;; point infinities. Putting them inside a LET remove
-;;; top-level-formness, so that any EVAL-WHEN trickiness in the
+;;; point infinities. Putting them inside a LET removes
+;;; toplevel-formness, so that any EVAL-WHEN trickiness in the
;;; DEFCONSTANT forms is suppressed.
(let ()
(defconstant single-float-positive-infinity
(and (zerop (ldb sb!vm:long-float-exponent-byte (long-float-exp-bits x)))
(not (zerop x))))))
-(macrolet ((def-frob (name doc single double #!+(and long-float x86) long)
+(macrolet ((def (name doc single double #!+(and long-float x86) long)
`(defun ,name (x)
,doc
(number-dispatch ((x float))
sb!vm:long-float-normal-exponent-max)
,long)))))))
- (def-frob float-infinity-p
+ (def float-infinity-p
"Return true if the float X is an infinity (+ or -)."
(zerop (ldb sb!vm:single-float-significand-byte bits))
(and (zerop (ldb sb!vm:double-float-significand-byte hi))
(and (zerop (ldb sb!vm:long-float-significand-byte hi))
(zerop lo)))
- (def-frob float-nan-p
+ (def float-nan-p
"Return true if the float X is a NaN (Not a Number)."
(not (zerop (ldb sb!vm:single-float-significand-byte bits)))
(or (not (zerop (ldb sb!vm:double-float-significand-byte hi)))
(or (not (zerop (ldb sb!vm:long-float-significand-byte hi)))
(not (zerop lo))))
- (def-frob float-trapping-nan-p
+ (def float-trapping-nan-p
"Return true if the float X is a trapping NaN (Not a Number)."
(zerop (logand (ldb sb!vm:single-float-significand-byte bits)
sb!vm:single-float-trapping-nan-bit))
(exp (ldb sb!vm:double-float-exponent-byte hi-bits))
(frac (logior (ldb sb!vm:double-float-significand-byte hi-bits)
sb!vm:double-float-hidden-bit))
- (shift (- exp (- sb!vm:double-float-digits sb!vm:word-bits)
+ (shift (- exp (- sb!vm:double-float-digits sb!vm:n-word-bits)
sb!vm:double-float-bias)))
(when (> exp sb!vm:double-float-normal-exponent-max)
(error 'floating-point-invalid-operation :operator 'truncate
:operands (list x)))
- (if (<= shift (- sb!vm:word-bits sb!vm:double-float-digits))
+ (if (<= shift (- sb!vm:n-word-bits sb!vm:double-float-digits))
0
(let* ((res-hi (ash frac shift))
(res (if (plusp shift)
(logior res-hi
(the fixnum
(ash (double-float-low-bits x)
- (- shift sb!vm:word-bits))))
+ (- shift sb!vm:n-word-bits))))
res-hi)))
(declare (type (unsigned-byte 31) res-hi res))
(if (minusp hi-bits)