X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fcodegen.lisp;h=df6d06a6a0f5825d8ec2854f50faa8a0af50151d;hb=d25e3478acccec70402ff32554669a982be8e281;hp=2eafcda1c95489552dd732da42687afcbbadd553;hpb=c2431e2d0d0222a3cf20cfdfa48201bdcc65cd76;p=sbcl.git diff --git a/src/compiler/codegen.lisp b/src/compiler/codegen.lisp index 2eafcda..df6d06a 100644 --- a/src/compiler/codegen.lisp +++ b/src/compiler/codegen.lisp @@ -68,7 +68,7 @@ (defun trace-instruction (segment vop inst args) (let ((*standard-output* *compiler-trace-output*)) (unless (eq *prev-segment* segment) - (format t "in the ~A segment:~%" (sb!assem:segment-name segment)) + (format t "in the ~A segment:~%" (sb!assem:segment-type segment)) (setf *prev-segment* segment)) (unless (eq *prev-vop* vop) (when vop @@ -102,14 +102,14 @@ (defun init-assembler () (setf *code-segment* - (sb!assem:make-segment :name "regular" + (sb!assem:make-segment :type :regular :run-scheduler (default-segment-run-scheduler) :inst-hook (default-segment-inst-hook))) #!+sb-dyncount (setf (sb!assem:segment-collect-dynamic-statistics *code-segment*) *collect-dynamic-statistics*) (setf *elsewhere* - (sb!assem:make-segment :name "elsewhere" + (sb!assem:make-segment :type :elsewhere :run-scheduler (default-segment-run-scheduler) :inst-hook (default-segment-inst-hook))) (values)) @@ -133,6 +133,18 @@ (when (and (eq (block-info 1block) block) (block-start 1block)) (sb!assem:assemble (*code-segment*) + ;; Align first emitted block of each loop: x86 and x86-64 both + ;; like 16 byte alignment, however, since x86 aligns code objects + ;; on 8 byte boundaries we cannot guarantee proper loop alignment + ;; there (yet.) + #!+x86-64 + (let ((cloop (sb!c::block-loop 1block))) + (when (and cloop + (sb!c::loop-tail cloop) + (not (sb!c::loop-info cloop))) + (sb!assem:emit-alignment sb!vm:n-lowtag-bits #x90) + ;; Mark the loop as aligned by saving the IR1 block aligned. + (setf (sb!c::loop-info cloop) 1block))) (sb!assem:emit-label (block-label 1block))) (let ((env (block-physenv 1block))) (unless (eq env prev-env)