Skip to content
Snippets Groups Projects
  1. Dec 30, 2015
    • Raymond Toy's avatar
      WITH-FLOAT-TRAPS-ENABLED was incorrectly setting accrued exceptions. · edb5af9b
      Raymond Toy authored
      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.)
      edb5af9b
    • Raymond Toy's avatar
      Add %SET-FLOATING-POINT-MODES and %GET-FLOATING-POINT-MODES functions. · b4771d76
      Raymond Toy authored
      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.
      b4771d76
  2. Dec 28, 2015
    • Raymond Toy's avatar
      Clean up with-float-traps macro. · 90b9651b
      Raymond Toy authored
       * Add some comments.
       * Change x86 (setf floating-point-modes) to accept (unsigned-byte
         32).
       * Remove unneeded x86 conditionalization on the byte size.
      90b9651b
  3. Dec 26, 2015
    • Raymond Toy's avatar
      Fix bug on sparc and clean up. · 38e8ce5c
      Raymond Toy authored
      On sparc and ppc (setf vm:floating-point-modes) takes an
      (unsigned-byte 32) arg, so adjust the ldb byte appopriately. 
      
      Clean up code by putting the docstring into the macro.
      38e8ce5c
  4. Dec 25, 2015
  5. Dec 24, 2015
  6. Nov 30, 2014
    • Raymond Toy's avatar
      Partially addresses ticket:91 by allowing the test suite to finish. · 70181ee7
      Raymond Toy authored
      The tests still fail (along with others), but the test suite will
      finish.
      
       * code/float-trap.lisp:
         * Update SET-FLOATING-POINT-MODES:
           * When we clear out bits in float-invalid-op-1-byte, clear out the
             float-invalid-op-2-byte.  Not necessary for this fix, but those
             bits signal other invalid operations from sqrt and such.
           * When clearing the exceptions, clear the sticky exceptions
             summary bit too.
         * Fix SIGFPE-HANDLER:
           * As above, clear out the bit in float-invalid-op-2-byte and the
             exceptions summary bit.
           * Only clear out the new exception bits, as done for SSE2.
           * Mask out the float-invalid-op-2-byte and the summary bit before
             setting the new modes.
      
       * compiler/ppc/parms.lisp
         * Define float-exceptions-summary-byte.
      
       * code/exports.lisp:
         * Export FLOAT-INVALID-OP-2-BYTE
      70181ee7
  7. Aug 23, 2014
  8. Aug 22, 2014
    • Raymond Toy's avatar
      On x86/darwin, we want and only need the sse2 mode bits. Darwin · 1626be46
      Raymond Toy authored
      doesn't use x87.
      1626be46
    • Raymond Toy's avatar
      Re-enable the x87 floating-point mode stuff. · 2c4a13af
      Raymond Toy authored
      On 32-bit linux, we can still get FP exceptions using x87 because
      32-bit linux can still use x87 instructions for arithmetic.  Because
      of this, we need to re-enable the support x87 floating-point modes,
      including getting and setting the modes and also extracting the modes
      from a sigcontext.
      
       * src/code/float-trap.lisp:
         * Put back support for getting and setting the x87 FP modes. 
       * src/compiler/x86/float.lisp:
         * Add comment on the layout of the status and control words for
           x87. 
       * src/lisp/Linux-os.c:
         * Put back support for getting the x87 (and sse2) FP modes. Needed
           in the sigfpe-handler in float-trap.lisp.
      
      Some of this needs to be cleaned up because we always require sse2
      now.
      2c4a13af
  9. Apr 29, 2014
  10. May 15, 2013
    • Raymond Toy's avatar
      Wrap exports in eval-when. · ba06f21f
      Raymond Toy authored
       src/compiler/generic/objdef.lisp::
       src/compiler/generic/utils.lisp:;
       src/compiler/generic/vm-macs.lisp::
       src/compiler/sparc/c-callback.lisp::
       src/compiler/sparc/parms.lisp::
      
        When export lost its compile-time effects and became a normal
        function, the exports in many files no longer took affect while
        compiling the file.  This change makes the compile-time effects
        happen as before in selected files. With this change, the sparc port
        can be cross-compiled from x86 again.
      
       src/tools/cross-scripts/cross-x86-sparc.lisp::
        Need to frob CHAR-BYTES, which is needed by BYTE-BASH-COPY. .
      ba06f21f
  11. Feb 02, 2013
  12. Feb 01, 2013
    • Raymond Toy's avatar
      Fix ticket:72 : SIGFPE with no exceptions enabled · 0174bfeb
      Raymond Toy authored
       code/float-trap.lisp::
        * In the default case, check FOP to see if it's defined.  This means
          it's a divide exception.
      
       code/x86-vm.lisp::
        * Also check to see if the offending instruction is a DIV or IDIV,
          which means we got an integer overflow.  Return the appropriate
          values in this case.
      0174bfeb
  13. May 25, 2012
  14. Jan 06, 2012
  15. Nov 04, 2011
  16. Oct 15, 2011
    • Raymond Toy's avatar
      Properly handle a denormal operand exception. This should get rid of · 7b6eb217
      Raymond Toy authored
      the occasional problem about SIGFPE's with no exceptions enabled.
      
      error.lisp:
      o Add floating-point-denormal-operand arithmetic error.
      
      exports.lisp:
      o Export the new arithmetic error type.
      
      float-trap.lisp:
      o Check the denormal trap bit and signal the appropriate error.
      
      release-20c.txt:
      o Update.
      7b6eb217
  17. Sep 25, 2011
  18. Dec 22, 2010
  19. Apr 20, 2010
  20. Apr 19, 2010
  21. Mar 19, 2010
  22. Jul 06, 2009
    • rtoy's avatar
      Fix precision bug. On x87 builds, the precision was set to 64 bits · d22e97ab
      rtoy authored
      instead of 53 bits.  This causes the incorrect result (found by Paul):
      
      (ffloor 1.1605184953130993d26 12622780800d0) ->
      
      9.193841782573768d15
      -8.05306368d8
      
      The correct result should have a remainder of zero.
      
      Force the precision to be 53 bits (double-float).
      d22e97ab
  23. Jan 05, 2009
    • rtoy's avatar
      Fix for handling arithmetic errors with x87. · 9edd3c4b
      rtoy authored
      Use bootstrap-2009-01-1.lisp to bootstrap this change.
      
      code/float-trap.lisp:
      o FLOATING-POINT-MODES for :X87 needs to massage the results into the
        expected format (SSE2 MXCSR order).
      o Update for changed VOP names too.
      
      compiler/x86/float.lisp:
      o Rename the floating-point-modes and set-floating-point-modes VOPS to
        x87-floating-point-modes and set-x87-floating-point-modes.  Change
        the translations accordingly too.
      
      compiler/x86/parms.lisp:
      o The float property bytes have been updated to match the SSE2 MXCSR
        register for both SSE2 and X87 builds because the code assumes SSE2
        format.
      
      lisp/Linux-os.c:
      o Don't OR in the SSE2 modes if we're not running an SSE2 build.
        Doing this can erroneously mask out exceptions because the Lisp code
        didn't set up the sse2 modes.  (This happens if you select the x87
        core on a chip that supports sse2.)
      
      lisp/globals.h:
      o Declare fpu_mode.
      
      lisp/lisp.c:
      o Set fpu_mode to be the mode determined from the core file.  Needed
        in Linux-os.c to process the SSE2 modes correctly with an x87 core
        on a sse2-capable chip.
      9edd3c4b
  24. Nov 12, 2008
  25. Jan 03, 2008
    • cshapiro's avatar
      Switch the FreeBSD port to use the common floating point trap handling · 9495c516
      cshapiro authored
      code.  Rather than introduce a new FreeBSD case to the x86 sigcontext
      member accessor routines, collapse all of the system specific routines
      down to a common set of routines.
      
      * code/debug-int.lisp - Disable some Darwin-specific code to debug
        NULL mcontext pointers.
      
      * code/float-trap.lisp - Remove ancient FreeBSD-specific code for
        handling floating point signals.
      
      * code/macros.lisp, code/sap.lisp, compiler/saptran.lisp - Include the
        SAP-REF-LONG setter by default on the x86.
      
      * code/x86-vm.lisp - Remove operating system specific sigcontext
        definitions and sigcontext accessors.  Define the alien sigcontext
        as a system area pointer.  Replace the sigcontext accessors with
        foreign function calls that mask the complexity of the underlying
        sigcontext member access.
      
      * compiler/x86/float.lisp - Unconditionally define STORE-LONG-FLOAT.
        This function is used by the %SET-SAP-REF-LONG VOP that underlies
        the SAP-REF-LONG setter.
      
      * compiler/x86/sap.lisp - Unconditionally define %SET-SAP-REF-LONG.
        In the case where there is not a distinct LONG-FLOAT type, admit
        DOUBLE-FLOAT values instead.  The x87 automatically widens values
        pushed onto stack.  This mirrors the behavior of the SAP-REF-LONG
        VOP.
      
      * lisp/Darwin-os.c, lisp/Linux-os.c - Define functions to access
        sigcontext members of interest to Lisp.  Delete the sc_reg function
        and replace its uses with os_sigcontext_reg which is more suitably
        typed.
      
      * lisp/FreeBSD-os.c - Define functions to access sigcontext members of
        interest to Lisp.  We need to be careful about the SSE and non-SSE
        cases for retrieving x87 registers from the saved machine state.
        Define a low-level SIGFPE handler to intercept floating point traps
        and restore the cleared status word bits based on the signal code.
        Get rid of sc_reg for the reasons noted above.
      
      * lisp/Darwin-os.h, lisp/FreeBSD-os.h - Declare the restore_fpu
        function and define a specialized RESTORE_FPU macro.  Remove the
        sc_reg prototype.
      
      * lisp/Linux-os.h - Remove the sc_reg prototype.
      
      * lisp/os.h - Add prototypes for the new os_sigcontext functions.
      
      * lisp/x86-lispregs.h - Redefine SC_REG and SC_PC to expand out to the
        new os_sigcontext functions.  Redfine SC_SP to expand out to SC_REG.
        Eliminate all platform-specific defintions of SC_PC and SC_SP.
      9495c516
  26. Nov 14, 2007
    • cshapiro's avatar
      * Change the way the x87 precision control is managed. While in Lisp, · 1440af76
      cshapiro authored
        the precision control will always be set to double precision.  For
        the duration of calls into C, the precision control will be set to
        the ABI default.  On Linux and Darwin this is double extended
        precision.  On all other platforms the precision control is left as
        double precision.  The specious FLOAT-ACCURACY declaration has been
        eliminated.
      
      * Shorten the precision control field to 24-bits by disposing of the
        unexamined high order eight bits of the status word.  This compacts
        the code generated around floating point mode changes and reduces
        consing.
      
      * Eliminate unnecessary uses of FLDENV and FSTENV.  We can substitute a
        use of FSTENV with FSTSW in FLOATING-POINT-MODES.  This reduces the
        number of cycles to access the relevant mode bits by a factor of
        thirty.  We cannot eliminate FLDENV in SET-FLOATING-POINT-MODES, but
        the common case does not require an update to the status word.  A
        fast path has been added to the VOP that improves the execution time
        by at least a factor of fifteen.
      
      * Remove the precision control option to SET-FLOATING-POINT-MODES.  It
        is the responsibility of the compiler to generating code that yields
        correctly rounded results in double and single precision.
      1440af76
  27. Jul 06, 2007
  28. Dec 02, 2006
    • rtoy's avatar
      code/float-trap.lisp: · 896812b8
      rtoy authored
      o Need to clear out the individual invalid operation bits when
        clearing the invalid exception bit.
      
      code/exports.lisp:
      compiler/ppc/parms.lisp:
      o Export FLOAT-INVALID-OP-1-BYTE.  (Needs a better name.)
      896812b8
  29. Nov 16, 2006
    • rtoy's avatar
      code/float-trap.lisp: · 6f968a58
      rtoy authored
      o Pass the modes to GET-FP-OPERANDS
      
      compiler/ppc/float.lisp:
      o If the destination register is the same as one of the source
        registers, an overflow or underflow exception will have replaced the
        source register with the result.  In that case, replace the source
        value with NIL to indicate we don't know.  (We could recompute the
        source from the result, but there would be a round-off error.)
      6f968a58
  30. Nov 14, 2006
    • rtoy's avatar
      Floating-point fixes for ppc. · a94b4291
      rtoy authored
      code/float-trap.lisp:
      o Set FP modes now.
      o Clear out sticky bits in SIGFPE handler
      
      code/ppc-vm.lisp:
      o Add (setf sigcontext-floating-point-modes) to set the FP mode.
      
      compiler/ppc/parms.lisp:
      o Add fields for various invalid operations bits.
      o Fix float-fast-bit
      a94b4291
  31. Nov 09, 2005
  32. Jul 25, 2004
    • pmai's avatar
      This commit adds the remainder of the outstanding PPC/Darwin port merge. · 2ff25623
      pmai authored
      Besides support for Darwin foreign loading, and updates to the ppc-vm
      and bsd-os files, this commit removes unix:unix-errno as a foreign variable
      and replaces it with a function named unix-errno, and a (setf unix-errno).
      This makes both glibc support cleaner, and enables ports like PPC/Darwin
      (and the upcoming win32 port) which have no easy way of accessing errno as
      a foreign variable able to support this functionality at all.
      
      The current implementation of this is rather make-shift, it would likely
      be much cleaner to go the SBCL way and mediate all access to errno via
      defined functions in the C runtime.
      
      As an interim feature, the frobbing of the float-trap-modes is currently
      commented out for Darwin because of ongoing breakage.
      2ff25623
  33. Mar 24, 2004
    • emarsden's avatar
      · e2daaabd
      emarsden authored
       - add ignore declaration
       - fix endpwent alien routine for Solaris
      e2daaabd
  34. Sep 02, 2003
  35. Jun 18, 2003
    • gerd's avatar
      Remove package nicknames USER from COMMON-LISP-USER. Add a new · b4f2c7c7
      gerd authored
      	package COMMON-LISP which LISP uses, so that COMMON-LISP no longer
      	has the non-ANSI nickname LISP.
      
      	To bootstrap, use boot13.lisp as target:bootstrap.lisp with pmai's
      	build scripts, and do a full compile.
      
      	* src/bootfiles/18e/boot13.lisp: Change for all the package
      	changes.
      
      	* src/code/exports.lisp: New package common-lisp,
      	which lisp uses.
      
      	* src/tools/worldload.lisp:
      	* src/tools/setup.lisp: Use cl-user instead of user.
      	Use lisp:: instead of cl::.
      
      	* src/tools/worldcom.lisp:
      	* src/tools/snapshot-update.lisp:
      	* src/tools/pclcom.lisp:
      	* src/tools/mk-lisp:
      	* src/tools/hemcom.lisp:
      	* src/tools/config.lisp:
      	* src/tools/comcom.lisp:
      	* src/tools/clxcom.lisp:
      	* src/tools/clmcom.lisp:
      	* src/pcl/defsys.lisp:
      	* src/motif/lisp/initial.lisp:
      	* src/interface/initial.lisp:
      	* src/hemlock/lispmode.lisp (setup-lisp-mode):
      	Use cl-user instead of user.
      
      	* src/code/save.lisp (assert-user-package):
      	* src/code/print.lisp (%with-standard-io-syntax): Find
      	cl-user package instead of user.
      
      	* src/code/package.lisp (package-locks-init): Add lisp.
      	(package-init): Don't add user nickname to cl-user.
      
      	* src/code/ntrace.lisp (*trace-encapsulate-package-names*):
      	Add common-lisp.
      
      	* src/code/hash.lisp (toplevel):
      	* src/code/hash-new.lisp (toplevel): Use in-package :lisp
      	instead of :common-lisp.
      
      	* src/code/float-trap.lisp (sigfpe-handler): Don't
      	qualify floating-point-inexact with ext:.
      
      	* src/pcl/simple-streams/strategy.lisp (sc):
      	* src/pcl/simple-streams/null.lisp (null-read-char):
      	* src/pcl/simple-streams/internal.lisp (allocate-buffer)
      	(free-buffer):
      	* src/pcl/simple-streams/impl.lisp (%check, %read-line)
      	(%peek-char, %read-byte):
      	* src/pcl/simple-streams/file.lisp (open-file-stream)
      	(device-close):
      	* src/pcl/simple-streams/classes.lisp (simple-stream)
      	(device-close):
      	* src/pcl/macros.lisp (toplevel):
      	* src/pcl/braid.lisp (lisp::sxhash-instance):
      	* src/pcl/env.lisp (toplevel):
      	* src/compiler/generic/objdef.lisp (symbol-hash):
      	* src/code/stream.lisp (read-sequence, write-sequence):
      	* src/code/macros.lisp (defmacro, deftype):
      	* src/code/eval.lisp (interpreted-function):
      	* src/code/defstruct.lisp (defstruct):
      	* src/code/debug.lisp (debug-eval-print): Use lisp:: instead
      	of cl::.
      b4f2c7c7
  36. Apr 14, 2003
Loading