X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fppc%2Farray.lisp;h=f1e26834bf285aae8ce5a79ff1b668fdce6ea8a1;hb=ad613f03c3e077e63ae871a4e1967ac57a4c59c9;hp=8239a8f0822c1894a3cc6c8381789728374d9e3d;hpb=cab2c71bb1bb8a575d9eebdae335e731daa64183;p=sbcl.git diff --git a/src/compiler/ppc/array.lisp b/src/compiler/ppc/array.lisp index 8239a8f..f1e2683 100644 --- a/src/compiler/ppc/array.lisp +++ b/src/compiler/ppc/array.lisp @@ -1,6 +1,14 @@ -;;; -;;; Written by William Lott -;;; +;;;; array operations for the PPC VM + +;;;; This software is part of the SBCL system. See the README file for +;;;; more information. +;;;; +;;;; This software is derived from the CMU CL system, which was +;;;; written at Carnegie Mellon University and released into the +;;;; public domain. The software is in the public domain and is +;;;; provided with absolutely no warranty. See the COPYING and CREDITS +;;;; files for more information. + (in-package "SB!VM") @@ -180,9 +188,11 @@ (:result-types positive-fixnum) (:temporary (:scs (non-descriptor-reg)) temp) (:generator 15 - (multiple-value-bind (word extra) (floor index ,elements-per-word) + (multiple-value-bind (word extra) + (floor index ,elements-per-word) (setf extra (logxor extra (1- ,elements-per-word))) - (let ((offset (- (* (+ word sb!vm:vector-data-offset) sb!vm:n-word-bytes) + (let ((offset (- (* (+ word sb!vm:vector-data-offset) + sb!vm:n-word-bytes) sb!vm:other-pointer-lowtag))) (cond ((typep offset '(signed-byte 16)) (inst lwz result object offset)) @@ -190,8 +200,7 @@ (inst lr temp offset) (inst lwzx result object temp)))) (unless (zerop extra) - (inst srwi result result - (logxor (* extra ,bits) ,(1- elements-per-word)))) + (inst srwi result result (* ,bits extra))) (unless (= extra ,(1- elements-per-word)) (inst andi. result result ,(1- (ash 1 bits))))))) (define-vop (,(symbolicate 'data-vector-set/ type))