Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
39c8b616 by Raymond Toy at 2024-09-01T14:24:21+00:00
Fix 354: Add CI test for executables
- - - - -
c1514a66 by Raymond Toy at 2024-09-01T14:24:22+00:00
Merge branch 'issue-354-add-executable-test-to-ci' into 'master'
Fix 354: Add CI test for executables
See merge request cmucl/cmucl!253
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -98,6 +98,18 @@ linux:test:
script:
- bin/run-unit-tests.sh -l dist/bin/lisp 2>&1 | tee test.log
+linux:exec-test:
+ stage: test
+ tags:
+ - linux
+ needs:
+ - job: linux:build
+ artifacts: true
+ script:
+ # Create an executable and test it by printing the version.
+ - dist/bin/lisp -eval '(save-lisp "saved-lisp-executable" :executable t)'
+ - ./saved-lisp-executable --version
+
linux:cross-test:
stage: test
tags:
@@ -202,6 +214,18 @@ osx:test:
- echo LANG = $LANG
- bin/run-unit-tests.sh -l dist/bin/lisp 2>&1 | tee test.log
+osx:exec-test:
+ stage: test
+ tags:
+ - macos-virtualbox
+ needs:
+ - job: osx:build
+ artifacts: true
+ script:
+ # Create an executable and test it by printing the version.
+ - dist/bin/lisp -eval '(save-lisp "saved-lisp-executable" :executable t)'
+ - ./saved-lisp-executable --version
+
osx:ansi-test:
stage: ansi-test
tags:
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5f6bce019825f201308835…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5f6bce019825f201308835…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-352-new-compression-for-dist at cmucl / cmucl
Commits:
12fb0ea3 by Raymond Toy at 2024-09-01T06:31:51-07:00
Apply review suggestions.
- - - - -
3 changed files:
- bin/make-extra-dist.sh
- bin/make-main-dist.sh
- bin/make-src-dist.sh
Changes:
=====================================
bin/make-extra-dist.sh
=====================================
@@ -1,22 +1,24 @@
#!/bin/sh
usage() {
- echo "make-extra-dist.sh -C option -E ext [-t tar] [-I destdir] [-G group] [-O owner]"
- echo " -h This help"
- echo " -? This help"
- echo " -t tar Tar program to use"
- echo " -C option Tar option for compressing the tarball; required."
- echo " -E ext Extension to use for the tarball. Must be consistent with"
- echo " -C option. Required."
- echo " -I destdir Install directly to given directory instead of creating a tarball"
- echo " -G group Group to use"
- echo " -O owner Owner to use"
- echo ""
- echo "This is generally called by make-dist.sh and not normally invoked by the user"
- echo ""
- echo "Create a tarball of the extra components for cmucl. This includes things like "
- echo "CLX; Hemlock; CLM; contrib library not already included in the main"
- echo "distribution; locale messages."
+ cat <<EOF
+`basename $0` -C option -E ext [-t tar] [-I destdir] [-G group] [-O owner]
+ -h This help
+ -? This help
+ -t tar Tar program to use
+ -C option Tar option for compressing the tarball; required.
+ -E ext Extension to use for the tarball. Must be consistent with
+ -C option. Required.
+ -I destdir Install directly to given directory instead of creating a tarball
+ -G group Group to use
+ -O owner Owner to use
+
+This is generally called by make-dist.sh and not normally invoked by the user
+
+Create a tarball of the extra components for cmucl. This includes things like
+CLX; Hemlock; CLM; contrib library not already included in the main
+distribution; locale messages.
+EOF
exit 1
}
=====================================
bin/make-main-dist.sh
=====================================
@@ -1,25 +1,27 @@
#!/bin/sh
usage() {
- echo "make-main-dist.sh -C option -E ext [-h?] [-t tar][-I destdir] [-G group] [-O owner] [-M mandir]"
- echo " target-directory version arch os"
- echo " -h This help"
- echo " -? This help"
- echo " -t tar Tar program to use"
- echo " -C option Tar option for compressing the tarball; required."
- echo " -E ext Extension to use for the tarball. Must be consistent with"
- echo " -C option. Required."
- echo " -I destdir Install directly to given directory instead of creating a tarball"
- echo " -G group Group to use"
- echo " -O owner Owner to use"
- echo " -M mandir Install manpages in this subdirectory. Default is man/man1"
- echo ""
- echo "This is generally called by make-dist.sh and not normally invoked by the user"
- echo ""
- echo "Create a tarball consisting of the main components needed to distribute"
- echo "a binary installation of cmucl. This includes the C executable and support"
- echo "libraries; the subsystems like Gray streams, and simple streams; external"
- echo "formats; contribs like asdf and defsystem; manpages and READMEs."
+ cat <<EOF
+`basename $0` -C option -E ext [-h?] [-t tar][-I destdir] [-G group] [-O owner] [-M mandir]
+ target-directory version arch os
+ -h This help
+ -? This help
+ -t tar Tar program to use
+ -C option Tar option for compressing the tarball; required.
+ -E ext Extension to use for the tarball. Must be consistent with
+ -C option. Required.
+ -I destdir Install directly to given directory instead of creating a tarball
+ -G group Group to use
+ -O owner Owner to use
+ -M mandir Install manpages in this subdirectory. Default is man/man1
+
+This is generally called by make-dist.sh and not normally invoked by the user
+
+Create a tarball consisting of the main components needed to distribute
+a binary installation of cmucl. This includes the C executable and support
+libraries; the subsystems like Gray streams, and simple streams; external
+formats; contribs like asdf and defsystem; manpages and READMEs."
+EOF
exit 1
}
=====================================
bin/make-src-dist.sh
=====================================
@@ -1,21 +1,26 @@
#!/bin/sh
usage() {
- echo "make-src-dist.sh: -C option -E ext [-h?] [-t gnutar] [-I destdir] [version]"
- echo " -h This help"
- echo " -? This help"
- echo " -t tar Name/path to GNU tar"
- echo " -C option Tar option for compressing the tarball; required."
- echo " -E ext Extension to use for the tarball. Must be consistent with"
- echo " -C option. Required."
- echo " -I destdir Install directly to given directory instead of creating a tarball"
- echo " version The version. Defaults to the current date"
- echo ""
- echo "This is generally called by make-dist.sh and not normally invoked by the user"
- echo ""
- echo "Create a tar ball of the cmucl sources."
+ cat <<EOF
+`basename $0` -C option -E ext [-h?] [-t gnutar] [-I destdir] [version]
+ -h This help
+ -? This help
+ -t tar Name/path to GNU tar
+ -C option Tar option for compressing the tarball; required.
+ -E ext Extension to use for the tarball. Must be consistent with
+ -C option. Required.
+ -I destdir Install directly to given directory instead of creating a tarball
+ version The version. Defaults to the current date
+
+This is generally called by make-dist.sh and not normally invoked by the user
+
+Create a tar ball of the cmucl sources."
+EOF
+ exit 1
}
+GTAR=tar
+
while getopts "C:E:h?t:I:" arg
do
case $arg in
@@ -51,8 +56,8 @@ echo Creating source distribution
GTAR_OPTIONS="--exclude=.git --exclude='*.pot.~*~'"
if [ -z "$INSTALL_DIR" ]; then
# echo " Compressing with $ZIP"
- ${GTAR:-tar} ${GTAR_OPTIONS} ${COMPRESS} -cf cmucl-src-$VERSION.tar.$COMPRESS_EXT bin src tests
+ ${GTAR} ${GTAR_OPTIONS} ${COMPRESS} -cf cmucl-src-$VERSION.tar.$COMPRESS_EXT bin src tests
else
# Install in the specified directory
- ${GTAR:-tar} ${GTAR_OPTIONS} -cf - bin src tests | (cd $INSTALL_DIR; ${GTAR:-tar} xf -)
+ ${GTAR} ${GTAR_OPTIONS} -cf - bin src tests | (cd $INSTALL_DIR; ${GTAR:-tar} xf -)
fi
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/12fb0ea3d2c6e7dfd093fb9…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/12fb0ea3d2c6e7dfd093fb9…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-354-add-executable-test-to-ci at cmucl / cmucl
Commits:
4ae24455 by Raymond Toy at 2024-09-01T06:22:39-07:00
Rename foo to saved-lisp-executable
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -107,8 +107,8 @@ linux:exec-test:
artifacts: true
script:
# Create an executable and test it by printing the version.
- - dist/bin/lisp -eval '(save-lisp "foo" :executable t)'
- - ./foo --version
+ - dist/bin/lisp -eval '(save-lisp "saved-lisp-executable" :executable t)'
+ - ./saved-lisp-executable --version
linux:cross-test:
stage: test
@@ -223,8 +223,8 @@ osx:exec-test:
artifacts: true
script:
# Create an executable and test it by printing the version.
- - dist/bin/lisp -eval '(save-lisp "foo" :executable t)'
- - ./foo --version
+ - dist/bin/lisp -eval '(save-lisp "saved-lisp-executable" :executable t)'
+ - ./saved-lisp-executable --version
osx:ansi-test:
stage: ansi-test
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/4ae24455fcc02021aaf467a…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/4ae24455fcc02021aaf467a…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
4f48c6cb by Raymond Toy at 2024-08-29T07:36:36-07:00
Use os_set_sigcontext_fpu_modes to reset modes
x86-vm.lisp defines `(setf sigcontext-floating-point-modes)` to set
the modes in the sigcontext. Use this in `sigfpe-handler` to reset
trap bit for the exception that was signaled.
However, there's no implementation of `os_set_sigcontext_fpu_modes`,
so implement one in solaris-os.c.
Works somewhat better than before in that we don't resignal the
exception again when we restart. But still have problems with divide
by zero and invalid. And we're left in a weird FP trap state where we
can't read 1d300 anymore---an overflow?
- - - - -
2 changed files:
- src/code/float-trap.lisp
- src/lisp/solaris-os.c
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -481,6 +481,7 @@
(type system-area-pointer scp))
(let* ((modes (sigcontext-floating-point-modes
(alien:sap-alien scp (* unix:sigcontext)))))
+ (format t "Current modes: ~32,'0b~%" modes)
(multiple-value-bind (fop operands)
(let ((sym (find-symbol "GET-FP-OPERANDS" "VM")))
(if (fboundp sym)
@@ -503,6 +504,7 @@
;;
;; Clear out the status for any enabled traps. If we don't
;; then when we return, the exception gets signaled again.
+ #+nil
(let* ((trap-bit (third (assoc code +fpe-code-info-alist+)))
(current-x87-modes (vm::x87-floating-point-modes))
(current-sse2-modes (vm::sse2-floating-point-modes))
@@ -525,7 +527,16 @@
(setf (vm::x87-floating-point-modes) new-x87-modes))
(format t "new x87 modes: ~32,'0b~%" (vm::x87-floating-point-modes))
- (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes)))))))
+ (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes)))
+ (let* ((trap-bit (third (assoc code +fpe-code-info-alist+)))
+ (new-modes
+ (dpb (logandc2 (ldb float-exceptions-byte modes)
+ trap-bit)
+ float-exceptions-byte modes)))
+ (format t "New modes: ~32,'0b~%" new-modes)
+ (setf (sigcontext-floating-point-modes)
+ (alien:sap-alien scp (* unix:sigcontext))
+ new-modes))))))
(macrolet
((with-float-traps (name merge-traps docstring)
=====================================
src/lisp/solaris-os.c
=====================================
@@ -637,6 +637,45 @@ os_sigcontext_fpu_modes(ucontext_t *scp)
return modes;
}
+unsigned int
+os_set_sigcontext_fpu_modes(ucontext_t *scp, uint32_t modes)
+{
+ unsigned short cw, sw;
+ fpregset_t *fpr;
+ unsigned int state;
+
+ fpr = &scp->uc_mcontext.fpregs;
+
+ cw = modes & 0x3f;
+ sw = (modes >> 7) &0x3f;
+
+ DPRINTF(1, (stderr, "modes = 0x%08x\n", modes));
+ DPRINTF(1, (stderr, "cw = 0x%04x\n", cw));
+ DPRINTF(1, (stderr, "sw = 0x%04x\n", sw));
+
+ fpr->fp_reg_set.fpchip_state.state[0] = cw;
+ fpr->fp_reg_set.fpchip_state.state[1] = sw;
+
+#ifdef FEATURE_SSE2
+ /*
+ * Add in the SSE2 part, if we're running the sse2 core.
+ */
+ if (fpu_mode == SSE2) {
+ unsigned long mxcsr = modes & 0xffff;
+
+ DPRINTF(1, (stderr, "SSE2 modes = %08lx\n", mxcsr));
+ fpr->fp_reg_set.fpchip_state.mxcsr = mxcsr;
+
+ modes |= mxcsr;
+ }
+#endif
+
+ modes ^= (0x3f << 7);
+ return modes;
+}
+
+
+
boolean
os_support_sse2()
{
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/4f48c6cb2fb01b3613c16d5…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/4f48c6cb2fb01b3613c16d5…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
a1a6bf10 by Raymond Toy at 2024-08-29T06:18:10-07:00
Ignore errors when setting the modes and more cleanups
When resetting the mode bits ignore any errors that might happen if
some traps are still enabled. Also, only update the exception part of
the mode bits.
Document what FPE_FLTSUB means. Make a note that the fpe code info
alist only contains the relevant info for FP traps that we're
interested in handling.
With this change, an overflow and underflow are signaled as expected
and when we restart, we don't get signaled again. But according to
the debugging prints, we do enter the sigfpe handler twice. Divide by
zero is not handled correctly, though.
More testing needed.
- - - - -
46e1190c by Raymond Toy at 2024-08-29T06:48:03-07:00
Refactor cleanup of handler a bit
Make debugging prints line up neatly. Add vars to hold the new modes
so there's less duplication in debugging prints.
Remove old code about clearing out the traps which we've replaced.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -450,11 +450,15 @@
"Signal code for FP inexact result")
(defconstant +fpe-fltinv+ 7
"Signal code for FP invalid operation")
- ;; Not sure what this means.
+ ;; On FreeBSD (and maybe other OSes), this happens when the x86
+ ;; BOUND instruction detects an index out of bounds. Linux
+ ;; apparently generates a SIGSEGV instead. See
+ ;; https://stackoverflow.com/questions/27051428/what-is-a-fpe-fltsub-subscript…
(defconstant +fpe-fltsub+ 8
"Signal code for subscript out of range")
(defconstant +fpe-fltden+ 9
"Signal code for FP denormalize")
+ ;; We only include the values that FP operations can trap on.
(defconstant +fpe-code-info-alist+
(list (cons +fpe-fltdiv+
(list 'division-by-zero float-divide-by-zero-trap-bit ))
@@ -489,50 +493,39 @@
;; This means we need to restore the fpu state ourselves.
(unwind-protect
(let ((fpe-info (second (assoc code +fpe-code-info-alist+))))
+ (format t "fpe code = ~D~%" code)
(if fpe-info
(error fpe-info
:operation fop
:operands operands)
(error _"SIGFPE code ~D not handled" code)))
;; Cleanup
+ ;;
+ ;; Clear out the status for any enabled traps. If we don't
+ ;; then when we return, the exception gets signaled again.
(let* ((trap-bit (third (assoc code +fpe-code-info-alist+)))
- (new-x87-modes (vm::x87-floating-point-modes))
- (new-sse2-modes (vm::sse2-floating-point-modes)))
+ (current-x87-modes (vm::x87-floating-point-modes))
+ (current-sse2-modes (vm::sse2-floating-point-modes))
+ (new-x87-modes
+ (dpb (logandc2 (ldb float-exceptions-byte current-sse2-modes)
+ trap-bit)
+ float-exceptions-byte current-sse2-modes))
+ (new-sse2-modes
+ (dpb (logandc2 (ldb float-exceptions-byte current-x87-modes)
+ trap-bit)
+ float-exceptions-byte current-x87-modes)))
(format t "Trap bit: ~D~%" trap-bit)
- (format t "Current modes: ~16,'0b~%" (vm::floating-point-modes))
- (format t "Current x87 modes: ~16,'0b~%" new-x87-modes)
- (format t "Current sse2 modes: ~16,'0b~%" new-sse2-modes)
- (format t "Setting sse2 modes to: ~16,'0b~%"
- (logandc2 (ldb float-exceptions-byte new-sse2-modes)
- trap-bit))
- (setf (vm::sse2-floating-point-modes)
- (logandc2 (ldb float-exceptions-byte new-sse2-modes)
- trap-bit))
- (format t "Setting x87 modes to: ~16,'0b~%"
- (logandc2 (ldb float-exceptions-byte new-x87-modes)
- trap-bit))
- (setf (vm::x87-floating-point-modes)
- (logandc2 (ldb float-exceptions-byte new-x87-modes)
- trap-bit))
-
- (format t "new x87 modes: ~16,'0b~%" (vm::x87-floating-point-modes))
- (format t "new sse2 modes: ~16,'0b~%" (vm::sse2-floating-point-modes))
- #+nil
- (progn
- ;; Clear out the status for any enabled traps. With SSE2, if
- ;; the current exception is enabled, the next FP instruction
- ;; will cause the exception to be signaled again. Hence, we
- ;; need to clear out the exceptions that we are handling here.
- (setf (ldb float-exceptions-byte new-modes) new-exceptions)
- ;;#+nil
- (progn
- (format *debug-io* "sigcontext modes: #x~4x (~A)~%"
- modes (decode-floating-point-modes modes))
- (format *debug-io* "current modes: #x~4x (~A)~%"
- (vm:floating-point-modes) (get-floating-point-modes))
- (format *debug-io* "new modes: #x~x (~A)~%"
- new-modes (decode-floating-point-modes new-modes)))
- (setf (vm:floating-point-modes) new-modes)))))))
+ (format t "Current modes: ~32,'0b~%" (vm::floating-point-modes))
+ (format t "Current x87 modes: ~32,'0b~%" current-x87-modes)
+ (format t "Current sse2 modes: ~32,'0b~%" current-sse2-modes)
+ (format t "Setting sse2 modes to: ~32,'0b~%" new-x87-modes)
+ (format t "Setting x87 modes to: ~32,'0b~%" new-sse2-modes)
+ (ignore-errors
+ (setf (vm::sse2-floating-point-modes) new-sse2-modes)
+ (setf (vm::x87-floating-point-modes) new-x87-modes))
+
+ (format t "new x87 modes: ~32,'0b~%" (vm::x87-floating-point-modes))
+ (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes)))))))
(macrolet
((with-float-traps (name merge-traps docstring)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/649d84d625d2d673d63685…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/649d84d625d2d673d63685…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
90296b78 by Raymond Toy at 2024-08-28T14:53:40-07:00
Revert "Fix a reader-conditional and add comments."
This reverts commit 90b41bd331fc3260dee9bf0316b4c4a1fc35449d.
- - - - -
33ea1d99 by Raymond Toy at 2024-08-28T14:54:02-07:00
Revert "For Solaris/x86, just use the sse2 mode bits."
This reverts commit 72af1c16346f042bf8d04e1aa0e9b2bd52276895.
- - - - -
15d7b1df by Raymond Toy at 2024-08-28T14:57:11-07:00
Minor cleanup of sigfpe-handler
Move computation of `traps` farther down in the function since we
don't need `traps` so early.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -92,7 +92,7 @@
(setf (x87-floating-point-modes) x87-modes)))
)
-#+(and sse2 (not (or solaris darwin)))
+#+(and sse2 (not darwin))
(progn
(defun floating-point-modes ()
;; Combine the modes from the FPU and SSE2 units. Since the sse
@@ -126,10 +126,7 @@
new-mode)
)
-;; For Darwin and Solaris/x86, only diddle the SSE2 mode bits. Darwin
-;; doesn't use x87. Not sure about Solaris/x86, but this works better
-;; than mixing the x87 and sse2 mode bits.
-#+(and sse2 (or solaris darwin))
+#+(and sse2 darwin)
(progn
(defun floating-point-modes ()
;; Get just the SSE2 mode bits.
@@ -459,19 +456,12 @@
(defconstant +fpe-fltden+ 9
"Signal code for FP denormalize"))
-;; SIGFPE handler for Solaris/x86. For this OS, the CODE contains the
-;; information about what caused the SIGFPE signal, so use that to
-;; determine the reason for the SIGFPE.
#+(and solaris x86)
(defun sigfpe-handler (signal code scp)
(declare (ignore signal)
(type system-area-pointer scp))
(let* ((modes (sigcontext-floating-point-modes
- (alien:sap-alien scp (* unix:sigcontext))))
- (traps (logand (ldb float-exceptions-byte modes)
- (ldb float-traps-byte modes))))
-
-
+ (alien:sap-alien scp (* unix:sigcontext)))))
(multiple-value-bind (fop operands)
(let ((sym (find-symbol "GET-FP-OPERANDS" "VM")))
(if (fboundp sym)
@@ -511,7 +501,9 @@
(t
(error _"SIGFPE code ~D not handled" code)))
;; Cleanup
- (let* ((new-modes modes)
+ (let* ((traps (logand (ldb float-exceptions-byte modes)
+ (ldb float-traps-byte modes)))
+ (new-modes modes)
(new-exceptions (logandc2 (ldb float-exceptions-byte new-modes)
traps)))
#+sse2
@@ -521,7 +513,7 @@
;; will cause the exception to be signaled again. Hence, we
;; need to clear out the exceptions that we are handling here.
(setf (ldb float-exceptions-byte new-modes) new-exceptions)
- #+nil
+ ;;#+nil
(progn
(format *debug-io* "sigcontext modes: #x~4x (~A)~%"
modes (decode-floating-point-modes modes))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90b41bd331fc3260dee9bf…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90b41bd331fc3260dee9bf…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
6e8d4939 by Raymond Toy at 2024-08-28T07:32:02-07:00
Oops. Change `case` to `cond`
Forgot that `case` works with symbols, not numbers. Use `cond`
instead.
Also enable the debugging print, for now.
- - - - -
72af1c16 by Raymond Toy at 2024-08-28T08:38:53-07:00
For Solaris/x86, just use the sse2 mode bits.
Do the same as darwin and only use the sse2 mode bits when setting and
getting the floating point modes.
This takes care of the case when trying to restart after doing `(*
1d300 1d300)`. This used to signal the overflow again. Now it
doesn't.
- - - - -
90b41bd3 by Raymond Toy at 2024-08-28T08:44:46-07:00
Fix a reader-conditional and add comments.
Also comment out debugging prints.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -92,7 +92,7 @@
(setf (x87-floating-point-modes) x87-modes)))
)
-#+(and sse2 (not darwin))
+#+(and sse2 (not (or solaris darwin)))
(progn
(defun floating-point-modes ()
;; Combine the modes from the FPU and SSE2 units. Since the sse
@@ -126,7 +126,10 @@
new-mode)
)
-#+(and sse2 darwin)
+;; For Darwin and Solaris/x86, only diddle the SSE2 mode bits. Darwin
+;; doesn't use x87. Not sure about Solaris/x86, but this works better
+;; than mixing the x87 and sse2 mode bits.
+#+(and sse2 (or solaris darwin))
(progn
(defun floating-point-modes ()
;; Get just the SSE2 mode bits.
@@ -456,6 +459,9 @@
(defconstant +fpe-fltden+ 9
"Signal code for FP denormalize"))
+;; SIGFPE handler for Solaris/x86. For this OS, the CODE contains the
+;; information about what caused the SIGFPE signal, so use that to
+;; determine the reason for the SIGFPE.
#+(and solaris x86)
(defun sigfpe-handler (signal code scp)
(declare (ignore signal)
@@ -477,28 +483,28 @@
;; from the signal handler so the sigcontext is never restored.
;; This means we need to restore the fpu state ourselves.
(unwind-protect
- (case code
- (+fpe-fltdiv+
+ (cond
+ ((= code +fpe-fltdiv+)
(error 'division-by-zero
:operation fop
:operands operands))
- (+fpe-fltovf+
+ ((= code +fpe-fltovf+)
(error 'floating-point-overflow
:operation fop
:operands operands))
- (+fpe-fltund+
+ ((= code +fpe-fltund+)
(error 'floating-point-underflow
:operation fop
:operands operands))
- (+fpe-fltres+
+ ((= code +fpe-fltres+)
(error 'floating-point-inexact
:operation fop
:operands operands))
- (+fpe-fltinv+
+ ((= code +fpe-fltinv+)
(error 'floating-point-invalid-operation
:operation fop
:operands operands))
- (+fpe-fltden+
+ ((= code +fpe-fltden+)
(error 'floating-point-denormal-operand
:operation fop
:operands operands))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/f5f65ff51a6afb81fd5c97…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/f5f65ff51a6afb81fd5c97…
You're receiving this email because of your account on gitlab.common-lisp.net.