* improvement: pretty-printing loop has been implemented properly. (thanks
to Tobias Rittweiler)
* documentation: CLOS slot typechecing policy has been documented.
+ * bug fix: better floating point exception handling on x86/OpenBSD.
+ (thanks to Josh Elsasser)
* bug fix: exit status from QUIT when called under --script was lost
(reported by Hubert Kauker)
* bug fix: MAKE-ARRAY for non-zero :INITIAL-ELEMENT always used the
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/stat.h>
+#include <sys/sysctl.h>
#include <dlfcn.h>
+#ifdef LISP_FEATURE_X86
+#include <machine/cpu.h>
+#endif
static void openbsd_init();
#endif
#endif
#ifdef __OpenBSD__
+
+int openbsd_use_fxsave = 0;
+
void
openbsd_init()
{
+#ifdef LISP_FEATURE_X86
+ int mib[2];
+ size_t size;
+#endif
/*
* Show a warning if it looks like the memory available after
* allocating the spaces won't be at least this much.
#endif
struct rlimit rl;
+#ifdef LISP_FEATURE_X86
+ /* Save the machdep.osfxsr sysctl for use by os_restore_fp_control() */
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_OSFXSR;
+ size = sizeof (openbsd_use_fxsave);
+ sysctl(mib, 2, &openbsd_use_fxsave, &size, NULL, 0);
+#endif
+
/* OpenBSD, like NetBSD, counts mmap()ed space against the
* process's data size limit. If the soft limit is lower than the
* hard limit then try to yank it up, this lets users in the
typedef struct sigcontext os_context_t;
#define SIG_MEMORY_FAULT SIGSEGV
+#if defined(LISP_FEATURE_X86)
+extern int openbsd_use_fxsave;
+#endif
#elif defined __NetBSD__
#include "machine/npx.h"
#endif
+#if defined(LISP_FEATURE_OPENBSD)
+#include <machine/frame.h>
+#include <machine/npx.h>
+#include <stddef.h>
+#endif
+
/* KLUDGE: There is strong family resemblance in the signal context
* stuff in FreeBSD and OpenBSD, but in detail they're different in
* almost every line of code. It would be nice to find some way to
#endif
}
#endif
+
+#if defined(LISP_FEATURE_OPENBSD)
+void
+os_restore_fp_control(os_context_t *context)
+{
+ struct sigframe *frame;
+ union savefpu *fpu;
+
+ frame = (struct sigframe *)((char*)context - offsetof(struct sigframe, sf_sc));
+ fpu = frame->sf_fpstate;
+ if (openbsd_use_fxsave)
+ __asm__ __volatile__ ("fldcw %0" : : "m" (fpu->sv_xmm.sv_env.en_cw));
+ else
+ __asm__ __volatile__ ("fldcw %0" : : "m" (fpu->sv_87.sv_env.en_cw));
+}
+#endif
void os_restore_fp_control(os_context_t *context);
#endif
+#if defined LISP_FEATURE_OPENBSD
+#define RESTORE_FP_CONTROL_FROM_CONTEXT
+void os_restore_fp_control(os_context_t *context);
+#endif
+
#endif /* _X86_BSD_OS_H */
(assert (= 0.0d0 (scale-float 1.0d0 (1- most-negative-fixnum))))
(with-test (:name (:scale-float-overflow :bug-372)
- :fails-on '(or :ppc :darwin (and :x86 :openbsd))) ;; bug 372
+ :fails-on '(or :ppc :darwin)) ;; bug 372
(progn
(assert (raises-error? (scale-float 1.0 most-positive-fixnum)
floating-point-overflow))
(funcall (compile nil '(lambda () (tan (tan (round 0))))))
(with-test (:name (:addition-overflow :bug-372)
- :fails-on '(or :ppc :darwin (and (or :x86 :x86-64)
- (or :netbsd :openbsd))))
+ :fails-on '(or :ppc :darwin (and :x86 :netbsd)))
(assert (typep (nth-value
1
(ignore-errors
(sb-sys:without-interrupts
+ (sb-int:set-floating-point-modes :current-exceptions nil
+ :accrued-exceptions nil)
(loop repeat 2 summing most-positive-double-float)
(sleep 2))))
'floating-point-overflow)))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.28.45"
+"1.0.28.46"