From 02567855a57e1ee0974c4c8513bde7625702c1b4 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 28 Jul 2005 14:03:15 +0000 Subject: [PATCH] 0.9.3.7: Merge "Extend address spaces on mips" (THS sbcl-devel 2005-07-15) --- NEWS | 2 ++ src/compiler/mips/insts.lisp | 40 ++++++++++++++++++++++++------------- src/compiler/mips/parms.lisp | 45 +++++++++++++++++++++++++++++++----------- src/compiler/mips/vm.lisp | 3 ++- version.lisp-expr | 2 +- 5 files changed, 65 insertions(+), 27 deletions(-) diff --git a/NEWS b/NEWS index dee4379..5c230c7 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ ;;;; -*- coding: utf-8; -*- changes in sbcl-0.9.4 relative to sbcl-0.9.3: + * enhancement: SBCL on MIPS platforms now has a much larger dynamic + space for its heap. (thanks to Thiemo Seufer) * optimizations: REMOVE-DUPLICATES now runs in linear time on lists in some cases. This partially fixes bug 384. diff --git a/src/compiler/mips/insts.lisp b/src/compiler/mips/insts.lisp index d0a705c..2f1b723 100644 --- a/src/compiler/mips/insts.lisp +++ b/src/compiler/mips/insts.lisp @@ -58,8 +58,7 @@ (:hi-reg 64) (:low-reg 65) (:float-status 66) - (:ctrl-stat-reg 67) - (:r31 31))))) + (:ctrl-stat-reg 67))))) (defparameter reg-symbols (map 'vector @@ -670,7 +669,7 @@ (immediate nil :type 'relative-label)) '(:name :tab immediate)) (:attributes branch) - (:dependencies (writes :r31)) + (:dependencies (writes lip-tn)) (:delay 1) (:emitter (emit-relative-branch segment bcond-op 0 #b10001 target))) @@ -757,7 +756,7 @@ immediate ((op bcond-op) (rt #b01000) (immediate nil :type 'relative-label)) cond-branch-printer) (:attributes branch) - (:dependencies (reads reg) (writes :r31)) + (:dependencies (reads reg) (writes lip-tn)) (:delay 1) (:emitter (emit-relative-branch segment bcond-op reg #b10000 target))) @@ -769,7 +768,7 @@ cond-branch-printer) (:attributes branch) (:delay 1) - (:dependencies (reads reg) (writes :r31)) + (:dependencies (reads reg) (writes lip-tn)) (:emitter (emit-relative-branch segment bcond-op reg #b10001 target))) @@ -791,28 +790,41 @@ (emit-register-inst segment special-op (reg-tn-encoding target) 0 0 0 #b001000)) (fixup - (note-fixup segment :jump target) - (emit-jump-inst segment #b000010 0))))) + (note-fixup segment :lui target) + (emit-immediate-inst segment #b001111 0 28 0) + (note-fixup segment :addi target) + (emit-immediate-inst segment #b001001 28 28 0) + (emit-register-inst segment special-op 28 0 0 0 #b001000))))) (define-instruction jal (segment reg-or-target &optional target) (:declare (type (or null tn fixup) target) - (type (or tn fixup (integer -16 31)) reg-or-target)) + (type (or tn fixup) reg-or-target)) (:printer register ((op special-op) (rt 0) (funct #b001001)) j-printer) (:printer jump ((op #b000011)) j-printer) (:attributes branch) - (:dependencies (if target (writes reg-or-target) (writes :r31))) + (:dependencies (cond + (target + (writes reg-or-target) (reads target)) + (t + (writes lip-tn) + (when (tn-p reg-or-target) + (reads reg-or-target))))) (:delay 1) (:emitter (unless target - (setf target reg-or-target) - (setf reg-or-target 31)) + (setf target reg-or-target + reg-or-target lip-tn)) (etypecase target (tn (emit-register-inst segment special-op (reg-tn-encoding target) 0 - reg-or-target 0 #b001001)) + (reg-tn-encoding reg-or-target) 0 #b001001)) (fixup - (note-fixup segment :jump target) - (emit-jump-inst segment #b000011 0))))) + (note-fixup segment :lui target) + (emit-immediate-inst segment #b001111 0 28 0) + (note-fixup segment :addi target) + (emit-immediate-inst segment #b001001 28 28 0) + (emit-register-inst segment special-op 28 0 + (reg-tn-encoding reg-or-target) 0 #b001001))))) (define-instruction bc1f (segment target) (:declare (type label target)) diff --git a/src/compiler/mips/parms.lisp b/src/compiler/mips/parms.lisp index 5e9a9a8..0575d5b 100644 --- a/src/compiler/mips/parms.lisp +++ b/src/compiler/mips/parms.lisp @@ -57,18 +57,41 @@ ;;;; Description of the target address space. -;;; Where to put the different spaces. -;;; -(def!constant read-only-space-start #x01000000) -(def!constant read-only-space-end #x05000000) - -(def!constant static-space-start #x06000000) -(def!constant static-space-end #x08000000) +#!+irix +(progn + ;; Where to put the different spaces. + ;; Old definitions, might be still relevant for an IRIX port. + ;; + (def!constant read-only-space-start #x01000000) + (def!constant read-only-space-end #x05000000) + + (def!constant static-space-start #x06000000) + (def!constant static-space-end #x08000000) + + (def!constant dynamic-0-space-start #x08000000) + (def!constant dynamic-0-space-end #x0c000000) + (def!constant dynamic-1-space-start #x0c000000) + (def!constant dynamic-1-space-end #x10000000)) + +#!+linux +(progn + ;; Where to put the address spaces on Linux. + ;; + ;; C runtime executable segment starts at 0x00400000 + (def!constant read-only-space-start #x01000000) + (def!constant read-only-space-end #x08000000) + + (def!constant static-space-start #x08000000) + (def!constant static-space-end #x10000000) + ;; C runtime read/write segment starts at 0x10000000, heap and DSOs + ;; start at 0x2a000000 + (def!constant dynamic-0-space-start #x30000000) + (def!constant dynamic-0-space-end #x50000000) + (def!constant dynamic-1-space-start #x50000000) + (def!constant dynamic-1-space-end #x70000000) + ;; C stack grows downward from 0x80000000 + ) -(def!constant dynamic-0-space-start #x08000000) -(def!constant dynamic-0-space-end #x0c000000) -(def!constant dynamic-1-space-start #x0c000000) -(def!constant dynamic-1-space-end #x10000000) ;;;; Other non-type constants. diff --git a/src/compiler/mips/vm.lisp b/src/compiler/mips/vm.lisp index ec25ba0..9d0188b 100644 --- a/src/compiler/mips/vm.lisp +++ b/src/compiler/mips/vm.lisp @@ -61,7 +61,8 @@ (defreg l1 24) ; tagged temporary 1 (defreg alloc 25) ; ALLOC pointer ;; 26 and 27 are used by the system kernel. - ;; 28 is the global pointer of our C runtime. + ;; 28 is the global pointer of our C runtime, and used for + ;; jump/branch relaxation in Lisp. (defreg nsp 29) ; number (native) stack pointer ;; C frame pointer, or additional saved register. (defreg code 30) ; current function object diff --git a/version.lisp-expr b/version.lisp-expr index 5344861..f0ad104 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.3.6" +"0.9.3.7" -- 1.7.10.4