From: Nikodemus Siivola Date: Mon, 5 Dec 2011 18:33:08 +0000 (+0200) Subject: fix unthreaded non-x86oid builds X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=a98da03220d7345b066e4092285f0dfce55d9374;p=sbcl.git fix unthreaded non-x86oid builds Better representation selection for constants broke things, since it assumed that IMMEDIATE is the only immediate boxed SC -- which is true only on x86oids: elsewhere there is also NULL and ZERO. Add new VM support routine: BOXED-IMMEDIATE-SC-P. --- diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 79759bf..d712dd9 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -369,6 +369,7 @@ of SBCL which maintained the CMU-CL-style split into two packages.)" "LARGE-ALLOC" "%SET-SIMPLE-FUN-SELF" "VM-SUPPORT-ROUTINES-IMMEDIATE-CONSTANT-SC" + "VM-SUPPORT-ROUTINES-BOXED-IMMEDIATE-SC-P" "VM-SUPPORT-ROUTINES-LOCATION-PRINT-NAME" "VM-SUPPORT-ROUTINES-PRIMITIVE-TYPE-OF" "VM-SUPPORT-ROUTINES-PRIMITIVE-TYPE" diff --git a/src/compiler/alpha/vm.lisp b/src/compiler/alpha/vm.lisp index d16e08a..77b6319 100644 --- a/src/compiler/alpha/vm.lisp +++ b/src/compiler/alpha/vm.lisp @@ -305,6 +305,11 @@ (if (eql value 0d0) (sc-number-or-lose 'fp-double-zero ) nil)))) + +(!def-vm-support-routine boxed-immediate-sc-p (sc) + (or (eql sc (sc-number-or-lose 'zero)) + (eql sc (sc-number-or-lose 'null)) + (eql sc (sc-number-or-lose 'immediate)))) ;;;; function call parameters diff --git a/src/compiler/backend.lisp b/src/compiler/backend.lisp index 906e837..4dbb9cb 100644 --- a/src/compiler/backend.lisp +++ b/src/compiler/backend.lisp @@ -168,6 +168,7 @@ immediate-constant-sc location-print-name combination-implementation-style + boxed-immediate-sc-p ;; from primtype.lisp primitive-type-of diff --git a/src/compiler/hppa/vm.lisp b/src/compiler/hppa/vm.lisp index 740ffca..d0f9eab 100644 --- a/src/compiler/hppa/vm.lisp +++ b/src/compiler/hppa/vm.lisp @@ -330,6 +330,10 @@ (sc-number-or-lose 'fp-double-zero) nil)))) +(!def-vm-support-routine boxed-immediate-sc-p (sc) + (or (eql sc (sc-number-or-lose 'zero)) + (eql sc (sc-number-or-lose 'null)) + (eql sc (sc-number-or-lose 'immediate)))) ;;;; Function Call Parameters diff --git a/src/compiler/mips/vm.lisp b/src/compiler/mips/vm.lisp index a32c6d7..9602f2f 100644 --- a/src/compiler/mips/vm.lisp +++ b/src/compiler/mips/vm.lisp @@ -313,6 +313,10 @@ (character (sc-number-or-lose 'immediate)))) +(!def-vm-support-routine boxed-immediate-sc-p (sc) + (or (eql sc (sc-number-or-lose 'zero)) + (eql sc (sc-number-or-lose 'null)) + (eql sc (sc-number-or-lose 'immediate)))) ;;;; Function Call Parameters diff --git a/src/compiler/ppc/vm.lisp b/src/compiler/ppc/vm.lisp index 9de32a9..2782b4d 100644 --- a/src/compiler/ppc/vm.lisp +++ b/src/compiler/ppc/vm.lisp @@ -287,6 +287,11 @@ (sc-number-or-lose 'immediate) nil)))) +(!def-vm-support-routine boxed-immediate-sc-p (sc) + (or (eql sc (sc-number-or-lose 'zero)) + (eql sc (sc-number-or-lose 'null)) + (eql sc (sc-number-or-lose 'immediate)))) + ;;; 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 diff --git a/src/compiler/sparc/vm.lisp b/src/compiler/sparc/vm.lisp index 8a85603..95d29f2 100644 --- a/src/compiler/sparc/vm.lisp +++ b/src/compiler/sparc/vm.lisp @@ -323,6 +323,11 @@ (if (static-symbol-p value) (sc-number-or-lose 'immediate) nil)))) + +(!def-vm-support-routine boxed-immediate-sc-p (sc) + (or (eql sc (sc-number-or-lose 'zero)) + (eql sc (sc-number-or-lose 'null)) + (eql sc (sc-number-or-lose 'immediate)))) ;;;; function call parameters diff --git a/src/compiler/tn.lisp b/src/compiler/tn.lisp index cd2525a..1f72696 100644 --- a/src/compiler/tn.lisp +++ b/src/compiler/tn.lisp @@ -204,7 +204,7 @@ (let* ((immed (immediate-constant-sc (constant-value constant))) (use-immed-p (and immed (or (not boxedp) - (eql immed (sc-number-or-lose 'sb!vm::immediate)))))) + (boxed-immediate-sc-p immed))))) (cond ;; CONSTANT-TN uses two caches, one for boxed and one for unboxed uses. ;; diff --git a/src/compiler/x86-64/vm.lisp b/src/compiler/x86-64/vm.lisp index 63af4f9..a19f45c 100644 --- a/src/compiler/x86-64/vm.lisp +++ b/src/compiler/x86-64/vm.lisp @@ -477,6 +477,8 @@ 'fp-complex-double-zero 'fp-complex-double-immediate))))) +(!def-vm-support-routine boxed-immediate-sc-p (sc) + (eql sc (sc-number-or-lose 'immediate))) ;;;; miscellaneous function call parameters diff --git a/src/compiler/x86/vm.lisp b/src/compiler/x86/vm.lisp index ae0b111..b7320e8 100644 --- a/src/compiler/x86/vm.lisp +++ b/src/compiler/x86/vm.lisp @@ -408,6 +408,9 @@ (eql value (log 2l0 2.718281828459045235360287471352662L0))) (sc-number-or-lose 'fp-constant))))) +(!def-vm-support-routine boxed-immediate-sc-p (sc) + (eql sc (sc-number-or-lose 'immediate))) + ;; For an immediate TN, return its value encoded for use as a literal. ;; For any other TN, return the TN. Only works for FIXNUMs, ;; STATIC-SYMBOLs, and CHARACTERS (FLOATs and SAPs are handled