Skip to content
Snippets Groups Projects
Commit 90492109 authored by toy's avatar toy
Browse files

o Fill branch delay slots

o Use swap instruction
o Turn off instruction scheduling only around the or/trap sequence,
  where it's really important.
parent c640d0f2
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/macros.lisp,v 1.23 2003/08/27 17:18:00 toy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/macros.lisp,v 1.24 2003/09/05 16:49:35 toy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/macros.lisp,v 1.23 2003/08/27 17:18:00 toy Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/macros.lisp,v 1.24 2003/09/05 16:49:35 toy Exp $
;;; ;;;
;;; This file contains various useful macros for generating SPARC code. ;;; This file contains various useful macros for generating SPARC code.
;;; ;;;
...@@ -238,49 +238,41 @@ ...@@ -238,49 +238,41 @@
(inst add alloc-tn ,size)))) (inst add alloc-tn ,size))))
#+gencgc #+gencgc
(t (t
;; The OR instruction MUST come just before the TRAP (let ((done (gen-label))
;; instruction, because the C code depends on this to figure (full-alloc (gen-label)))
;; out what to do. ;; See if we can do an inline allocation. The updated
(without-scheduling () ;; free pointer should not point past the end of the
(let ((done (gen-label)) ;; current region. If it does, a full alloc needs to be
(full-alloc (gen-label))) ;; done.
;; See if we can do an inline allocation. The updated (load-symbol-value ,result-tn *current-region-free-pointer*)
;; free pointer should not point past the end of the (load-symbol-value ,temp-tn *current-region-end-addr*)
;; current region. If it does, a full alloc needs to be (inst add ,result-tn ,size)
;; done.
(load-symbol-value ,result-tn *current-region-free-pointer*)
(load-symbol-value ,temp-tn *current-region-end-addr*)
(inst add ,result-tn ,size)
;; Do we need to round up? I hope not because result-tn
;; is descriptor!
;;(inst add ,result-tn vm:lowtag-mask) ;; result-tn points to the new end of region. Did we go
;;(inst andn ,result-tn vm:lowtag-mask) ;; past the actual end of the region? If so, we need a
;; full alloc.
;; result-tn points to the new end of region. Did we go (inst cmp ,result-tn ,temp-tn)
;; past the actual end of the region? If so, we need a (inst b :gt full-alloc #+sparc-v9 :pn)
;; full alloc. (load-symbol ,temp-tn '*current-region-free-pointer*)
(inst cmp ,result-tn ,temp-tn) ;; Inline allocation worked, so update the free pointer
(inst b :gt full-alloc #+sparc-v9 :pn) ;; and go.
(inst nop) (inst b done)
;; Inline allocation worked, so update the free pointer (inst swap ,result-tn ,temp-tn (- (ash symbol-value-slot word-shift) other-pointer-type))
;; and go. Should really do a swap instruction here to
;; swap memory with a register. (emit-label full-alloc)
(load-symbol-value ,temp-tn *current-region-free-pointer*) ;; Full alloc via trap to the C allocator. Tell the
(store-symbol-value ,result-tn *current-region-free-pointer*) ;; allocator what the result-tn and size are, using the
(inst b done) ;; OR instruction. Then trap to the allocator.
(move ,result-tn ,temp-tn) (without-scheduling ()
;; The OR instruction MUST come just before the TRAP
(emit-label full-alloc) ;; instruction, because the C code depends on this to
;; Full alloc via trap to the C allocator. Tell the ;; figure out what to do.
;; allocator what the result-tn and size are, using the
;; OR instruction. Then trap to the allocator.
(inst or zero-tn ,result-tn ,size) (inst or zero-tn ,result-tn ,size)
(inst t :t allocation-trap) (inst t :t allocation-trap))
(emit-label done) (emit-label done)
;; Set lowtag appropriately ;; Set lowtag appropriately
(inst or ,result-tn ,lowtag)))))) (inst or ,result-tn ,lowtag)))))
(defmacro with-fixed-allocation ((result-tn temp-tn type-code size) (defmacro with-fixed-allocation ((result-tn temp-tn type-code size)
......
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