<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>
Raymond Toy pushed to branch rtoy-setexception-inexact
at <a href="https://gitlab.common-lisp.net/cmucl/cmucl">cmucl / cmucl</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/90b9651bf60a59800f76a6e7fede76a4897dfae5">90b9651b</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-27T21:02:14Z</i>
</div>
<pre class='commit-message'>Clean up with-float-traps macro.
* Add some comments.
* Change x86 (setf floating-point-modes) to accept (unsigned-byte
32).
* Remove unneeded x86 conditionalization on the byte size.</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/code/float-trap.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/commit/90b9651bf60a59800f76a6e7fede76a4897dfae5#diff-0'>
<strong>
src/code/float-trap.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/code/float-trap.lisp
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/code/float-trap.lisp
</span><span style="color: #aaaaaa">@@ -104,7 +104,7 @@
</span>
final-mode))
(defun (setf floating-point-modes) (new-mode)
<span style="color: #000000;background-color: #ffdddd">- (declare (type (unsigned-byte 24) new-mode))
</span><span style="color: #000000;background-color: #ddffdd">+ (declare (type (unsigned-byte 32) new-mode))
</span> ;; Set the floating point modes for both X87 and SSE2. This
;; include the rounding control bits.
(let* ((rc (ldb float-rounding-mode new-mode))
<span style="color: #aaaaaa">@@ -117,8 +117,8 @@
</span> ;; is ok and would be the correct setting if we
;; ever support long-floats.
(ash 3 8))))
<span style="color: #000000;background-color: #ffdddd">- (setf (vm::sse2-floating-point-modes) new-mode)
- (setf (vm::x87-floating-point-modes) x87-modes))
</span><span style="color: #000000;background-color: #ddffdd">+ (setf (vm::sse2-floating-point-modes) (ldb (byte 24 0) new-mode))
+ (setf (vm::x87-floating-point-modes) (ldb (byte 24 0) x87-modes)))
</span> new-mode)
)
<span style="color: #aaaaaa">@@ -365,12 +365,12 @@
</span> (error _"SIGFPE with no exceptions currently enabled? (si-code = ~D)"
code)))))))
<span style="color: #000000;background-color: #ffdddd">-;;; WITH-FLOAT-TRAPS-MASKED -- Public
-;;; WITH-FLOAT-TRAPS-ENABLED -- Public
-
-
</span> (macrolet
((with-float-traps (name logical-op docstring)
<span style="color: #000000;background-color: #ddffdd">+ ;; 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.
</span> (let ((macro-name (symbolicate "WITH-FLOAT-TRAPS-" name)))
`(progn
(defmacro ,macro-name (traps &body body)
<span style="color: #aaaaaa">@@ -398,9 +398,7 @@
</span> (unwind-protect
(progn
(setf (floating-point-modes)
<span style="color: #000000;background-color: #ffdddd">- (ldb (byte #+x86 24
- #-x86 32
- 0)
</span><span style="color: #000000;background-color: #ddffdd">+ (ldb (byte 32 0)
</span> (,',logical-op ,orig-modes ,(logand trap-mask exception-mask))))
,@body)
;; Restore the original traps and exceptions.
<span style="color: #aaaaaa">@@ -411,8 +409,8 @@
</span> #+ppc
,invalid-mask
#+mips ,(dpb 0 float-exceptions-byte #xffffffff))))))))))))
<span style="color: #000000;background-color: #ffdddd">- ;; Masked and Enabled only differ whether we AND in the bits or OR
- ;; them.
</span><span style="color: #000000;background-color: #ddffdd">+
+ ;; WITH-FLOAT-TRAPS-MASKED -- Public
</span> (with-float-traps masked logand
_N"Execute BODY with the floating point exceptions listed in TRAPS
masked (disabled). TRAPS should be a list of possible exceptions
<span style="color: #aaaaaa">@@ -421,6 +419,7 @@
</span> accrued exceptions are cleared at the start of the body to support
their testing within, and restored on exit.")
<span style="color: #000000;background-color: #ddffdd">+ ;; WITH-FLOAT-TRAPS-ENABLED -- Public
</span> (with-float-traps enabled logorc2
_N"Execute BODY with the floating point exceptions listed in TRAPS
enabled. TRAPS should be a list of possible exceptions which
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/90b9651bf60a59800f76a6e7fede76a4897dfae5">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.common-lisp.net.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.common-lisp.net/cmucl/cmucl/commit/90b9651bf60a59800f76a6e7fede76a4897dfae5"}}</script>
</p>
</div>
</body>
</html>