1.0.39.8: Inline-compare more character codes on SB-UNICODE PPC.
authorAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sun, 6 Jun 2010 19:53:44 +0000 (19:53 +0000)
committerAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sun, 6 Jun 2010 19:53:44 +0000 (19:53 +0000)
  * In 1.0.38.5, I disabled the -c character compare VOPs on SB-UNICODE
because the instruction used (cmplwi) was limited to a 16-bit constant.

  * Added a predicate to determine if a character can safely be used in
the -c character compare VOPs.

  * Changed the required constant type on the -c character compare VOPs
from CHARACTER to (SATISFIES <the-new-predicate>).

  * Back in the commit comment for 1.0.38.5 I said that there was no
good way to conditionally use the VOPs.  Looks like I was wrong, unless
you want to argue that SATISFIES types are bad.

src/compiler/ppc/char.lisp
src/compiler/ppc/vm.lisp
version.lisp-expr

index af3355f..8a4e063 100644 (file)
   (:translate char>)
   (:variant :gt :le))
 
-#!-sb-unicode (progn
-;; We can't use these when unicode is enabled because cmplwi has
-;; an immediate field far smaller than the width of some unicode
-;; code points.  -- AB, 2010-Apr-24.
 (define-vop (character-compare/c)
   (:args (x :scs (character-reg)))
-  (:arg-types character (:constant character))
+  (:arg-types character (:constant (satisfies inlinable-character-constant-p)))
   (:conditional)
   (:info target not-p y)
   (:policy :fast-safe)
 (define-vop (fast-char>/character/c character-compare/c)
   (:translate char>)
   (:variant :gt :le))
-) ;; Not sb-unicode
index 97e8e0a..e31f474 100644 (file)
      (if (static-symbol-p value)
          (sc-number-or-lose 'immediate)
          nil))))
+
+;;; A predicate to see if a character can be used as an inline
+;;; constant (the immediate field in the instruction used is sixteen
+;;; bits wide, which is not the same as any defined subtype of
+;;; CHARACTER).
+(defun inlinable-character-constant-p (char)
+  (and (characterp char)
+       (< (char-code char) #x10000)))
 \f
 ;;;; function call parameters
 
index 268032b..40035c5 100644 (file)
@@ -17,4 +17,4 @@
 ;;; 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.39.7"
+"1.0.39.8"