From: Alastair Bridgewater Date: Sun, 6 Jun 2010 19:53:44 +0000 (+0000) Subject: 1.0.39.8: Inline-compare more character codes on SB-UNICODE PPC. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=67e68bc0d3127a218829df7478718bfe181e9abe;p=sbcl.git 1.0.39.8: Inline-compare more character codes on SB-UNICODE PPC. * 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 ). * 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. --- diff --git a/src/compiler/ppc/char.lisp b/src/compiler/ppc/char.lisp index af3355f..8a4e063 100644 --- a/src/compiler/ppc/char.lisp +++ b/src/compiler/ppc/char.lisp @@ -119,13 +119,9 @@ (: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) @@ -146,4 +142,3 @@ (define-vop (fast-char>/character/c character-compare/c) (:translate char>) (:variant :gt :le)) -) ;; Not sb-unicode diff --git a/src/compiler/ppc/vm.lisp b/src/compiler/ppc/vm.lisp index 97e8e0a..e31f474 100644 --- a/src/compiler/ppc/vm.lisp +++ b/src/compiler/ppc/vm.lisp @@ -284,6 +284,14 @@ (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))) ;;;; function call parameters diff --git a/version.lisp-expr b/version.lisp-expr index 268032b..40035c5 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"