I've been hacking at the half-finished AMD64 port of SBCL for the past week. There's been quite a lot of progress - originally it was crashing right at the start of cold-init when trying to make a hash table, now it's already crashing right at the end of cold-init while (uhh...) trying to make a hash-table. Getting from point A to point B has involved about 20 bugs, which were generally easy to fix after a few hours of staring at gdb and cross-compiler trace files.

The new hash-table bug might actually be fixed already, but I'll apparently finish writing this blog entry before the build finishes. A full rebuild with trace files and SB-SHOW takes a suprisingly long even on an Athlon 64 2800+... I don't understand how people managed to do SBCL / CMUCL ports with hardware that's orders of magnitude slower.

081514x86-64-again-branch1:
      Float fixes needed for not crashing in MAKE-HASH-TABLE / REHASH /
      %PUTHASH
       rex-prefix byte must come after legacy prefix byte
          (that's why they call it the prefix byte)
       movq is #xf3 #0xf #x7e, not #xf3 #0xf #x73
       make (add|sub|mul|div)(s|d) use (dst src) argument order
          for the sake of consistency
       use scalar (instead of packed) xmm ops in
          %foo-float/signed
       fix comparison vop translations / policy
       cargo-cult handling of vops that overwrite one source
          register
081514x86-64-again-branch2:
      Hashing fixes to pass MAKE-HASH-TABLE / REMHASH / %PUTHASH
       change all arrays of (u-b 32) to (u-b #sb!vm:n-word-bits)
          in defstruct, hash-table and target-hash-table
       change %SXHASH-SUBSTRING to do calculations with 64-bit
          modular arithmetic instead of 32-bit The latter was
          confusing something in the compiler, resulting in negative
          hash values Real bug still exists somewhere Add some
          macros to make %SXHASH-SUBSTRING less ugly, while we're at
          it
081514x86-64-again-branch3:
       Fix &rest arguments (n-word-bytes -> n-lowtag-bits)
       Pad the short jumps in multiple-value receiving callers with
          a nop, so that they're as long as the "mov %rbx,%rsp"
          (This calling convention is sick)
       Use #B8-#BF moves for 64-bit immediates instead of
          SHL and OR (the immediate argument for OR is sign-extended)
081514x86-64-again-branch4:
      Gets all the way to !PPRINT-COLD-INIT (assuming the complex number
      tests in predlisp are commented out, leaving that for later)
       Change more reader conditionals from x86 to (or x86 x86-64)
          and from -alpha +alpha to conditionalization based on
          SB!VM:N-WORD-BITS
       VAR-ALLOC was shifting the length field of the header word
          one bit too far to the left, causing memory corruption on
          bignum operations
       SIGNED-BYTE-32-P / CHECK-SIGNED-BYTE didn't work for negative
          values (required that bits 32-64 were all 0, needs to
          be all 0 or all 1)
       Pass some c-call arguments in registers instead of the
          stack (AMD64 ABI)