From 2f796d4527e80a3023a12f7291ef1b637b68d988 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 20 Sep 2012 16:10:55 +0100 Subject: [PATCH] slightly more reproducible builds in vop templates, (:constant ) eventually boiled down to a TYPEP test. For (:constant fixnum) in the cross-compiler, this is not right, because the typep test runs on the host. Use SB!XC:TYPEP instead, which means making sure that types are available to the cross-compiler (using DEF!TYPE instead of DEFTYPE). Tested on x86-64; one issue on ppc fixed blindly. --- src/code/cross-type.lisp | 2 +- src/compiler/meta-vmdef.lisp | 2 +- src/compiler/ppc/char.lisp | 12 +++++++++++- src/compiler/x86-64/array.lisp | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/code/cross-type.lisp b/src/code/cross-type.lisp index e431dbb..1ffb2c2 100644 --- a/src/code/cross-type.lisp +++ b/src/code/cross-type.lisp @@ -248,7 +248,7 @@ (if (stringp host-object) (warn-and-give-up) (values nil t))) - ((target-type-is-in '(character base-char)) + ((target-type-is-in '(character base-char standard-char)) (cond ((typep host-object 'standard-char) (values t t)) ((not (characterp host-object)) diff --git a/src/compiler/meta-vmdef.lisp b/src/compiler/meta-vmdef.lisp index d59da64..1242e96 100644 --- a/src/compiler/meta-vmdef.lisp +++ b/src/compiler/meta-vmdef.lisp @@ -1415,7 +1415,7 @@ (rest type)))) (:constant ``(:constant ,#'(lambda (x) - (typep x ',(second type))) + (sb!xc:typep x ',(second type))) ,',(second type))))))) (defun specify-operand-types (types ops more-ops) diff --git a/src/compiler/ppc/char.lisp b/src/compiler/ppc/char.lisp index 8a4e063..a7400ab 100644 --- a/src/compiler/ppc/char.lisp +++ b/src/compiler/ppc/char.lisp @@ -121,7 +121,17 @@ (define-vop (character-compare/c) (:args (x :scs (character-reg))) - (:arg-types character (:constant (satisfies inlinable-character-constant-p))) + (:arg-types character + ;; KLUDGE: having a SATISFIES type here is too hairy for + ;; the cross-compiler (running on an arbitrary CL host) + ;; to cope with. Since we know we only have standard + ;; characters in the build anyway, we can restrict the + ;; cross-compiler's arg type to standard char, and all + ;; is well. + #+sb-xc-host + (:constant standard-char) + #-sb-xc-host + (:constant (satisfies inlinable-character-constant-p))) (:conditional) (:info target not-p y) (:policy :fast-safe) diff --git a/src/compiler/x86-64/array.lisp b/src/compiler/x86-64/array.lisp index 6102251..7ba5839 100644 --- a/src/compiler/x86-64/array.lisp +++ b/src/compiler/x86-64/array.lisp @@ -14,7 +14,7 @@ ;; For use in constant indexing; we can't use INDEX since the displacement ;; field of an EA can't contain 64 bit values. -(deftype low-index () '(signed-byte 29)) +(def!type low-index () '(signed-byte 29)) ;;;; allocator for the array header -- 1.7.10.4