[Git][cmucl/cmucl][sparc64-dev] Pad data block sizes to 16-byte boundary.

Raymond Toy rtoy at common-lisp.net
Sun Jan 15 16:46:10 UTC 2017


Raymond Toy pushed to branch sparc64-dev at cmucl / cmucl


Commits:
585895ac by Raymond Toy at 2017-01-15T08:42:11-08:00
Pad data block sizes to 16-byte boundary.

Data blocks are padded to double-word boundaries which is 16 bytes for
sparc64.

This also means telling new-genesis round up by 16 bytes in
allocate-descriptor.

Adjust string-to-core for 64-bit objects too.

At this point, the static symbols appear to print out correctly (as
determined by call print (in the lisp monitor).  Some objects, such as
*fp-constant-0d0* however appear to be incorrect.  The value pointer
appears to be a double-float but the object is messed up.  But maybe
this is caused by a buggy print function.

- - - - -


2 changed files:

- src/compiler/generic/new-genesis.lisp
- src/compiler/generic/vm-macs.lisp


Changes:

=====================================
src/compiler/generic/new-genesis.lisp
=====================================
--- a/src/compiler/generic/new-genesis.lisp
+++ b/src/compiler/generic/new-genesis.lisp
@@ -148,7 +148,7 @@
   "Return a descriptor for a block of LENGTH bytes out of SPACE.  The free
   pointer is boosted as necessary.  If any additional memory is needed, we
   vm_allocate it.  The descriptor returned is a pointer of type LOWTAG."
-  (let* ((bytes (round-up length #+amd64 16 #-amd64 (ash 1 vm:lowtag-bits)))
+  (let* ((bytes (round-up length (* 2 vm:word-bytes)))
 	 (offset (space-free-pointer space))
 	 (new-free-ptr (+ offset (ash bytes (- vm:word-shift)))))
     (when (> new-free-ptr (space-words-allocated space))
@@ -462,9 +462,12 @@
     (copy-to-system-area bytes (* vm:vector-data-offset
 				   ;; the word size of the native backend which
 				   ;; may be different from the target backend
-				   (if (= (c:backend-fasl-file-implementation
-					   c::*native-backend*)
-					  #.c:amd64-fasl-file-implementation)
+				   (if (or (= (c:backend-fasl-file-implementation
+					       c::*native-backend*)
+					      #.c:amd64-fasl-file-implementation)
+					   (= (c:backend-fasl-file-implementation
+					       c::*native-backend*)
+					      #.c:sparc64-fasl-file-implementation))
 				       64
 				       32))
 			 (descriptor-sap des)


=====================================
src/compiler/generic/vm-macs.lisp
=====================================
--- a/src/compiler/generic/vm-macs.lisp
+++ b/src/compiler/generic/vm-macs.lisp
@@ -27,8 +27,9 @@
 ;;; given a number of words.
 ;;;
 (defmacro pad-data-block (words)
-  `(logandc2 (+ (ash ,words word-shift) #+amd64 15 #-amd64 lowtag-mask)
-    #+amd64 15 #-amd64 lowtag-mask))
+  (let ((dual-word-mask (1- (ash 2 word-shift))))
+    `(logandc2 (+ (ash ,words word-shift) ,dual-word-mask)
+	       ,dual-word-mask)))
 
 ;;; DEFENUM -- Internal Interface.
 ;;;



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/585895ac72b27299e4d5dd269914a51e26bee02a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20170115/63bfe42f/attachment-0001.html>


More information about the cmucl-cvs mailing list