X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcross-misc.lisp;h=0d68f251cc9b15c1ac5b3c0636a6b8e1c17f7f52;hb=4b58efcd710097cf7cc9b1a1bed8b0e1bd6eb3b8;hp=7a4152edab5777a63c180613c7e73ed58fed6b23;hpb=8eb6f7d3da3960c827b704e23b5a47008274be7d;p=sbcl.git diff --git a/src/code/cross-misc.lisp b/src/code/cross-misc.lisp index 7a4152e..0d68f25 100644 --- a/src/code/cross-misc.lisp +++ b/src/code/cross-misc.lisp @@ -68,10 +68,11 @@ nil)) ;;; This seems to be the portable Common Lisp type test which -;;; corresponds to the effect of the target SBCL implementation test.. +;;; corresponds to the effect of the target SBCL implementation test... (defun sb!kernel:array-header-p (x) - (and (typep x 'simple-array) - (= 1 (array-rank x)))) + (and (typep x 'array) + (or (not (typep x 'simple-array)) + (/= (array-rank x) 1)))) ;;; GENESIS needs these at cross-compile time. The target ;;; implementation of these is reasonably efficient by virtue of its @@ -97,7 +98,7 @@ (let ((result 0)) (declare (type fixnum result)) (do-external-symbols (i package) - (declare (ignore i)) + (declare (ignorable i)) (incf result)) result)) @@ -118,3 +119,35 @@ (defun symbol-hash (symbol) (declare (type symbol symbol)) (sxhash symbol)) + +;;; These functions are needed for constant-folding. +(defun sb!kernel:simple-array-nil-p (object) + (when (typep object 'array) + (assert (not (eq (array-element-type object) nil)))) + nil) + +(defun sb!kernel:%negate (number) + (- number)) + +(defun sb!kernel:%single-float (number) + (coerce number 'single-float)) + +(defun sb!kernel:%double-float (number) + (coerce number 'double-float)) + +(defun sb!kernel:%ldb (size posn integer) + (ldb (byte size posn) integer)) + +(defun sb!kernel:%dpb (newbyte size posn integer) + (dpb newbyte (byte size posn) integer)) + +(defun sb!kernel:%with-array-data (array start end) + (assert (typep array '(simple-array * (*)))) + (values array start end 0)) + +#!+sparc +(progn + (defun sb!vm::ash-right-signed (num shift) + (ash num (- shift))) + (defun sb!vm::ash-right-unsigned (num shift) + (ash num (- shift))))