Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
5abd66f6
Commit
5abd66f6
authored
10 years ago
by
Raymond Toy
Browse files
Options
Downloads
Patches
Plain Diff
Don't merge the x87 FP modes with the SSE2 modes when getting and
setting the floating-point mode bits.
parent
87aed560
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/code/float-trap.lisp
+5
-50
5 additions, 50 deletions
src/code/float-trap.lisp
with
5 additions
and
50 deletions
src/code/float-trap.lisp
+
5
−
50
View file @
5abd66f6
...
...
@@ -64,62 +64,17 @@
(
defun
(
setf
floating-point-modes
)
(
new
)
(
setf
(
floating-point-modes
)
new
))
)
#+
(
and
x86
(
not
sse2
))
(
progn
(
defun
floating-point-modes
()
(
let
((
x87-modes
(
vm::x87-floating-point-modes
)))
;; Massage the bits from x87-floating-point-modes into the order
;; that the rest of the system wants them to be. (Must match
;; format in the SSE2 mxcsr register.)
(
logior
(
ash
(
logand
#x3f
x87-modes
)
7
)
; control
(
logand
#x3f
(
ash
x87-modes
-16
)))))
(
defun
(
setf
floating-point-modes
)
(
new
)
(
let*
((
rc
(
ldb
float-rounding-mode
new
))
(
x87-modes
(
logior
(
ash
(
logand
#x3f
new
)
16
)
(
ash
rc
10
)
(
logand
#x3f
(
ash
new
-7
))
;; Set precision control to be 53-bit, always.
;; (The compiler takes care of handling
;; single-float precision, and we don't support
;; long-floats.)
(
ash
2
8
))))
(
setf
(
x87-floating-point-modes
)
x87-modes
)))
)
#+
sse2
(
progn
(
defun
floating-point-modes
()
;; Combine the modes from the FPU and SSE2 units. Since the sse
;; mode contains all of the common information we want, we massage
;; the x87-modes to match, and then OR the x87 and sse2 modes
;; together. Note: We ignore the rounding control bits from the
;; FPU and only use the SSE2 rounding control bits.
(
let*
((
x87-modes
(
vm::x87-floating-point-modes
))
(
sse-modes
(
vm::sse2-floating-point-modes
))
(
final-mode
(
logior
sse-modes
(
ash
(
logand
#x3f
x87-modes
)
7
)
; control
(
logand
#x3f
(
ash
x87-modes
-16
)))))
final-mode
))
;; Get just the SSE2 mode bits.
(
vm::sse2-floating-point-modes
))
(
defun
(
setf
floating-point-modes
)
(
new-mode
)
(
declare
(
type
(
unsigned-byte
24
)
new-mode
))
;; Set the floating point modes for both X87 and SSE2. This
;; include the rounding control bits.
(
let*
((
rc
(
ldb
float-rounding-mode
new-mode
))
(
x87-modes
(
logior
(
ash
(
logand
#x3f
new-mode
)
16
)
(
ash
rc
10
)
(
logand
#x3f
(
ash
new-mode
-7
))
;; Set precision control to be 64-bit, always. We
;; don't use the x87 registers with sse2, so this
;; is ok and would be the correct setting if we
;; ever support long-floats.
(
ash
3
8
))))
(
setf
(
vm::sse2-floating-point-modes
)
new-mode
)
(
setf
(
vm::x87-floating-point-modes
)
x87-modes
))
;; Set the floating point modes for SSE2.
(
setf
(
vm::sse2-floating-point-modes
)
new-mode
)
new-mode
)
)
)
;;; SET-FLOATING-POINT-MODES -- Public
;;;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment