From c6d72a1b934497a20476884554d2195d6db09d10 Mon Sep 17 00:00:00 2001 From: wlott <wlott> Date: Sat, 1 Dec 1990 22:26:19 +0000 Subject: [PATCH] Added support for the new alignment slot in SCs. Check-ok-target will only indicate that the target is okay if the alignment is okay, and select-location will only select a location that is aligned correctly. --- compiler/pack.lisp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/pack.lisp b/compiler/pack.lisp index c15db72e4..9833fe7e1 100644 --- a/compiler/pack.lisp +++ b/compiler/pack.lisp @@ -772,7 +772,8 @@ (or (eq (sb-kind target-sb) :unbounded) (member loc (sc-locations sc))) (= (sc-element-size target-sc) (sc-element-size sc)) - (not (conflicts-in-sc tn sc loc))) + (not (conflicts-in-sc tn sc loc)) + (zerop (mod loc (sc-alignment sc)))) loc nil))) @@ -840,9 +841,10 @@ (declare (type tn tn) (type sc sc) (inline member)) (let* ((sb (sc-sb sc)) (element-size (sc-element-size sc)) + (alignment (sc-alignment sc)) (size (finite-sb-current-size sb)) (start-offset (finite-sb-last-offset sb))) - (let ((current-start start-offset) + (let ((current-start (* (ceiling start-offset alignment) alignment)) (wrap-p nil)) (declare (type index current-start)) (loop @@ -859,9 +861,10 @@ (return-from select-location current-start)) (let ((offset (+ current-start i))) (when (offset-conflicts-in-sb tn sb offset) - (setq current-start (1+ offset)) + (setq current-start + (* (ceiling (1+ offset) alignment) alignment)) (return)))) - (incf current-start)))))) + (incf current-start alignment)))))) ;;;; Load TN packing: -- GitLab