sbcl.git
12 years agogencgc: Make MAKE-LISP-OBJ of SIMPLE-FUN object addresses work.
Alastair Bridgewater [Wed, 9 Nov 2011 16:48:19 +0000 (11:48 -0500)]
gencgc: Make MAKE-LISP-OBJ of SIMPLE-FUN object addresses work.

  * This turned out to be a bug in the gencgc guts,
looks_like_valid_lisp_pointer_p() was doing pointer arithmetic
when it should have been converting the pointer to an integer.

12 years agofix unthreaded build
Nikodemus Siivola [Thu, 10 Nov 2011 17:09:37 +0000 (19:09 +0200)]
fix unthreaded build

  CONDITION-WAIT on threadless builds now reads TIMEOUT.

  Stray MUTEX/LOCK naming confusion.

  #+sb-thread on more mailbox test.

  #!+sb-thread %WAIT-FOR-MUTEX for cleanliness.

12 years agoSPINLOCK-NAME not deprecated since 1.0.5.x, but 1.0.53.11...
Nikodemus Siivola [Thu, 10 Nov 2011 15:18:22 +0000 (17:18 +0200)]
SPINLOCK-NAME not deprecated since 1.0.5.x, but 1.0.53.11...

12 years agotweak threads.impure.lisp tests
Nikodemus Siivola [Thu, 10 Nov 2011 14:08:55 +0000 (16:08 +0200)]
tweak threads.impure.lisp tests

 * Enable (:CONDITION-WAIT :DEADLINES :LP-512914) outside futex platforms.

 * Mark :BACKTRACE as broken on Darwin after all, still.

12 years agouse RELATIVE-DECODED-TIMES in serve-event
Nikodemus Siivola [Thu, 10 Nov 2011 14:06:19 +0000 (16:06 +0200)]
use RELATIVE-DECODED-TIMES in serve-event

 OAOO, yum.

12 years agounify locks
Nikodemus Siivola [Tue, 23 Aug 2011 12:50:04 +0000 (15:50 +0300)]
unify locks

  Remove spinlocks, make spinlock functions redirect to mutexes
  instead. (Compile-time deprecation style-warning for spinlocks.)

12 years agoAdjust for Solaris /bin/sh.
Jim Wise [Thu, 10 Nov 2011 15:05:43 +0000 (10:05 -0500)]
Adjust for Solaris /bin/sh.

12 years agotimeouts on JOIN-THREAD
Nikodemus Siivola [Thu, 10 Nov 2011 13:05:16 +0000 (15:05 +0200)]
timeouts on JOIN-THREAD

   Marking the return convention experimental for now, as I'm
   not sure if

   ...we should signal a separate condition type for timeouts.

   ...we should have a separate :TIMEOUT-VALUE argument.

   ...if that value should default to value of DEFAULT.

   Pfff. Interfaces are hard -- let's go shopping!

12 years agotimeouts on semaphores and mailboxes, fix timeouts on condition variables
Nikodemus Siivola [Thu, 10 Nov 2011 09:27:15 +0000 (11:27 +0200)]
timeouts on semaphores and mailboxes, fix timeouts on condition variables

  * Accidentally put in the version of condition variable timeouts that just
    looked like a spurious wakeup instead of returning NIL without grabbing
    the mutex. Ooops -- fixed that.

  * The issue with mailbox tests on Darwin at least appears to be related
    to our usage of pthread functions inside signal handlers.

12 years agomake it possible to build only selected contribs
Nikodemus Siivola [Thu, 10 Nov 2011 11:23:51 +0000 (13:23 +0200)]
make it possible to build only selected contribs

  Not for users as such, but for poking at specific contribs with a faster
  turnaround.

12 years agoAt least one of the Tests which hang on Darwin also hang on SunOS.
Jim Wise [Thu, 10 Nov 2011 03:25:19 +0000 (22:25 -0500)]
At least one of the Tests which hang on Darwin also hang on SunOS.

Make (not (or darwin sunos)) for the moment, and I'll tey to narrow this
down tomorrow.

sb-concurrency otherwise builds and tests great with new thread stuff on
Solaris/X86 -- on to ../../tests!

12 years agokilling lutexes, adding timeouts
Nikodemus Siivola [Tue, 16 Aug 2011 19:46:06 +0000 (22:46 +0300)]
killing lutexes, adding timeouts

  * Remove all lutex-specific code from the system.
    ** Use SB-FUTEX for futex-capable platforms, and plain SB-THREAD
       otherwise.
    ** Make non-futex mutexes unfair spinlocks for now, using WAIT-FOR to
       provide timeouts and backoff.
    ** Build non-futex condition variables on top of a queue and WAIT-FOR.

    Performance implications: SB-FUTEX builds should perform pretty much the
    same, or improve a bit. Threaded non-futex builds are affected as follows:

      1. Threads idling on semaphores or condition variables aren't quite as
         cheap. Just how costly depends on the OS. On Darwin 1000 idle threads
         can chew up a bit over 50% CPU. I will try to address this later.

      2. Contested locking around operations that take considerably longer
         than a single timeslice suffers mild degradation.

      3. Contested locking around operations that don't take long is an order
         of magnitude performant.

      4. Highly active semaphores perform much better. (Follows from #3.)

  * GRAB-MUTEX gets timeout support on all platforms.

  * CONDITION-WAIT gets timeout support.

  * Disable a bunch of prone-to-hang thread tests on Darwin.  (All of them
    were already prone to hang prior to this commit.)

  * Enable a bunch tests that now /pass/ on Darwin. \o/ This doesn't mean that
    the threaded Darwin is fully expected to pass all tests yet, but let's say
    it's more likely to do so.

    ...but still not robust enough to enable threads on Darwin by default.

  * GET-MUTEX/GRAB-MUTEX get refactored into two main parts: %TRY-MUTEX and
    %WAIT-ON-MUTEX, which are also used directly from CONDITION-WAIT where
    appropriate.

12 years agoSkip testl fcntl.flock.2 on NetBSD.
Jim Wise [Wed, 9 Nov 2011 18:54:10 +0000 (13:54 -0500)]
Skip testl fcntl.flock.2 on NetBSD.
Not sure what's going on with this one -- getting a return status
of '0' from child process, but don't see a path through code that
will produce this.  Will work on this further.

12 years agoAdjust for NetBSD location of perl.
Jim Wise [Wed, 9 Nov 2011 14:18:02 +0000 (09:18 -0500)]
Adjust for NetBSD location of perl.

NetBSD does not ship with perl by default, but if it's present, it will
be in /usr/pkg/bin.  Would be nice to find another portable way to do this.

12 years agoMAP-DIRECTORY didn't :CLASSIFY-SYMLINKS by default
Nikodemus Siivola [Wed, 9 Nov 2011 11:24:54 +0000 (13:24 +0200)]
MAP-DIRECTORY didn't :CLASSIFY-SYMLINKS by default

  ...even though it said it did.

  Given

    foo/bar => ../src/bar
    src/bar/quux.asd

  now

    (directory "foo/*/*.asd")

  finds the .asd as expected.

12 years agoNetBSD also fails on test based on opening /dev/stdout from a script.
Jim Wise [Tue, 8 Nov 2011 19:48:21 +0000 (14:48 -0500)]
NetBSD also fails on test based on opening /dev/stdout from a script.

Add it to Darwin in platforms which skip this test.

12 years agoCorrect address computation in atomic-incf/aref for wide fixnums
Paul Khuong [Mon, 7 Nov 2011 19:18:38 +0000 (14:18 -0500)]
Correct address computation in atomic-incf/aref for wide fixnums

 Reported by Martin Cracauer.

 Fixes lp#887220.

12 years ago1.0.53: will be tagged as "sbcl-1.0.53"
Juho Snellman [Sun, 6 Nov 2011 20:31:00 +0000 (21:31 +0100)]
1.0.53: will be tagged as "sbcl-1.0.53"

12 years agofix SEARCH vector vector transform
Eric Marsden [Mon, 31 Oct 2011 12:34:39 +0000 (14:34 +0200)]
fix SEARCH vector vector transform

 Didn't handle empty sequences correctly.

 Didn't handle NIL as KEY correctly.

12 years agomake DELETE-FILE respect *DEFAULT-PATHNAME-DEFAULTS*
Nikodemus Siivola [Sun, 30 Oct 2011 19:51:30 +0000 (21:51 +0200)]
make DELETE-FILE respect *DEFAULT-PATHNAME-DEFAULTS*

  MERGE-PATHNAMES to get an absolute pathname. (Using TRUENAME would be wrong,
  since then we would delete files pointed to by symbolic links, and not the
  symbolic links themselves -- a nasty regression that would be!)

  Also remove the "for error checking" TRUENAME call from there: unlink will
  give us an errno that tells what we need to know -- and lo! there is one
  race condition less in the system.

  Previously using relative pathnames it was possible to accidentally delete
  the wrong file.

  Fixes lp#882877.

  NB: currently DELETE-DIRECTORY and RENAME-FILE use TRUENAME with just the
      aforementioned unfortunate consequence, but I'm hesitant to change them
      during the freeze -- so dealing with this issue in them will have to
      wait a bit.

12 years agomissing NEWS for previous commit
Nikodemus Siivola [Sun, 30 Oct 2011 19:51:02 +0000 (21:51 +0200)]
missing NEWS for previous commit

12 years agofix GENCGC DYNAMIC-USAGE on 64-bit platforms
Robert Brown [Sun, 30 Oct 2011 11:44:33 +0000 (13:44 +0200)]
fix GENCGC DYNAMIC-USAGE on 64-bit platforms

  Fixes lp#881445.

12 years agoUnbreak the build on SPARC
Paul Khuong [Sun, 30 Oct 2011 15:34:33 +0000 (11:34 -0400)]
Unbreak the build on SPARC

Broken in b2d132a93 (last commit).  The cross-compiler can be a tad
paranoid.

12 years agoFix constant character comparisons for SPARC/sb-unicode
Paul Khuong [Sun, 30 Oct 2011 06:42:15 +0000 (02:42 -0400)]
Fix constant character comparisons for SPARC/sb-unicode

SPARC only supports (SIGNED-BYTE 13) for literal values.  Only emit
comparison with literal characters up to (CODE-CHAR 4095).

Reported by Eric Marsden on sbcl-devel.

Fixes lp#883519.

12 years agoEliminate an infinite recursion in TYPE-UNION of INTERSECTION types
Paul Khuong [Sun, 30 Oct 2011 06:32:41 +0000 (02:32 -0400)]
Eliminate an infinite recursion in TYPE-UNION of INTERSECTION types

Reported by Eric Marsden on sbcl-devel.

Fixes lp#883498.

12 years agoTake inline trampoline into account when optimizing fall-through jumps
Paul Khuong [Sun, 30 Oct 2011 06:02:03 +0000 (02:02 -0400)]
Take inline trampoline into account when optimizing fall-through jumps

The IR2-level optimisation bug manifests itself as randomly bogus
code in the presence of tail and local calls to the same function.

Reported by Eric Marsden on sbcl-devel.

Test case by Anton Kovalenko.

Fixes lp#883500

12 years agofix ROTATE-BYTE on 64-bit words using constant negative rotation
Nikodemus Siivola [Sat, 29 Oct 2011 18:13:07 +0000 (21:13 +0300)]
fix ROTATE-BYTE on 64-bit words using constant negative rotation

  Fixes lp#882151.

12 years agowaiting for arbitrary events SB-EXT:WAIT-FOR
Nikodemus Siivola [Tue, 16 Aug 2011 16:36:28 +0000 (19:36 +0300)]
waiting for arbitrary events SB-EXT:WAIT-FOR

  While using this to wait for other threads isn't good style,
  sometimes it is _much_ easier to just state the thing you're
  waiting for than build the synchronization to make it nice.

  And sometimes the event lives in the external world, in which case
  you really need to poll anyways:

    (wait-for (probe-file pathname))

12 years agonuke the age-old experimental-thread.patch
Nikodemus Siivola [Tue, 23 Aug 2011 12:31:35 +0000 (15:31 +0300)]
nuke the age-old experimental-thread.patch

  Not pertinent anymore.

12 years agoMinor lowtag-handling cleanup in genesis.
Alastair Bridgewater [Wed, 26 Oct 2011 14:38:15 +0000 (10:38 -0400)]
Minor lowtag-handling cleanup in genesis.

  * Instead of explicitly testing a lowtag against two or four
constants (with scary reader conditionals for making the decision)
to determine if a given lowtag is an other-immediate, introduce a
function, IS-OTHER-IMMEDIATE-LOWTAG, paralleling IS-FIXNUM-LOWTAG,
with commentary, operating along the same lines as a similar
function in runtime.h.

12 years agoroom: KLUDGE-reduction.
Alastair Bridgewater [Tue, 25 Oct 2011 22:43:36 +0000 (18:43 -0400)]
room: KLUDGE-reduction.

  * Now that the thread structure doesn't have a lowtag, we can
remove the KLUDGE that prevented even FIXNUMs from being treated
as though they were thread-object-sized instead of a single word.

12 years agothreads: Thread objects don't need a lowtag.
Alastair Bridgewater [Tue, 25 Oct 2011 22:39:29 +0000 (18:39 -0400)]
threads: Thread objects don't need a lowtag.

  * It was a cute hack, in a way, to force the existing genesis
machinery to produce assembler symbols for thread structure slots.
But it's still a hack, and needs to die.  And now it can.

12 years agogenesis: Export assembly slot offsets for primitive-objects without lowtags.
Alastair Bridgewater [Tue, 25 Oct 2011 22:35:03 +0000 (18:35 -0400)]
genesis: Export assembly slot offsets for primitive-objects without lowtags.

  * If a primitive-object has no lowtag, export its slot offsets
to assembly language as if it had a lowtag of zero.

  * While we're here, use SYMBOL-VALUE instead of EVAL to find the
numeric value of a lowtag.

12 years agoFix MAYBE-WITH-PINNED-OBJECTS for PPC/GENCGC.
Alastair Bridgewater [Tue, 25 Oct 2011 20:43:13 +0000 (16:43 -0400)]
Fix MAYBE-WITH-PINNED-OBJECTS for PPC/GENCGC.

  * GENCGC has working WITH-PINNED-OBJECTS on all targets, not
just x86oids.  Not using it when necessary is bad, especially
since non-x86oids don't automatically pin references from the
control stack.  Fixed.

12 years agoFix unhandled error in float.pure.lisp on non-x86oids.
Alastair Bridgewater [Tue, 25 Oct 2011 14:25:25 +0000 (10:25 -0400)]
Fix unhandled error in float.pure.lisp on non-x86oids.

  * SB-VM::TOUCH-OBJECT doesn't exist on non-x86oids, and the
package is locked.  Disable reading of forms that refer to it
on non-x86oids.

12 years agoFix debug.impure.lisp / BUG-310175 for :stack-allocatable-lists targets.
Alastair Bridgewater [Tue, 25 Oct 2011 14:13:58 +0000 (10:13 -0400)]
Fix debug.impure.lisp / BUG-310175 for :stack-allocatable-lists targets.

  * Not all platforms stack-allocate.  Some platforms (PPC) stack-
allocate some things, but not most things.

  * PPC, in particular, stack allocates for LIST and LIST* (the
:stack-allocatable-lists feature), but doesn't stack allocate for
CONS.  And it turns out that the compiler transforms one-arg-LIST
and two-arg-LIST* to CONS.

  * Use two-arg-LIST to force the :stack-allocatable-lists code
path, and mark the test as failing on non-:stack-allocatable-lists
targets.

12 years agoFix fixnum and unsigned-fixnum array cleanups.
Alastair Bridgewater [Mon, 24 Oct 2011 22:02:50 +0000 (18:02 -0400)]
Fix fixnum and unsigned-fixnum array cleanups.

  * dd04bd449535e9016b5652a708a3cac2ca24c87d removes the specialized
array types with specific fixnum widths in favor of more generic
fixnum and unsigned-fixnum array types.

  * In SYS:SRC;CODE;ROOM.LISP, a mistake was made in converting over
to the newer representations, involving an alist of type tag names
to a constant related to the size of array elements.  The mistake
was even made inconsistently, so that neither 32-bit nor 64-bit
targets behaved correctly.

  * Fixed, to use sb!vm:word-shift instead of literal constants.

  * Original report and bisection by akovalenko on #sbcl.

12 years agoFix FP traps on OSX/x86.
Alastair Bridgewater [Mon, 24 Oct 2011 19:25:11 +0000 (15:25 -0400)]
Fix FP traps on OSX/x86.

  * De-cripple SB-INT:SET-FLOATING-POINT-MODES for this platform.

  * Enable restoring the FPU control word during interrupt handling
on this platform (RESTORE_FP_CONTROL_FROM_CONTEXT).

  * Implement restoring the FPU control word on this platform
(os_restore_fp_control).

  * Update :FAILS-ON information for the now-passing tests.

  * Update the commentary on test float.pure.lisp /
(ADDITION-OVERFLOW BUG-372) to more accurately reflect when it will
provide useful data (only when running float.pure.lisp separately).

12 years agoFix x86oid OSX signal handling emulation assembly fragments.
Alastair Bridgewater [Mon, 24 Oct 2011 18:30:32 +0000 (14:30 -0400)]
Fix x86oid OSX signal handling emulation assembly fragments.

  * Both x86 and x86-64 signal_emulation_wrapper include a small
assembly fragment to simulate "sigreturn" by means of an invalid
instruction trap.  This fragment has to load two different pointers
into specific registers before the trap, but historically just told
the compiler to load them into registers and then moved them into
the correct registers, leading to the possibility of clobbering one
of the values.  Fixed, by informing the compiler to place them into
the correct registers to begin with.

12 years agoFix FP traps on OSX/x86-64.
Alastair Bridgewater [Mon, 24 Oct 2011 02:36:24 +0000 (22:36 -0400)]
Fix FP traps on OSX/x86-64.

  * De-cripple SB-INT:SET-FLOATING-POINT-MODES for this platform.

  * Enable restoring the FPU control word during interrupt handling
on this platform (RESTORE_FP_CONTROL_FROM_CONTEXT).

  * Implement restoring the FPU control word on this platform
(os_restore_fp_control).

  * Update :FAILS-ON information for the now-passing tests.

  * Insert an addtional copy of test float.pure.lisp /
(ADDITION-OVERFLOW BUG-372) to detect failure to restore the FPU
control word in signal handling, with appropriate commentary.

12 years agoFix HEAD ref lookups, and compatibility for non-bash shells.
Jim Wise [Mon, 24 Oct 2011 13:38:25 +0000 (09:38 -0400)]
Fix HEAD ref lookups, and compatibility for non-bash shells.

12 years agoUpdate to work with non-bash versions of expr.
Jim Wise [Mon, 10 Oct 2011 14:17:08 +0000 (10:17 -0400)]
Update to work with non-bash versions of expr.

12 years agoClean up build process for cross-compiled targets.
Alastair Bridgewater [Sat, 22 Oct 2011 21:10:38 +0000 (17:10 -0400)]
Clean up build process for cross-compiled targets.

  * Over time, the process for producing an SBCL build for another
target architecture or OS has become more difficult and less
documented.

  * Move all make.sh argument processing to make-config.sh.

  * Have make-config.sh produce a file, output/build-config,
containing shell commands to set up important build parameters
such as where to find GNUMAKE, what SBCL_XC_HOST is, and so on.

  * Source output/build-config in most of the make*.sh scripts.

  * The practical upshot of all this is that a cross-compile
build is now a matter of alternating between target and host,
calling make-config.sh, make-host-1.sh, make-target-1.sh,
make-host-2.sh, make-target-2.sh, and following up with a
make-target-contrib.sh on the target, and you wind up with a
usable product.  And, as make-config.sh does all of the arg
parsing, you can pass --xc-host= or --dynamic-space-size= or
whatever and it all works out.

12 years agoUnwind-to-frame-and-call-VOP doesn't need static symbols.
Alastair Bridgewater [Thu, 24 Jun 2010 00:24:16 +0000 (20:24 -0400)]
Unwind-to-frame-and-call-VOP doesn't need static symbols.

  * The UNWIND procedure takes as parameters a target block and an
unknown-values start/count pair.  The old implementation was passing
the block, a zero count, and a garbage start.  Pass the function to
call as the start, instead of storing it as a static symbol value as
is done now or reserving an extra stack slot somewhere relative to
the unwind block.

  * Delete the static symbol formerly used for this.

  * This has been done for both x86 and x86-64.

12 years agoFix a long-standing bug in (PRIMITIVE-TYPE [MEMBER type])
Paul Khuong [Sat, 22 Oct 2011 01:38:00 +0000 (21:38 -0400)]
Fix a long-standing bug in (PRIMITIVE-TYPE [MEMBER type])

 A refactoring in 1.0.12.18 resulted in overly-optimistic primitive
 type.

 Reported by Eric Marsden on sbcl-devel.

12 years agoFix another assumption w.r.t fixnum width and n-lowtag-bits
Paul Khuong [Sat, 22 Oct 2011 01:02:17 +0000 (21:02 -0400)]
Fix another assumption w.r.t fixnum width and n-lowtag-bits

 This time in LOGBITP.

 Reported by Eric Marsden on sbcl-devel.

12 years agodescribe: Better description for complex setf-expanders.
Alastair Bridgewater [Fri, 1 Apr 2011 01:02:22 +0000 (21:02 -0400)]
describe: Better description for complex setf-expanders.

  * Rather than simply reporting the documentation string (if any), also
report the lambda-list of the expansion function and the associated
source location.

12 years agosetf: Record the original lambda-list for complex setf-expander functions.
Alastair Bridgewater [Fri, 1 Apr 2011 00:58:14 +0000 (20:58 -0400)]
setf: Record the original lambda-list for complex setf-expander functions.

  * Added an extra parameter to ASSIGN-SETF-MACRO for the lambda-list.

  * In ASSIGN-SETF-MACRO, when working with an EXPANDER (as opposed to
an INVERSE), set the %FUN-LAMBDA-LIST of the EXPANDER to the value
passed as the new parameter.

  * In all call sites for ASSIGN-SETF-MACRO (two uses in DEFSETF, one in
DEFINE-SETF-EXPANDER), pass the new lambda-list parameter appropriately.

12 years agosetf: excise GET-SETF-METHOD and related detritus.
Alastair Bridgewater [Thu, 31 Mar 2011 20:07:19 +0000 (16:07 -0400)]
setf: excise GET-SETF-METHOD and related detritus.

  * GET-SETF-METHOD is the CLtL1 version of GET-SETF-EXPANSION, and is
neither used in SBCL nor exported from any package.  Kill it.

  * Also kill the DEFKNOWN in the compiler for a (different)
GET-SETF-METHOD and GET-SETF-METHOD-MULTIPLE-VALUE (also a CLtL1
function, neither used nor implemented in SBCL).

12 years agosetf: pre-defined setf-expanders should handle multiple value places gracefully.
Alastair Bridgewater [Thu, 31 Mar 2011 20:00:48 +0000 (16:00 -0400)]
setf: pre-defined setf-expanders should handle multiple value places gracefully.

  * The GETF, LOGBITP, LDB and MASK-FIELD setf-expanders all take a
PLACE argument, the setf-expansion for which was being obtained via
GET-SETF-METHOD, which is the CLtL1 version of GET-SETF-EXPANSION, but
throws an error if a PLACE multiple values.  This also pre-dates the
adoption of VALUES places.

  * The most reasonable interpretation of the spec appears to be that
any values after the first are to be ignored upon reading and set to NIL
upon writing.

  * To do so, change each use to SB!XC:GET-SETF-EXPANSION instead of
GET-SETF-METHOD, and bind any symbols in the list of new value locations
to NIL before invoking the setter form.

12 years agosetf: read-modify-write macros should deal with multi-value places gracefully.
Alastair Bridgewater [Thu, 31 Mar 2011 19:33:40 +0000 (15:33 -0400)]
setf: read-modify-write macros should deal with multi-value places gracefully.

  * In PUSH, PUSHNEW, POP, REMF, INCF, DECF and DEFINE-MODIFY-MACRO the
setf-expansion was being obtained via GET-SETF-METHOD, which is the
CLtL1 version of GET-SETF-EXPANSION, but throws an error if a PLACE has
multiple values.  This also pre-dates the adoption of VALUES places.

  * The most reasonable interpretation of the spec appears to be that
any values after the first are to be ignored upon reading and set to NIL
upon writing.

  * To do so, change each use to SB!XC:GET-SETF-EXPANSION instead
of GET-SETF-METHOD, and bind any symbols in the list of new value
locations to NIL before invoking the setter form.

12 years agosetf: Don't use DO to "zip up" temporaries in read-modify-write macros.
Alastair Bridgewater [Thu, 31 Mar 2011 19:28:48 +0000 (15:28 -0400)]
setf: Don't use DO to "zip up" temporaries in read-modify-write macros.

  * Alter POP, REMF and DEFINE-MODIFY-MACRO to use (MAPCAR #'LIST
DUMMIES VALS) when building LET*-bindings instead of some crazy DO loop
involving PUSH and NREVERSE.

  * While we're here, introduce a new temporary in POP rather than
destructively modify a binding.

12 years agoFix build on x86-64/darwin.
Alastair Bridgewater [Fri, 21 Oct 2011 16:06:01 +0000 (12:06 -0400)]
Fix build on x86-64/darwin.

  * It turns out that darwin preprocesses assembly files slightly
differently from every other platform.  Possibly something related
to the rather VMSish -fdollars-in-identifiers option to gcc.

  * Use parens to break the preprocessor "macro" we're trying to
use away from the dollar-sign literal-constant marker it's getting
merged with.

  * Reported by nikodemus in #sbcl.

12 years agoMore unboxed-byte-addresses-are-word-addresses damage.
Alastair Bridgewater [Sun, 9 Oct 2011 21:06:28 +0000 (17:06 -0400)]
More unboxed-byte-addresses-are-word-addresses damage.

  * In the binding stack tests, the binding stack pointer is altered
by adding two to SB-VM::*BINDING-STACK-POINTER*.  This "works" when
n-fixnum-tag-bits is equal to word-shift, but is badly wrong when
they differ.

  * Fixed by adding a variable to hold the actual delta required,
based on the difference between n-fixnum-tag-bits and word-shift.

  * Incidentally, how on earth does this test work on threaded PPC?
PPC has the BSP in a register, not a variable, and there are no
memory barriers around the synchronization for GCs.  How does the
(incf sb-vm::*binding-stack-pointer*) not die from an unbound
symbol?  And, really, it looks like it doesn't matter if a thread
dies or lands in the debugger: If the process doesn't die screaming,
the test always passes, even if it only does a single GC.

  * And, while we're on the topic, how on earth does this test work
on x86?  The memory-barrier argument should apply there as well.
Wait, I know!  The CPU still gets timer interrupts, and the kernel
effectively provides a barrier then.  And the "it doesn't matter"
argument also applies here: If it doesn't deadlock the system
completely, the main thread will kill everything off and call it a
success after four seconds anyway.

12 years ago63-bit fixnums on 64-bit targets.
Alastair Bridgewater [Sun, 14 Feb 2010 15:56:01 +0000 (10:56 -0500)]
63-bit fixnums on 64-bit targets.

  * This is mostly just a matter of spreading the PADn lowtags around,
one or two cases of adjusting a constant, and some KLUDGEing around in
the runtime to make everything work for 1 <= n-fixnum-tag-bits <= 3.

  * Yes, this means that you can change n-fixnum-tag-bits before
building in order to return to a 61-bit fixnum world.  Or you can have
62-bit fixnums if you want.

12 years agoReorder 64-bit lowtags.
Alastair Bridgewater [Mon, 30 Nov 2009 23:09:03 +0000 (18:09 -0500)]
Reorder 64-bit lowtags.

  * Move 64-bit lowtags around so that all non-fixnum tags have the low
bit set.

  * Fix up print_obj() to compensate for the layout change.

  * Fix up is_lisp_pointer() to compensate for the layout change.

  * Change other_immediate_lowtag_p() to take advantage of the
distribution of other-immediate lowtags.

12 years agox86-64 disentwingling of fixnums and words.
Alastair Bridgewater [Wed, 2 Dec 2009 22:18:55 +0000 (17:18 -0500)]
x86-64 disentwingling of fixnums and words.

  * This is mostly constant fixups and supplying scaling factors in
places.

  * Where possible, I have used constructs that will simply generate the
correct code no matter what the width of a fixnum is.  In other places,
I have used an explicit check for the historic case and provided and
alternate code sequence for when it no longer applies.

  * Thanks to Paul Khuong for helping with the finding and fixing of
many of these places.

12 years agoGeneral disentwingling of fixnums and words.
Alastair Bridgewater [Sun, 14 Feb 2010 16:30:50 +0000 (11:30 -0500)]
General disentwingling of fixnums and words.

  * Historically, n-fixnum-tag-bits has been equal to word-shift and has
been (1- n-lowtag-bits).  This led to implementors using constants and
calculations which happened to be right by coincidence rather than by
design.

  * Fix all places not part of the support for a particular backend to
use the defined-correct constants and calculations for the operations
being performed.

  * Thanks to Paul Khuong for helping with the finding and fixing of
many of these coincidences.

12 years agoImprove some test cases for fixnum-width independence
Alastair Bridgewater [Mon, 28 Dec 2009 16:40:24 +0000 (11:40 -0500)]
Improve some test cases for fixnum-width independence

  * In arith.pure.lisp, some test cases were defined in terms of
n-lowtag-bits instead of n-fixnum-tag-bits.

  * In sb-aclrepl, the bignum used for testing fit within an
(signed-byte 63), the largest possible fixnum type on a 64-bit system.

  * Thanks to Paul Khuong for finding and fixing the arith.pure.lisp
tests.

12 years agoFixnum and unsigned-fixnum array cleanups.
Alastair Bridgewater [Sat, 20 Feb 2010 23:43:13 +0000 (18:43 -0500)]
Fixnum and unsigned-fixnum array cleanups.

  * Rename {arraytype}-{elementtype1} to {arraytype}-{elementtype2} for
{arraytype} in (SIMPLE-ARRAY VECTOR), {elementtype1} in
(UNSIGNED-BYTE-29 UNSIGNED-BYTE-60 SIGNED-BYTE-30 SIGNED-BYTE-61) and
{elementtype2} in (UNSIGNED-FIXNUM SIGNED-FIXNUM) across the board
(predicates, tag names, etc.).

  * Cleanup of related conditional compilation.

  * Export n-fixnum-bits (the remaining fixnum representation constant)
from sb!vm instead of having it as an internal symbol of sb!pcl.

  * Original patch by Paul Khuong.

12 years agoChange x86oid modular arithmetic to work if fixnum width changes.
Alastair Bridgewater [Sun, 27 Dec 2009 16:53:45 +0000 (11:53 -0500)]
Change x86oid modular arithmetic to work if fixnum width changes.

  * This is largely (signed-byte {30,61}) => fixnum and smod{30,61} =>
modfx.

  * Thanks to Paul Khuong for the initial patch.

12 years agoFix definition of most-FOOative-fixnum.
Alastair Bridgewater [Sun, 14 Feb 2010 21:29:08 +0000 (16:29 -0500)]
Fix definition of most-FOOative-fixnum.

  * Define in terms of n-positive-fixnum-bits, not some relation between
n-word-bits and n-lowtag-bits.

12 years agoIntroduce sb!vm::fixnum-lowtags
Alastair Bridgewater [Sun, 14 Feb 2010 15:39:18 +0000 (10:39 -0500)]
Introduce sb!vm::fixnum-lowtags

  * This is defined as a list of the exported SB!VM -LOWTAG symbols
bound to integers that are zero when masked with fixnum-tag-mask (in
short, the names of the fixnum lowtags).

  * Replace all direct references to the fixnum lowtags with something
based on fixnum-lowtags.

  * Introduce the corresponding change to genesis, with the predicate
is-fixnum-lowtag instead of testing against specific lowtags.

  * Introduce the corresponding change to the runtime, making fixnump()
check against fixnum-tag-mask instead of comparing individual fixnum
tags.

  * And, while we're redefining fixnump() in terms of the significant
part of the lowtag, do the same with other_immediate_lowtag_p().

12 years agoClean up all use of the *-space-free-pointers.
Alastair Bridgewater [Wed, 23 Dec 2009 13:35:11 +0000 (08:35 -0500)]
Clean up all use of the *-space-free-pointers.

  * These are symbols whose value slots contain unboxed word-aligned
byte pointers.  Thus, they appear to lisp as fixnums.  They are not,
however, guaranteed to be word pointers.

  * Shift by n-fixnum-tag-bits instead of shifting by word-shift or
scaling by n-word-bytes in order to obtain byte pointers.

12 years agoRedefine symbol TLS slot indices.
Alastair Bridgewater [Mon, 28 Dec 2009 21:31:02 +0000 (16:31 -0500)]
Redefine symbol TLS slot indices.

  * Instead of having symbol TLS slots be fixnum indices treat them as
byte offsets from the base of the thread structure.

  * This has no effect on the compiler or backends.

  * TLS slot allocation must now be done in terms of words, not fixnums.

  * In %{set-,}symbol-value-in-thread, use get-lisp-obj-address instead
of scaling the TLS index.

  * Use explicit WORD_SHIFT instead of make_fixnum() / fixnum_value() in
the runtime.

12 years agoImproved GC lossage
Alastair Bridgewater [Sat, 20 Feb 2010 23:40:50 +0000 (18:40 -0500)]
Improved GC lossage

  * Change size_lose() and scav_lose() to indicate the widetag of the
header of the losing object rather than of the pointer to the losing
object.

  * Patch from Paul Khuong.

12 years ago(format t "a~0&b") shouldn't print any newlines.
Stas Boukarev [Tue, 11 Oct 2011 20:20:31 +0000 (00:20 +0400)]
(format t "a~0&b") shouldn't print any newlines.

Fixes lp#867684.

12 years ago1.0.52: will be tagged as "sbcl-1.0.52"
Juho Snellman [Sun, 9 Oct 2011 02:21:04 +0000 (04:21 +0200)]
1.0.52: will be tagged as "sbcl-1.0.52"

12 years agoSleep is apparently still consing on 32-bit platforms, mark test as failing
Juho Snellman [Sun, 9 Oct 2011 01:17:31 +0000 (03:17 +0200)]
Sleep is apparently still consing on 32-bit platforms, mark test as failing

12 years agoRemove the invalid :sleep-many-interrupts test
Juho Snellman [Sun, 9 Oct 2011 01:12:46 +0000 (03:12 +0200)]
Remove the invalid :sleep-many-interrupts test

12 years agoreally fix float rounding on 32-bit platforms
Christophe Rhodes [Fri, 7 Oct 2011 11:39:33 +0000 (12:39 +0100)]
really fix float rounding on 32-bit platforms

Now, as well as not giving completely the wrong answer for most
larger-than-fixnum double floats, we additionally don't try to perform
arithmetic on NIL for larger-than-fixnum single-floats.

12 years agofix run-program misaligned access
Anton Kovalenko [Fri, 30 Sep 2011 10:06:04 +0000 (14:06 +0400)]
fix run-program misaligned access

Thanks to Antoni Grzymala for the report.

12 years agoFix the build on Windows
David Lichteblau [Fri, 30 Sep 2011 08:09:08 +0000 (10:09 +0200)]
Fix the build on Windows

12 years agoIgnore a known failure in script.test.sh on Darwin
David Lichteblau [Thu, 29 Sep 2011 22:40:02 +0000 (00:40 +0200)]
Ignore a known failure in script.test.sh on Darwin

script.test.sh includes a test case that fails on Darwin because of
a bug in SBCL.  However, this is the first release to run this test at
all.  Lacking a proper mechanism to mark the test case as a known
failure on Darwin, skip it entirely on that platform for now.

Thanks to Fare for testing.

12 years agoProbably fix compile on win32 (no sys/mman.h).
Juho Snellman [Thu, 29 Sep 2011 09:06:48 +0000 (11:06 +0200)]
Probably fix compile on win32 (no sys/mman.h).

12 years agoSilence a warning about assignment in conditional
Juho Snellman [Thu, 29 Sep 2011 09:05:06 +0000 (11:05 +0200)]
Silence a warning about assignment in conditional

12 years agoOne missed contrib subdir.
Jim Wise [Fri, 23 Sep 2011 17:54:53 +0000 (13:54 -0400)]
One missed contrib subdir.

12 years agohandle non-standard slot allocations when updating classes
Nikodemus Siivola [Tue, 20 Sep 2011 12:39:18 +0000 (15:39 +0300)]
handle non-standard slot allocations when updating classes

 * Refactor layout comparison to work on the effective slot definition list(s)
   directly -- easier to understand.

 * When new slots with custom allocation are added, add their names to the
   "added" list for UPDATE-INSTANCE-FOR-REDEFINED-CLASS. This is not specified
   by ANSI, but unless we do this those slots don't get initialized.

   Removing custom slots is hairier, as is changing a custom slot into
   a normal slot. Add some tests that poke in this area as well...

 * Replace wrapper-instance-slot-layout and wrapper-class-slots with the
   CLASS-SLOTS lists -- saves space and makes things easier to understand.

   Has a small performance cost for updating instances and SLOT-MISSING. Will
   refactor again if this is critical in the real world.

12 years agocleanup DESCRIBE of symbols naming type specifiers a bit
Christophe Rhodes [Thu, 8 Sep 2011 16:22:53 +0000 (17:22 +0100)]
cleanup DESCRIBE of symbols naming type specifiers a bit

Firstly, don't indent the "... names a type specifier".  But then
wander around in confusion for a while trying to debug where the extra
indentation comes from, before working out that the pprint-newline at
the end of describe-class introduces indentation as well as a newline,
causing the subsequent logical block to be opened at an unexpected
horizontal position.  Fix fix fix.

12 years agoFix (run-program) to cleanup fd handlers
Max Mikhanosha [Sat, 3 Sep 2011 18:38:26 +0000 (14:38 -0400)]
Fix (run-program) to cleanup fd handlers

Signed-off-by: Christophe Rhodes <csr21@cantab.net>

12 years agonews item for float rounding
Christophe Rhodes [Mon, 5 Sep 2011 11:04:50 +0000 (12:04 +0100)]
news item for float rounding

12 years agofix rounding of floats big enough to be bignums
Christophe Rhodes [Sun, 4 Sep 2011 19:27:17 +0000 (20:27 +0100)]
fix rounding of floats big enough to be bignums

Wow, so broken: the attempt to confuse while pretending to do
round-to-even goes back decades to original CMUCL sources.  Rewrite
the bignum branch with a more careful and clear version that is obviously
correct.

Optimizers might want to elide some of the computation on appropriate
platforms: on 32-bit platforms, all single floats outside the fixnum
range are integral, while on 64-bit platforms all single and double floats
outside the fixnum range are integral.  (This could be implemented by
comparing most-fooative-fixnum with fooble-float-significand-byte)

12 years agoremove myself as a provider of official support
Christophe Rhodes [Sun, 4 Sep 2011 18:50:26 +0000 (19:50 +0100)]
remove myself as a provider of official support

12 years agoFix I/O redirection of script.test.sh
David Lichteblau [Fri, 2 Sep 2011 19:30:25 +0000 (21:30 +0200)]
Fix I/O redirection of script.test.sh

With this fix, "run-tests.sh | tee" passes again on Linux.
Thanks to Fare Rideau for the report.

12 years agoBring OPTIMIZATIONS up to date
Paul Khuong [Wed, 31 Aug 2011 13:05:16 +0000 (09:05 -0400)]
Bring OPTIMIZATIONS up to date

 Some of these things were implemented months or a few years ago.

 Also, fix the header for NEWS.

12 years agoMicrooptimization for code size in floating point comparisons on x86-64
Lutz Euler [Tue, 30 Aug 2011 22:41:38 +0000 (18:41 -0400)]
Microoptimization for code size in floating point comparisons on x86-64

This affects EQL on real and complex floats and "=" on floats when at
least one of the two arguments is complex.

Use a 32-bit register as the destination of the MOVMSKP[SD] and the
source of the integer comparison instead of a 64-bit one. This doesn't
change the semantics but makes both instruction's encodings shorter.
If the register is EAX do the comparison on AL as this additionally
shortens the encoding.

Before:

  660F76C1         PCMPEQD XMM0, XMM1
  480F50C0         MOVMSKPS RAX, XMM0
  4883F80F         CMP RAX, 15

After:

  660F76C1         PCMPEQD XMM0, XMM1
  0F50C0           MOVMSKPS EAX, XMM0
  3C0F             CMP AL, 15

12 years agoSmall cleanup to DEFINE-BYTE-BASHERS
Lutz Euler [Tue, 30 Aug 2011 22:40:10 +0000 (18:40 -0400)]
Small cleanup to DEFINE-BYTE-BASHERS

Remove an unneeded SETF of the result of an INCF in a copy loop.
At least on x86[-64] this shortens the generated code in the byte
basher functions by removing a redundant move instruction.

12 years agoMore complete disassembly for XADD and CMPXCHG on x86-64
Paul Khuong [Mon, 29 Aug 2011 05:12:55 +0000 (01:12 -0400)]
More complete disassembly for XADD and CMPXCHG on x86-64

 The new patterns correctly handle REX bytes and operand size override
 bytes (#x66).

12 years agoClean up some SSE instruction format definitions on x86-64
Lutz Euler [Mon, 15 Aug 2011 19:28:03 +0000 (21:28 +0200)]
Clean up some SSE instruction format definitions on x86-64

Remove the instruction formats for some SSE instructions with 8 bit
immediate data, instead make some other formats optionally have an
immediate field.

This makes it necessary to move the default printer definition for
these formats into the SSE shuffle instructions. They were the only
users of these formats that didn't have a printer defined anyway.

12 years agoMore readable disassembler output for SSE shuffle instructions on x86-64
Lutz Euler [Mon, 15 Aug 2011 19:23:28 +0000 (21:23 +0200)]
More readable disassembler output for SSE shuffle instructions on x86-64

Output the immediate byte that contains the shuffle pattern in binary
or quaternary as appropriate with a suitable number of leading zeros.

For the shuffle instructions that use only part of the immediate byte
the assembler asserts that the rest is zero to help catch potential
wrong uses of these instructions.

12 years agoCleanup SSE instruction printers on x86-64
Lutz Euler [Mon, 15 Aug 2011 19:06:46 +0000 (21:06 +0200)]
Cleanup SSE instruction printers on x86-64

Use SSE-INST-PRINTER-LIST in all SSE instruction definitions to reduce
copy and paste programming. Reformat some overly long lines.

12 years agoUpdate the library list on x86/darwin as well when zlib is enabled
Paul Khuong [Sun, 28 Aug 2011 06:56:40 +0000 (02:56 -0400)]
Update the library list on x86/darwin as well when zlib is enabled

12 years agoFix the build on some XCode/OS X version combo by forcing CC=gcc
Paul Khuong [Sun, 28 Aug 2011 03:55:00 +0000 (23:55 -0400)]
Fix the build on some XCode/OS X version combo by forcing CC=gcc

 It was already the case for x86-darwin.

12 years agoOptionally mark pages from cores as de-duplicatable
Paul Khuong [Sun, 28 Aug 2011 03:24:14 +0000 (23:24 -0400)]
Optionally mark pages from cores as de-duplicatable

 Linux supports optimistic virtual-memory-level de-duplication for
 identical pages.  By default, only enable this for compressed cores.
 Runtime options --[no-]merge-core-pages can be used to override the
 default.

 Very much experimental and a hack, but compressed cores would sometimes
 be gratuitously inefficient otherwise.  If/when support is generalized
 to more OSes, figure out how to do this right.

 Thanks to David Lichteblau for the idea.

12 years agoOptional support for zlib-based in-memory deflate/inflate for core files
Paul Khuong [Sun, 28 Aug 2011 03:23:03 +0000 (23:23 -0400)]
Optional support for zlib-based in-memory deflate/inflate for core files

 * As this is based on zlib, only add the dependency when
   :SB-CORE-COMPRESSION is enabled as a build-time feature.  On x86-64,
   compressed cores take about 1/4 the space, but start up in a few
   tenths of a second.

   Unlike gzexe'd executables, compressed images work without writing
   to /tmp.

   If :SB-CORE-COMPRESSION is enabled, trigger compression with the
   :COMPRESSION argument to SAVE-LISP-AND-DIE.

 * Also add a NEWS entry for the literal complex-single-float bugfix

12 years agoAllow use of the --core option with embedded core files
David Lichteblau [Thu, 25 Aug 2011 18:35:34 +0000 (20:35 +0200)]
Allow use of the --core option with embedded core files

Thanks to Anton Kovalenko for implementation suggestions.

12 years agotest for multiply-interrupted sleeps
Nikodemus Siivola [Wed, 24 Aug 2011 12:35:36 +0000 (15:35 +0300)]
test for multiply-interrupted sleeps

  Make sure the time take by the interrupt is tallied
  correctly.

12 years agobe more careful about ,@<constant-atom> and ,.<constant-atom>
Nikodemus Siivola [Wed, 24 Aug 2011 11:52:38 +0000 (14:52 +0300)]
be more careful about ,@<constant-atom> and ,.<constant-atom>

  Specifically, signal a read-time error for those things which COMMA
  special-cases when constructing a splice.

  Fixes lp#770184.

12 years agobetter errors for `(foo ,)
Nikodemus Siivola [Wed, 24 Aug 2011 11:49:09 +0000 (14:49 +0300)]
better errors for `(foo ,)

  Report the trailing comma instead of an unmatched parenthesis.

12 years agoprettier reporting for SIMPLE-READER-ERRORs
Nikodemus Siivola [Wed, 24 Aug 2011 11:33:19 +0000 (14:33 +0300)]
prettier reporting for SIMPLE-READER-ERRORs

  Make the actual error message more prominent,
  and the location information easier to read.

  Also fixes an off-by-one in the location.