Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
e28e38ce by Raymond Toy at 2015-12-31T14:02:26Z
Add better description of the output of x87-floating-point-modes
- - - - -
1 changed file:
- src/compiler/x86/float.lisp
Changes:
=====================================
src/compiler/x86/float.lisp
=====================================
--- a/src/compiler/x86/float.lisp
+++ b/src/compiler/x86/float.lisp
@@ -2340,6 +2340,13 @@
;;
;; When one of the mask bits (0-5) is set, then that exception is
;; masked so that no exception is generated.
+;;
+;; Returns the control and status words merged into one. The low 16
+;; bits contains the control word with the exception mask bits
+;; inverted to indicate exception enable bits. The high 16 bits
+;; contains the status word, but the top 8 bits of the status word are
+;; cleared, effectively removing the condition code, top-of-stack
+;; bits, and the FPU busy bit.
(define-vop (x87-floating-point-modes)
(:results (res :scs (unsigned-reg)))
(:result-types unsigned-num)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/e28e38cee467fee161d8acba7…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
16ae6709 by Raymond Toy at 2015-12-31T13:08:00Z
Rename %get/%set-floating-point-modes to encode/decode-floating-point-modes.
- - - - -
2 changed files:
- src/code/exports.lisp
- src/code/float-trap.lisp
Changes:
=====================================
src/code/exports.lisp
=====================================
--- a/src/code/exports.lisp
+++ b/src/code/exports.lisp
@@ -1579,10 +1579,10 @@
"DOUBLE-FLOAT-POSITIVE-INFINITY" "LONG-FLOAT-POSITIVE-INFINITY"
"SINGLE-FLOAT-NEGATIVE-INFINITY" "SHORT-FLOAT-NEGATIVE-INFINITY"
"DOUBLE-FLOAT-NEGATIVE-INFINITY" "LONG-FLOAT-NEGATIVE-INFINITY"
- "%GET-FLOATING-POINT-MODES"
"GET-FLOATING-POINT-MODES"
"SET-FLOATING-POINT-MODES"
- "%SET-FLOATING-POINT-MODES"
+ "ENCODE-FLOATING-POINT-MODES"
+ "DECODE-FLOATING-POINT-MODES"
"FLOAT-DENORMALIZED-P" "FLOAT-INFINITY-P"
"FLOAT-NAN-P" "FLOAT-TRAPPING-NAN-P"
"FLOAT-SIGNALING-NAN-P"
=====================================
src/code/float-trap.lisp
=====================================
--- a/src/code/float-trap.lisp
+++ b/src/code/float-trap.lisp
@@ -23,9 +23,9 @@
)
(in-package "EXTENSIONS")
(export '(set-floating-point-modes
- %set-floating-point-modes
get-floating-point-modes
- %get-floating-point-modes
+ decode-floating-point-modes
+ encode-floating-point-modes
with-float-traps-masked
with-float-traps-enabled))
(in-package "VM")
@@ -140,13 +140,13 @@
;;; %SET-FLOATING-POINT-MODES -- Public
;;;
-(defun %set-floating-point-modes (&key (floating-point-modes (floating-point-modes))
+(defun encode-floating-point-modes (&key (floating-point-modes (floating-point-modes))
(traps nil traps-p)
(rounding-mode nil round-p)
(current-exceptions nil current-x-p)
(accrued-exceptions nil accrued-x-p)
(fast-mode nil fast-mode-p))
- "Sets floating-point modes according to the give options and the
+ "Encode the floating-point modes according to the give options and the
specified mode, Floating-Point-Modes. The resulting new mode is
returned. If a keyword is not supplied, then the current value is
preserved. Possible keywords:
@@ -260,13 +260,13 @@
(declare (ignorable traps rounding-mode current-exceptions accrued-exceptions fast-mode))
(setf (floating-point-modes)
- (apply #'%set-floating-point-modes args))
+ (apply #'encode-floating-point-modes args))
(values))
;;; %GET-FLOATING-POINT-MODES -- Public
;;;
-(defun %get-floating-point-modes (modes)
+(defun decode-floating-point-modes (modes)
"This function returns a list representing the state of the floating point
modes given in Modes. The list is in the same format as the keyword arguments to
SET-FLOATING-POINT-MODES."
@@ -295,7 +295,7 @@
(apply #'set-floating-point-modes (get-floating-point-modes))
sets the floating point modes to their current values (and thus is a no-op)."
- (%get-floating-point-modes (floating-point-modes)))
+ (decode-floating-point-modes (floating-point-modes)))
;;; CURRENT-FLOAT-TRAP -- Interface
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/16ae67097d669531ec23c4243…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
edb5af9b by Raymond Toy at 2015-12-29T18:24:24Z
WITH-FLOAT-TRAPS-ENABLED was incorrectly setting accrued exceptions.
Fix issue #14.
WITH-FLOAT-TRAPS-ENABLED was leaving the accrued (and current)
exceptions unchanged, but it should have cleared out any values there
that matched the exceptions to be enabled. Without this, the next x87
operation would signal an exception if an accrued exception matched
an enabled exception. This was the cause of issue #14. (Note that
for x87, the accrued exception is the same as current exception.)
- - - - -
a610d96c by Raymond Toy at 2015-12-30T02:36:39Z
Merge branch 'rtoy-issue-14' into 'master'
WITH-FLOAT-TRAPS-ENABLED was incorrectly setting accrued exceptions.
Fix issue #14.
WITH-FLOAT-TRAPS-ENABLED was leaving the accrued (and current)
exceptions unchanged, but it should have cleared out any values there
that matched the exceptions to be enabled. Without this, the next x87
operation would signal an exception if an accrued exception matched
an enabled exception. This was the cause of issue #14. (Note that
for x87, the accrued exception is the same as current exception.)
See merge request !5
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
=====================================
src/code/float-trap.lisp
=====================================
--- a/src/code/float-trap.lisp
+++ b/src/code/float-trap.lisp
@@ -417,11 +417,14 @@
code)))))))
(macrolet
- ((with-float-traps (name logical-op docstring)
+ ((with-float-traps (name merge-traps docstring)
;; Define macros to enable or disable floating-point
;; exceptions. Masked exceptions and enabled exceptions only
;; differ whether we AND in the bits or OR them, respectively.
- ;; Logical-op is the operation to use.
+ ;; MERGE-TRAPS is the logical operation to merge the traps with
+ ;; the current floating-point mode. Thus, use and MERGE-EXCEPTIONS is the
+ ;; logical operation to merge the exceptions (sticky bits) with
+ ;; the current mode.
(let ((macro-name (symbolicate "WITH-FLOAT-TRAPS-" name)))
`(progn
(defmacro ,macro-name (traps &body body)
@@ -450,7 +453,8 @@
(progn
(setf (floating-point-modes)
(ldb (byte 32 0)
- (,',logical-op ,orig-modes ,(logand trap-mask exception-mask))))
+ (logand (,',merge-traps ,orig-modes ,trap-mask)
+ ,exception-mask)))
,@body)
;; Restore the original traps and exceptions.
(setf (floating-point-modes)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/a65cf4a4c020fa3272ae3507…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
a65cf4a4 by Raymond Toy at 2015-12-29T18:10:00Z
Regenerate due to new functions.
- - - - -
1 changed file:
- src/i18n/locale/cmucl.pot
Changes:
=====================================
src/i18n/locale/cmucl.pot
=====================================
--- a/src/i18n/locale/cmucl.pot
+++ b/src/i18n/locale/cmucl.pot
@@ -4729,6 +4729,45 @@ msgstr ""
#: src/code/float-trap.lisp
msgid ""
+"Sets floating-point modes according to the give options and the\n"
+" specified mode, Floating-Point-Modes. The resulting new mode is\n"
+" returned. If a keyword is not supplied, then the current value is\n"
+" preserved. Possible keywords:\n"
+"\n"
+" :TRAPS\n"
+" A list of the exception conditions that should cause traps. Possible"
+"\n"
+" exceptions are :UNDERFLOW, :OVERFLOW, :INEXACT, :INVALID,\n"
+" :DIVIDE-BY-ZERO, and on the X86 :DENORMALIZED-OPERAND. Initially\n"
+" all traps except :INEXACT are enabled.\n"
+"\n"
+" :ROUNDING-MODE\n"
+" The rounding mode to use when the result is not exact. Possible "
+"values\n"
+" are :NEAREST, :POSITIVE-INFINITY, :NEGATIVE-INFINITY and :ZERO.\n"
+" Initially, the rounding mode is :NEAREST.\n"
+"\n"
+" :CURRENT-EXCEPTIONS\n"
+" :ACCRUED-EXCEPTIONS\n"
+" These arguments allow setting of the exception flags. The main use "
+"is\n"
+" setting the accrued exceptions to NIL to clear them.\n"
+"\n"
+" :FAST-MODE\n"
+" Set the hardware's \"fast mode\" flag, if any. When set, IEEE\n"
+" conformance or debuggability may be impaired. Some machines may not\n"
+" have this feature, in which case the value is always NIL.\n"
+"\n"
+" GET-FLOATING-POINT-MODES may be used to find the floating point modes\n"
+" currently in effect."
+msgstr ""
+
+#: src/code/float-trap.lisp
+msgid "Unknown rounding mode: ~S."
+msgstr ""
+
+#: src/code/float-trap.lisp
+msgid ""
"This function sets options controlling the floating-point hardware. If a\n"
" keyword is not supplied, then the current value is preserved. Possible\n"
" keywords:\n"
@@ -4762,7 +4801,11 @@ msgid ""
msgstr ""
#: src/code/float-trap.lisp
-msgid "Unknown rounding mode: ~S."
+msgid ""
+"This function returns a list representing the state of the floating point\n"
+" modes given in Modes. The list is in the same format as the keyword "
+"arguments to\n"
+" SET-FLOATING-POINT-MODES."
msgstr ""
#: src/code/float-trap.lisp
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/a65cf4a4c020fa3272ae3507c…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
b4771d76 by Raymond Toy at 2015-12-29T16:34:46Z
Add %SET-FLOATING-POINT-MODES and %GET-FLOATING-POINT-MODES functions.
To aid in debugging floating point modes, add two new functions:
o %SET-FLOATING-POINT-MODES is like SET-FLOATING-POINT-MODES but
applies the result to a specified mode value, returning the new mode
value (as an integer). This is useful for investigating different
mode values without modifying the actual hardware mode.
o %GET-FLOATING-POINT-MODES is like GET-FLOATING-POINT-MODES but uses
an integer argument instead of the actual floating-point mode.
Useful when used with %SET-FLOATING-POINT-MODE or on its own.
- - - - -
2 changed files:
- src/code/exports.lisp
- src/code/float-trap.lisp
Changes:
=====================================
src/code/exports.lisp
=====================================
--- a/src/code/exports.lisp
+++ b/src/code/exports.lisp
@@ -1579,7 +1579,10 @@
"DOUBLE-FLOAT-POSITIVE-INFINITY" "LONG-FLOAT-POSITIVE-INFINITY"
"SINGLE-FLOAT-NEGATIVE-INFINITY" "SHORT-FLOAT-NEGATIVE-INFINITY"
"DOUBLE-FLOAT-NEGATIVE-INFINITY" "LONG-FLOAT-NEGATIVE-INFINITY"
- "GET-FLOATING-POINT-MODES" "SET-FLOATING-POINT-MODES"
+ "%GET-FLOATING-POINT-MODES"
+ "GET-FLOATING-POINT-MODES"
+ "SET-FLOATING-POINT-MODES"
+ "%SET-FLOATING-POINT-MODES"
"FLOAT-DENORMALIZED-P" "FLOAT-INFINITY-P"
"FLOAT-NAN-P" "FLOAT-TRAPPING-NAN-P"
"FLOAT-SIGNALING-NAN-P"
=====================================
src/code/float-trap.lisp
=====================================
--- a/src/code/float-trap.lisp
+++ b/src/code/float-trap.lisp
@@ -22,7 +22,10 @@
(export '(current-float-trap floating-point-modes sigfpe-handler))
)
(in-package "EXTENSIONS")
-(export '(set-floating-point-modes get-floating-point-modes
+(export '(set-floating-point-modes
+ %set-floating-point-modes
+ get-floating-point-modes
+ %get-floating-point-modes
with-float-traps-masked
with-float-traps-enabled))
(in-package "VM")
@@ -135,16 +138,18 @@
new-mode)
)
-;;; SET-FLOATING-POINT-MODES -- Public
+;;; %SET-FLOATING-POINT-MODES -- Public
;;;
-(defun set-floating-point-modes (&key (traps nil traps-p)
- (rounding-mode nil round-p)
- (current-exceptions nil current-x-p)
- (accrued-exceptions nil accrued-x-p)
- (fast-mode nil fast-mode-p))
- "This function sets options controlling the floating-point hardware. If a
- keyword is not supplied, then the current value is preserved. Possible
- keywords:
+(defun %set-floating-point-modes (&key (floating-point-modes (floating-point-modes))
+ (traps nil traps-p)
+ (rounding-mode nil round-p)
+ (current-exceptions nil current-x-p)
+ (accrued-exceptions nil accrued-x-p)
+ (fast-mode nil fast-mode-p))
+ "Sets floating-point modes according to the give options and the
+ specified mode, Floating-Point-Modes. The resulting new mode is
+ returned. If a keyword is not supplied, then the current value is
+ preserved. Possible keywords:
:TRAPS
A list of the exception conditions that should cause traps. Possible
@@ -169,7 +174,7 @@
GET-FLOATING-POINT-MODES may be used to find the floating point modes
currently in effect."
- (let ((modes (floating-point-modes)))
+ (let ((modes floating-point-modes))
(when traps-p
(let ((trap-mask-bits (float-trap-mask traps)))
(setf (ldb float-traps-byte modes) trap-mask-bits)
@@ -215,20 +220,56 @@
(setq modes (logior float-fast-bit modes))
(setq modes (logand (lognot float-fast-bit) modes))))
- (setf (floating-point-modes) modes))
-
+ modes))
+
+;;; SET-FLOATING-POINT-MODES -- Public
+;;;
+(defun set-floating-point-modes (&rest args
+ &key traps
+ rounding-mode
+ current-exceptions
+ accrued-exceptions
+ fast-mode)
+ "This function sets options controlling the floating-point hardware. If a
+ keyword is not supplied, then the current value is preserved. Possible
+ keywords:
+
+ :TRAPS
+ A list of the exception conditions that should cause traps. Possible
+ exceptions are :UNDERFLOW, :OVERFLOW, :INEXACT, :INVALID,
+ :DIVIDE-BY-ZERO, and on the X86 :DENORMALIZED-OPERAND. Initially
+ all traps except :INEXACT are enabled.
+
+ :ROUNDING-MODE
+ The rounding mode to use when the result is not exact. Possible values
+ are :NEAREST, :POSITIVE-INFINITY, :NEGATIVE-INFINITY and :ZERO.
+ Initially, the rounding mode is :NEAREST.
+
+ :CURRENT-EXCEPTIONS
+ :ACCRUED-EXCEPTIONS
+ These arguments allow setting of the exception flags. The main use is
+ setting the accrued exceptions to NIL to clear them.
+
+ :FAST-MODE
+ Set the hardware's \"fast mode\" flag, if any. When set, IEEE
+ conformance or debuggability may be impaired. Some machines may not
+ have this feature, in which case the value is always NIL.
+
+ GET-FLOATING-POINT-MODES may be used to find the floating point modes
+ currently in effect."
+ (declare (ignorable traps rounding-mode current-exceptions accrued-exceptions fast-mode))
+
+ (setf (floating-point-modes)
+ (apply #'%set-floating-point-modes args))
(values))
-;;; GET-FLOATING-POINT-MODES -- Public
+;;; %GET-FLOATING-POINT-MODES -- Public
;;;
-(defun get-floating-point-modes ()
+(defun %get-floating-point-modes (modes)
"This function returns a list representing the state of the floating point
- modes. The list is in the same format as the keyword arguments to
- SET-FLOATING-POINT-MODES, i.e.
- (apply #'set-floating-point-modes (get-floating-point-modes))
-
- sets the floating point modes to their current values (and thus is a no-op)."
+ modes given in Modes. The list is in the same format as the keyword arguments to
+ SET-FLOATING-POINT-MODES."
(flet ((exc-keys (bits)
(macrolet ((frob ()
`(collect ((res))
@@ -238,13 +279,23 @@
float-trap-alist)
(res))))
(frob))))
- (let ((modes (floating-point-modes)))
- `(:traps ,(exc-keys (ldb float-traps-byte modes))
- :rounding-mode ,(car (rassoc (ldb float-rounding-mode modes)
- rounding-mode-alist))
- :current-exceptions ,(exc-keys (ldb float-exceptions-byte modes))
- :accrued-exceptions ,(exc-keys (ldb float-sticky-bits modes))
- :fast-mode ,(logtest float-fast-bit modes)))))
+ `(:traps ,(exc-keys (ldb float-traps-byte modes))
+ :rounding-mode ,(car (rassoc (ldb float-rounding-mode modes)
+ rounding-mode-alist))
+ :current-exceptions ,(exc-keys (ldb float-exceptions-byte modes))
+ :accrued-exceptions ,(exc-keys (ldb float-sticky-bits modes))
+ :fast-mode ,(logtest float-fast-bit modes))))
+
+;;; GET-FLOATING-POINT-MODES -- Public
+;;;
+(defun get-floating-point-modes ()
+ "This function returns a list representing the state of the floating point
+ modes. The list is in the same format as the keyword arguments to
+ SET-FLOATING-POINT-MODES, i.e.
+ (apply #'set-floating-point-modes (get-floating-point-modes))
+
+ sets the floating point modes to their current values (and thus is a no-op)."
+ (%get-floating-point-modes (floating-point-modes)))
;;; CURRENT-FLOAT-TRAP -- Interface
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/b4771d761fc122a33e39dfd55…
Raymond Toy pushed to branch rtoy-setexception-inexact at cmucl / cmucl
Commits:
fc1c9daa by Raymond Toy at 2015-12-28T10:31:55Z
Replace with-inexact-exception-enabled with with-float-traps-enabled.
- - - - -
1 changed file:
- tests/fdlibm.lisp
Changes:
=====================================
tests/fdlibm.lisp
=====================================
--- a/tests/fdlibm.lisp
+++ b/tests/fdlibm.lisp
@@ -14,11 +14,6 @@
(kernel:make-double-float #x7ff00000 1)
"A randon signaling MaN value")
-(defmacro with-inexact-exception-enabled (&body body)
- `(ext:with-float-traps-enabled (:inexact)
- ,@body))
-
-
(define-test %cosh.exceptions
(:tag :fdlibm)
(assert-error 'floating-point-overflow
@@ -68,11 +63,11 @@
;; sinh(x) = x for |x| < 2^-28. Should signal inexact unless x = 0.
(let ((x (scale-float 1d0 -29))
(x0 0d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 0d0 (kernel:%sinh x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -87,7 +82,7 @@
(assert-true (ext:float-nan-p (kernel:%tanh *snan*))))
;; tanh(x) = +/- 1 for |x| > 22, raising inexact, always.
(let ((x 22.1d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -123,11 +118,11 @@
(assert-true (ext:float-nan-p (kernel:%asinh *snan*))))
(let ((x (scale-float 1d0 -29))
(x0 0d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 0d0 (asinh x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -169,7 +164,7 @@
(assert-true (ext::float-nan-p (kernel:%expm1 *snan*))))
;; expm1(x) = -1 for x < -56*log(2), signaling inexact
(let ((x (* -57 (log 2d0))))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
(assert-error 'floating-point-inexact
(kernel:%expm1 x)))))
@@ -188,11 +183,11 @@
;; log1p(x) = x for |x| < 2^-54, signaling inexact except for x = 0.
(let ((x (scale-float 1d0 -55))
(x0 0d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 0d0 (kernel:%log1p x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -222,11 +217,11 @@
(let ((x (scale-float 1d0 -29))
(x0 0d0))
;; exp(x) = x, |x| < 2^-28, with inexact exception unlees x = 0
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 1d0 (kernel:%exp x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -282,11 +277,11 @@
;; atan(x) = x for |x| < 2^-29, signaling inexact.
(let ((x (scale-float 1d0 -30))
(x0 0d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 0d0 (kernel:%atan x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -630,11 +625,11 @@
;; asin(x) = x for |x| < 2^-27, with inexact exception if x is not 0.
(assert-eql x (kernel:%asin x))
(assert-eql (- x) (kernel:%asin (- x)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 0d0 (kernel:%asin x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -645,11 +640,11 @@
;; cos(x) = 1 for |x| < 2^-27. Signal inexact unless x = 0
(let ((x (scale-float 1d0 -28))
(x0 0d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 1d0 (kernel:%cos x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -660,11 +655,11 @@
;; sin(x) = x for |x| < 2^-27. Signal inexact unless x = 0
(let ((x (scale-float 1d0 -28))
(x0 0d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 0d0 (kernel:%sin x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
@@ -675,11 +670,11 @@
;; tan(x) = x for |x| < 2^-28. Signal inexact unless x = 0
(let ((x (scale-float 1d0 -29))
(x0 0d0))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must not throw an inexact exception because the result
;; is exact when the arg is 0.
(assert-eql 0d0 (kernel:%tan x0)))
- (with-inexact-exception-enabled
+ (ext:with-float-traps-enabled (:inexact)
;; This must throw an inexact exception for non-zero x even
;; though the result is exactly x.
(assert-error 'floating-point-inexact
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/fc1c9daa7fa37857e699bdc8c…
Raymond Toy pushed to branch rtoy-setexception-inexact at cmucl / cmucl
Commits:
6a6908fb by Raymond Toy at 2015-12-28T10:28:57Z
Remove trailing blank line.
- - - - -
1 changed file:
- tests/fdlibm.lisp
Changes:
=====================================
tests/fdlibm.lisp
=====================================
--- a/tests/fdlibm.lisp
+++ b/tests/fdlibm.lisp
@@ -684,4 +684,3 @@
;; though the result is exactly x.
(assert-error 'floating-point-inexact
(kernel:%tan x)))))
-
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/6a6908fbbfbd80918202d1755…