X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fassem.lisp;h=fbe7d5b52dcb6f4e6f8a2152194f0c1a900a58ab;hb=90ca09b75fbc3b63b2f7d09c67b04b866dd783f6;hp=22e90b8cb9bf509f0d8e41addad5f62c2f3ef197;hpb=f4f18b9dcdaf1948947b1747f5bfa766a1a0ee4c;p=sbcl.git diff --git a/src/compiler/assem.lisp b/src/compiler/assem.lisp index 22e90b8..fbe7d5b 100644 --- a/src/compiler/assem.lisp +++ b/src/compiler/assem.lisp @@ -27,7 +27,7 @@ ;;; This structure holds the state of the assembler. (defstruct (segment (:copier nil)) ;; the name of this segment (for debugging output and stuff) - (name "Unnamed" :type simple-base-string) + (name "unnamed" :type simple-base-string) ;; Ordinarily this is a vector where instructions are written. If ;; the segment is made invalid (e.g. by APPEND-SEGMENT) then the ;; vector can be replaced by NIL. @@ -91,7 +91,7 @@ ;; have to be emitted at a specific place (e.g. one slot before the ;; end of the block). (queued-branches nil :type list) - ;; *** state used by the scheduler during instruction scheduling. + ;; *** state used by the scheduler during instruction scheduling ;; ;; the instructions who would have had a read dependent removed if ;; it were not for a delay slot. This is a list of lists. Each @@ -139,9 +139,9 @@ ;; how many instructions follow the branch. branch ;; This attribute indicates that this ``instruction'' can be - ;; variable length, and therefore better never be used in a branch - ;; delay slot. - variable-length) + ;; variable length, and therefore had better never be used in a + ;; branch delay slot. + var-length) (defstruct (instruction (:include sset-element) @@ -150,7 +150,7 @@ (:copier nil)) ;; The function to envoke to actually emit this instruction. Gets called ;; with the segment as its one argument. - (emitter (required-argument) :type (or null function)) + (emitter (missing-arg) :type (or null function)) ;; The attributes of this instruction. (attributes (instruction-attributes) :type sb!c:attributes) ;; Number of instructions or cycles of delay before additional @@ -192,7 +192,7 @@ name) '))) (when (inst-depth inst) - (format stream ", depth=~D" (inst-depth inst))))) + (format stream ", depth=~W" (inst-depth inst))))) #!+sb-show-assem (defun reset-inst-ids () @@ -230,7 +230,7 @@ (multiple-value-bind (loc-num size) (sb!c:location-number read) #!+sb-show-assem (format *trace-output* - "~&~S reads ~S[~D for ~D]~%" + "~&~S reads ~S[~W for ~W]~%" inst read loc-num size) (when loc-num ;; Iterate over all the locations for this TN. @@ -267,7 +267,7 @@ (multiple-value-bind (loc-num size) (sb!c:location-number write) #!+sb-show-assem (format *trace-output* - "~&~S writes ~S[~D for ~D]~%" + "~&~S writes ~S[~W for ~W]~%" inst write loc-num size) (when loc-num ;; Iterate over all the locations for this TN. @@ -316,7 +316,7 @@ (when countdown (decf countdown) (aver (not (instruction-attributep (inst-attributes inst) - variable-length)))) + var-length)))) (cond ((instruction-attributep (inst-attributes inst) branch) (unless countdown (setf countdown (inst-delay inst))) @@ -529,7 +529,7 @@ p ;; the branch has two dependents and one of them dpends on (let ((inst (car remaining))) (unless (and delay-slot-p (instruction-attributep (inst-attributes inst) - variable-length)) + var-length)) ;; We've got us a live one here. Go for it. #!+sb-show-assem (format *trace-output* "emitting ~S~%" inst) ;; Delete it from the list of insts. @@ -654,11 +654,11 @@ p ;; the branch has two dependents and one of them dpends on (:predicate alignment-p) (:constructor make-alignment (bits size fill-byte)) (:copier nil)) - ;; The minimum number of low-order bits that must be zero. + ;; the minimum number of low-order bits that must be zero (bits 0 :type alignment) - ;; The amount of filler we are assuming this alignment op will take. + ;; the amount of filler we are assuming this alignment op will take (size 0 :type (integer 0 #.(1- (ash 1 max-alignment)))) - ;; The byte used as filling. + ;; the byte used as filling (fill-byte 0 :type (or assembly-unit (signed-byte #.assembly-unit-bits)))) ;;; a reference to someplace that needs to be back-patched when @@ -667,9 +667,9 @@ p ;; the branch has two dependents and one of them dpends on (:include annotation) (:constructor make-back-patch (size function)) (:copier nil)) - ;; The area effected by this back-patch. + ;; the area effected by this back-patch (size 0 :type index) - ;; The function to use to generate the real data + ;; the function to use to generate the real data (function nil :type function)) ;;; This is similar to a BACK-PATCH, but also an indication that the @@ -908,13 +908,13 @@ p ;; the branch has two dependents and one of them dpends on (chooser-index note))) (old-size (chooser-size note))) (when (> new-size old-size) - (error "~S emitted ~D bytes, but claimed its max was ~D." + (error "~S emitted ~W bytes, but claimed its max was ~W." note new-size old-size)) (let ((additional-delta (- old-size new-size))) (when (< (find-alignment additional-delta) (chooser-alignment note)) - (error "~S shrunk by ~D bytes, but claimed that it ~ - preserve ~D bits of alignment." + (error "~S shrunk by ~W bytes, but claimed that it ~ + preserves ~W bits of alignment." note additional-delta (chooser-alignment note))) (incf delta additional-delta) (emit-filler segment additional-delta)) @@ -927,7 +927,7 @@ p ;; the branch has two dependents and one of them dpends on ;; The chooser passed on shrinking. Make sure it didn't emit ;; anything. (unless (= (segment-current-index segment) (chooser-index note)) - (error "Chooser ~S passed, but not before emitting ~D bytes." + (error "Chooser ~S passed, but not before emitting ~W bytes." note (- (segment-current-index segment) (chooser-index note)))) @@ -955,8 +955,8 @@ p ;; the branch has two dependents and one of them dpends on (old-size (alignment-size note)) (additional-delta (- old-size size))) (when (minusp additional-delta) - (error "Alignment ~S needs more space now? It was ~D, ~ - and is ~D now." + (error "Alignment ~S needs more space now? It was ~W, ~ + and is ~W now." note old-size size)) (when (plusp additional-delta) (emit-filler segment additional-delta) @@ -1027,7 +1027,7 @@ p ;; the branch has two dependents and one of them dpends on (funcall function segment posn) (let ((new-size (- (segment-current-index segment) index))) (unless (= new-size old-size) - (error "~S emitted ~D bytes, but claimed it was ~D." + (error "~S emitted ~W bytes, but claimed it was ~W." note new-size old-size))) (let ((tail (segment-last-annotation segment))) (if tail @@ -1316,7 +1316,7 @@ p ;; the branch has two dependents and one of them dpends on (num-bytes (multiple-value-bind (quo rem) (truncate total-bits assembly-unit-bits) (unless (zerop rem) - (error "~D isn't an even multiple of ~D." + (error "~W isn't an even multiple of ~W." total-bits assembly-unit-bits)) quo)) (bytes (make-array num-bytes :initial-element nil)) @@ -1504,9 +1504,11 @@ p ;; the branch has two dependents and one of them dpends on (error "You can only specify :VOP-VAR once per instruction.") (setf vop-var (car args)))) (:printer + (sb!int:/noshow "uniquifying :PRINTER with" args) (push (eval `(list (multiple-value-list ,(sb!disassem:gen-printer-def-forms-def-form name + (format nil "~A[~A]" name args) (cdr option-spec))))) pdefs)) (:printer-list @@ -1515,10 +1517,13 @@ p ;; the branch has two dependents and one of them dpends on (push (eval `(eval - `(list ,@(mapcar #'(lambda (printer) - `(multiple-value-list - ,(sb!disassem:gen-printer-def-forms-def-form - ',name printer nil))) + `(list ,@(mapcar (lambda (printer) + `(multiple-value-list + ,(sb!disassem:gen-printer-def-forms-def-form + ',name + (format nil "~A[~A]" ',name printer) + printer + nil))) ,(cadr option-spec))))) pdefs)) (t