X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Farith.impure.lisp;h=71b57343ad65b81e9d3c672e29cffe50e6f1d729;hb=0b3f5cc5fa9e6b121d232960ccd964d2eb15f695;hp=dc11f8bf803e8796065bab5af8d348bafdba1d35;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/tests/arith.impure.lisp b/tests/arith.impure.lisp index dc11f8b..71b5734 100644 --- a/tests/arith.impure.lisp +++ b/tests/arith.impure.lisp @@ -152,4 +152,29 @@ (assert (= (64-bit-logcount (1- (ash 1 48))) 48)) (assert (= (64-bit-logcount (1- (ash 1 54))) 54)) -(sb-ext:quit :unix-status 104) +(declaim (inline ppc-ldb-2)) + +(defun ppc-ldb-2 (fun value) + (declare (type stream socket) + (type (signed-byte 32) value) + (optimize (speed 3) (safety 0) (space 1) (debug 1) + (compilation-speed 0))) + (funcall fun (ldb (byte 8 24) value)) + (funcall fun (ldb (byte 8 16) value)) + (funcall fun (ldb (byte 8 8) value)) + (funcall fun (ldb (byte 8 0) value)) + (values)) + +(defun ppc-ldb-1 (fun) + (declare (optimize (speed 3) (safety 0) (space 1) (debug 1) + (compilation-speed 0))) + (loop + for param :across (make-array 1 :initial-element nil) + for size :across (make-array 1 :element-type 'fixnum :initial-element 3) + do (ppc-ldb-2 fun (if param size -1)))) + +(let ((acc '())) + (ppc-ldb-1 (lambda (x) + (push x acc))) + (assert (equal acc '(#xff #xff #xff #xff)))) +