Skip to content
Snippets Groups Projects
Commit 01037c9e authored by wlott's avatar wlott
Browse files

#-gengc'ed allocate-vector 'cause the gengc version is in alloc.lisp.

Changed sxhash-simple-string to just jump to sxhash-simple-substring after
loading the length instead of duplicating all that code.
parent 06949625
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/mips/array.lisp,v 1.19 1992/07/28 20:42:50 wlott Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/mips/array.lisp,v 1.20 1993/05/07 07:41:46 wlott Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
;;; ;;;
(in-package "MIPS") (in-package "MIPS")
#-gengc
(define-assembly-routine (allocate-vector (define-assembly-routine (allocate-vector
(:policy :fast-safe) (:policy :fast-safe)
(:translate allocate-vector) (:translate allocate-vector)
...@@ -30,22 +30,20 @@ ...@@ -30,22 +30,20 @@
(:res result descriptor-reg a0-offset) (:res result descriptor-reg a0-offset)
(:temp ndescr non-descriptor-reg nl0-offset) (:temp ndescr non-descriptor-reg nl0-offset)
(:temp pa-flag non-descriptor-reg nl4-offset) (:temp pa-flag non-descriptor-reg nl4-offset))
(:temp vector descriptor-reg a3-offset)) ;; This is kinda sleezy, changing words like this. But we can because
;; the vop thinks it is temporary.
(inst addu words (+ (1- (ash 1 lowtag-bits))
(* vector-data-offset word-bytes)))
(inst li ndescr (lognot lowtag-mask))
(inst and words ndescr)
(inst srl ndescr type word-shift)
(pseudo-atomic (pa-flag) (pseudo-atomic (pa-flag)
(inst or vector alloc-tn other-pointer-type) (inst or result alloc-tn other-pointer-type)
;; This is kinda sleezy, changing words like this. But we can because
;; the vop thinks it is temporary.
(inst addu words (+ (1- (ash 1 lowtag-bits))
(* vector-data-offset word-bytes)))
(inst li ndescr (lognot lowtag-mask))
(inst and words ndescr)
(inst addu alloc-tn words) (inst addu alloc-tn words)
(inst srl ndescr type word-shift)
(storew ndescr vector 0 other-pointer-type) (storew ndescr vector 0 other-pointer-type)
(storew length vector vector-length-slot other-pointer-type)) (storew length vector vector-length-slot other-pointer-type)))
(move result vector))
;;;; Hash primitives ;;;; Hash primitives
...@@ -57,99 +55,15 @@ ...@@ -57,99 +55,15 @@
((:arg string descriptor-reg a0-offset) ((:arg string descriptor-reg a0-offset)
(:res result any-reg a0-offset) (:res result any-reg a0-offset)
(:temp length any-reg a1-offset)
(:temp lip interior-reg lip-offset) (:temp lip interior-reg lip-offset)
(:temp length any-reg a2-offset)
(:temp accum non-descriptor-reg nl0-offset) (:temp accum non-descriptor-reg nl0-offset)
(:temp data non-descriptor-reg nl1-offset) (:temp data non-descriptor-reg nl1-offset)
(:temp byte non-descriptor-reg nl2-offset) (:temp byte non-descriptor-reg nl2-offset))
(:temp retaddr non-descriptor-reg nl3-offset))
;; Save the return address.
(inst subu retaddr lip-tn code-tn)
(loadw length string vector-length-slot other-pointer-type)
(inst addu lip string
(- (* vector-data-offset word-bytes) other-pointer-type))
(inst b test)
(move accum zero-tn)
loop
(inst and byte data #xff)
(inst xor accum accum byte)
(inst sll byte accum 5)
(inst srl accum accum 27)
(inst or accum accum byte)
(inst srl byte data 8)
(inst and byte byte #xff)
(inst xor accum accum byte)
(inst sll byte accum 5)
(inst srl accum accum 27)
(inst or accum accum byte)
(inst srl byte data 16)
(inst and byte byte #xff)
(inst xor accum accum byte)
(inst sll byte accum 5)
(inst srl accum accum 27)
(inst or accum accum byte)
(inst srl byte data 24)
(inst xor accum accum byte)
(inst sll byte accum 5)
(inst srl accum accum 27)
(inst or accum accum byte)
(inst addu lip lip 4)
test
(inst addu length length (fixnum -4))
(inst lw data lip 0)
(inst bgez length loop)
(inst nop)
(inst addu length length (fixnum 3))
(inst beq length zero-tn one-more)
(inst addu length length (fixnum -1))
(inst beq length zero-tn two-more)
(inst addu length length (fixnum -1))
(inst bne length zero-tn done)
(inst nop)
(inst srl byte data 16)
(inst and byte byte #xff)
(inst xor accum accum byte)
(inst sll byte accum 5)
(inst srl accum accum 27)
(inst or accum accum byte)
two-more
(inst srl byte data 8)
(inst and byte byte #xff)
(inst xor accum accum byte)
(inst sll byte accum 5)
(inst srl accum accum 27)
(inst or accum accum byte)
one-more
(inst and byte data #xff)
(inst xor accum accum byte)
(inst sll byte accum 5)
(inst srl accum accum 27)
(inst or accum accum byte)
done
(inst sll result accum 5)
(inst srl result result 3)
;; Restore the return address.
(inst addu lip-tn retaddr code-tn))
(inst j (make-fixup 'sxhash-simple-substring :assembly-routine))
(loadw length string vector-length-slot other-pointer-type))
(define-assembly-routine (sxhash-simple-substring (define-assembly-routine (sxhash-simple-substring
(:translate %sxhash-simple-substring) (:translate %sxhash-simple-substring)
...@@ -163,11 +77,8 @@ ...@@ -163,11 +77,8 @@
(:temp lip interior-reg lip-offset) (:temp lip interior-reg lip-offset)
(:temp accum non-descriptor-reg nl0-offset) (:temp accum non-descriptor-reg nl0-offset)
(:temp data non-descriptor-reg nl1-offset) (:temp data non-descriptor-reg nl1-offset)
(:temp byte non-descriptor-reg nl2-offset) (:temp byte non-descriptor-reg nl2-offset))
(:temp retaddr non-descriptor-reg nl3-offset)) ;; Get a pointer to the data.
;; Save the return address.
(inst subu retaddr lip-tn code-tn)
(inst addu lip string (inst addu lip string
(- (* vector-data-offset word-bytes) other-pointer-type)) (- (* vector-data-offset word-bytes) other-pointer-type))
(inst b test) (inst b test)
...@@ -245,8 +156,4 @@ ...@@ -245,8 +156,4 @@
done done
(inst sll result accum 5) (inst sll result accum 5)
(inst srl result result 3) (inst srl result result 3))
;; Restore the return address.
(inst addu lip-tn retaddr code-tn))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment