Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
d959c164 by Raymond Toy at 2016-12-07T21:19:19-08:00
Fix #34: Handle newline character correctly
The string containing #\Newline that is used to output the newline
character worked on little-endian architectures because the low octet
was first in memory. However on a big-endian sparc, a NUL character
was output instead since the high octet is first in memory.
So, create a explicit unsigned-byte 8 array containing exactly 1 octet
that represents a newline character code.
Tests pass on both sparc and x86/linux.
- - - - -
3b4745d3 by Raymond Toy at 2016-12-08T05:20:53+00:00
Merge branch 'rtoy-fix-issue-34' into 'master'
Fix #34: Handle newline character correctly
The string containing #\Newline that is used to output the newline
character worked on little-endian architectures because the low octet
was first in memory. However on a big-endian sparc, a NUL character
was output instead since the high octet is first in memory.
So, create a explicit unsigned-byte 8 array containing exactly 1 octet
that represents a newline character code.
Tests pass on both sparc and x86/linux.
See merge request !19
- - - - -
1 changed file:
- src/code/run-program.lisp
Changes:
=====================================
src/code/run-program.lisp
=====================================
--- a/src/code/run-program.lisp
+++ b/src/code/run-program.lisp
@@ -742,7 +742,8 @@
#o666)))
(unix:unix-unlink name)
(when fd
- (let ((newline (string #\Newline)))
+ (let ((newline (make-array 1 :element-type '(unsigned-byte 8)
+ :initial-element (char-code #\Newline))))
(loop
(multiple-value-bind
(line no-cr)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/f10c6b6fbb035c89f37610fa…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
29cb2f47 by Raymond Toy at 2016-12-06T21:07:21-08:00
Replace unix-times usage with getrusage
unix:unix-times was only used for #+(and sparc svr4). The existing
code already supported a different function when this condition was
false, so use that, which uses getrusage instead.
Don't need cross-x86-sparc-bootstrap.lisp anymore either.
- - - - -
f10c6b6f by Raymond Toy at 2016-12-08T03:34:12+00:00
Merge branch 'rtoy-no-unix-times' into 'master'
Fix #38: Replace unix-times usage with getrusage
unix:unix-times was only used for #+(and sparc svr4). The existing
code already supported a different function when this condition was
false, so use that, which uses getrusage instead.
Don't need cross-x86-sparc-bootstrap.lisp anymore either.
See merge request !18
- - - - -
3 changed files:
- src/code/sunos-os.lisp
- src/code/time.lisp
- − src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp
Changes:
=====================================
src/code/sunos-os.lisp
=====================================
--- a/src/code/sunos-os.lisp
+++ b/src/code/sunos-os.lisp
@@ -58,7 +58,6 @@
;;;
;;; Return system time, user time and number of page faults.
;;;
-#-(and sparc svr4)
(defun get-system-info ()
(multiple-value-bind
(err? utime stime maxrss ixrss idrss isrss minflt majflt)
@@ -70,19 +69,6 @@
(T
(values utime stime majflt)))))
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time and number of page faults.
-;;;
-#+(and sparc svr4)
-(defun get-system-info ()
- (multiple-value-bind
- (err? utime stime cutime cstime)
- (unix:unix-times)
- (declare (ignore err? cutime cstime))
- ;; Return times in microseconds; page fault statistics not supported.
- (values (* utime 10000) (* stime 10000) 0)))
-
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
=====================================
src/code/time.lisp
=====================================
--- a/src/code/time.lisp
+++ b/src/code/time.lisp
@@ -64,7 +64,6 @@
;;; Get-Internal-Run-Time -- Public
;;;
-#-(and sparc svr4)
(defun get-internal-run-time ()
_N"Return the run time in the internal time format. This is useful for
finding CPU usage."
@@ -81,20 +80,6 @@
(truncate (+ utime-usec stime-usec)
micro-seconds-per-internal-time-unit)))))
-;;; Get-Internal-Run-Time -- Public
-;;;
-#+(and sparc svr4)
-(defun get-internal-run-time ()
- _N"Return the run time in the internal time format. This is useful for
- finding CPU usage."
- (declare (values (unsigned-byte 32)))
- (locally (declare (optimize (speed 3) (safety 0)))
- (multiple-value-bind (ignore utime stime cutime cstime)
- (unix:unix-times)
- (declare (ignore ignore cutime cstime)
- (type (unsigned-byte 31) utime stime))
- (the (unsigned-byte 32) (+ utime stime)))))
-
;;;; Encode and Decode universal times.
=====================================
src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp deleted
=====================================
--- a/src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp
+++ /dev/null
@@ -1,4 +0,0 @@
-;; Cross bootstrap file for cross-compiling from x86 to sparc.
-;; Use this file with the -B option for bin/cross-build-world.sh
-
-(export 'unix::unix-times "UNIX")
\ No newline at end of file
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/18dc7c123174d9f30fd34314…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
9075c97e by Raymond Toy at 2016-12-04T09:06:30-08:00
Set vmdir correctly for sparc64.
:sparc64 sources are in sparcv9. (Should we rename the directory?)
- - - - -
18dc7c12 by Raymond Toy at 2016-12-04T09:07:43-08:00
Set up paths and *features* for sparc64.
Cross-compile to sparc-32 using this finishes. (Did not actually test
the result, though.)
- - - - -
2 changed files:
- src/tools/cross-scripts/cross-x86-sparcv9.lisp
- src/tools/setup.lisp
Changes:
=====================================
src/tools/cross-scripts/cross-x86-sparcv9.lisp
=====================================
--- a/src/tools/cross-scripts/cross-x86-sparcv9.lisp
+++ b/src/tools/cross-scripts/cross-x86-sparcv9.lisp
@@ -10,7 +10,8 @@
(c::new-backend "SPARC"
;; Features to add here
- '(:sparc
+ '(:sparc ; Any sparc processor
+ :sparc64 ; For 64-bit sparc
:sparc-v9 ; For Ultrasparc processors
:complex-fp-vops ; Some slightly faster FP vops on complex numbers
:linkage-table
@@ -23,7 +24,7 @@
:hash-new
:random-mt19937 ; MT-19937 generator
:cmu ; Announce this is CMUCL
- :cmu20 :cmu20b ; Current version identifier
+ :cmu21 :cmu21b ; Current version identifier
:modular-arith ; Modular arithmetic
:double-double ; Double-double float support
:executable
@@ -115,9 +116,9 @@
(setf (search-list "c:")
'("target:compiler/"))
(setf (search-list "vm:")
- '("c:sparc/" "c:generic/"))
+ '("c:sparcv9/" "c:generic/"))
(setf (search-list "assem:")
- '("target:assembly/" "target:assembly/sparc/"))
+ '("target:assembly/" "target:assembly/sparcv9/"))
;; Load the backend of the compiler.
=====================================
src/tools/setup.lisp
=====================================
--- a/src/tools/setup.lisp
+++ b/src/tools/setup.lisp
@@ -304,6 +304,7 @@
((c:target-featurep :sgi) "mips/")
((c:target-featurep :ppc) "ppc/")
((c:target-featurep :amd64) "amd64/")
+ ((c:target-featurep :sparc64) "sparcv9/")
(t
(error "What machine is this?")))
(make-pathname :directory (pathname-directory f)))))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/0082cee611d78cdfa0e9d8bc…
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
f9d62c05 by Raymond Toy at 2016-12-03T13:24:00-08:00
Initial Config for sparc64 build.
Copy Config.sparc_sunc to Config.sparcv9_sunc, removing the -m32
option and updating ASSEM_SRC to sparcv9-assem.S. Remove that from
Config.sparc_common and put it in Config.sparc_sunc.
- - - - -
0082cee6 by Raymond Toy at 2016-12-04T08:42:19-08:00
Bootstrap file for x86->sparc cross-compile.
Use this with the -B option of cross-build-world.sh when
cross-compiling from x86 to sparc.
- - - - -
4 changed files:
- src/lisp/Config.sparc_common
- src/lisp/Config.sparc_sunc
- + src/lisp/Config.sparcv9_sunc
- + src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp
Changes:
=====================================
src/lisp/Config.sparc_common
=====================================
--- a/src/lisp/Config.sparc_common
+++ b/src/lisp/Config.sparc_common
@@ -43,7 +43,7 @@ CPPFLAGS += -I. -I$(PATH1) $(CC_V8PLUS) $(CPP_DEFINE_OPTIONS)
CFLAGS += -g $(CC_V8PLUS)
NM = $(PATH1)/solaris-nm
-ASSEM_SRC = sparc-assem.S
+#ASSEM_SRC = sparc-assem.S
ARCH_SRC = sparc-arch.c
DEPEND=$(CC)
=====================================
src/lisp/Config.sparc_sunc
=====================================
--- a/src/lisp/Config.sparc_sunc
+++ b/src/lisp/Config.sparc_sunc
@@ -20,10 +20,11 @@ include Config.sparc_common
ifdef FEATURE_SPARC_V9
# For SunStudio 11, use -xarch=v8plus. For SunStudio 12, that is
# deprecated; use -m32 -xarch=sparc.
-CC_V8PLUS = -m32 -xarch=sparc
-AS_V8PLUS = -m32 -xarch=sparc
+CC_V8PLUS = -xarch=sparc
+AS_V8PLUS = -xarch=sparc
endif
+ASSEM_SRC = sparcv9-assem.S
CFLAGS += -xlibmieee -O
DEPEND_FLAGS = -xM
ASFLAGS = $(AS_V8PLUS)
=====================================
src/lisp/Config.sparcv9_sunc
=====================================
--- /dev/null
+++ b/src/lisp/Config.sparcv9_sunc
@@ -0,0 +1,31 @@
+# -*- Mode: makefile -*-
+
+# Build cmucl using Sun C compiler. We assume cc is Sun's C compiler.
+# If you don't have it, why are you using this Config anyway? You're
+# on your own if you use this Config without Sun C compiler available.
+
+include Config.sparc_common
+
+# For v8plus support (allows 64-bit integer support on V9
+# architectures), uncomment the definitions for CC_V8PLUS and
+# AS_V8PLUS. The -Wa,xarch=v8plus option tells the assembler to
+# accept v8plus instructions and generate a v8plus object files and
+# executable.
+#
+# However, we should also make sure the binary is marked as v8plus by
+# enabling AS_V8PLUS whenever we have the :sparc-v9 *feature* enabled
+# because we really are a v8plus application by using some of the v9
+# instructions, even if we don't use the 64-bit registers.
+
+ifdef FEATURE_SPARC_V9
+# For SunStudio 11, use -xarch=v8plus. For SunStudio 12, that is
+# deprecated; use -m32 -xarch=sparc.
+CC_V8PLUS = -xarch=sparc
+AS_V8PLUS = -xarch=sparc
+endif
+
+ASSEM_SRC = sparcv9-assem.S
+CFLAGS += -xlibmieee -O
+DEPEND_FLAGS = -xM
+ASFLAGS = $(AS_V8PLUS)
+OS_LINK_FLAGS = -M /usr/lib/ld/map.noexstk
=====================================
src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp
=====================================
--- /dev/null
+++ b/src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp
@@ -0,0 +1,4 @@
+;; Cross bootstrap file for cross-compiling from x86 to sparc.
+;; Use this file with the -B option for bin/cross-build-world.sh
+
+(export 'unix::unix-times "UNIX")
\ No newline at end of file
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/41838802a3e6cbf057be72dc…