X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fvm.lisp;h=4079bdec5dcd4a95cb6d8e895ee81735757d0b7f;hb=07ab1e4811ab16f95a9a5e8d767426a0787f22c0;hp=1b080bc28f7fe15c012b2f977a4fd6dd6ece5412;hpb=fb2d70782a537348895f6a04f257d1f1fcc7942d;p=sbcl.git diff --git a/src/compiler/x86/vm.lisp b/src/compiler/x86/vm.lisp index 1b080bc..4079bde 100644 --- a/src/compiler/x86/vm.lisp +++ b/src/compiler/x86/vm.lisp @@ -384,7 +384,7 @@ (!def-vm-support-routine immediate-constant-sc (value) (typecase value ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum) - #-sb-xc-host system-area-pointer character) + character) (sc-number-or-lose 'immediate)) (symbol (when (static-symbol-p value) @@ -404,6 +404,20 @@ (eql value (log 2l0 10l0)) (eql value (log 2l0 2.718281828459045235360287471352662L0))) (sc-number-or-lose 'fp-constant))))) + +;; 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 +;; elsewhere). +(defun encode-value-if-immediate (tn) + (if (sc-is tn immediate) + (let ((val (tn-value tn))) + (etypecase val + (integer (fixnumize val)) + (symbol (+ nil-value (static-symbol-offset val))) + (character (logior (ash (char-code val) n-widetag-bits) + character-widetag)))) + tn)) ;;;; miscellaneous function call parameters