Changeset 7245
- Timestamp:
- 09/17/07 16:58:47 (4 years ago)
- Location:
- branches/ia32/compiler/X86
- Files:
-
- 4 modified
-
x86-asm.lisp (modified) (1 diff)
-
x86-disassemble.lisp (modified) (2 diffs)
-
x86-lap.lisp (modified) (4 diffs)
-
x862.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ia32/compiler/X86/x86-asm.lisp
r7212 r7245 4287 4287 4288 4288 (defun insert-self (instruction operand) 4289 (format t "~&insert-self: instruction = ~a operand = ~a"4290 instruction operand)4291 4289 (setf (x86-immediate-operand-type operand) 4292 4290 (encode-operand-type :self)) -
branches/ia32/compiler/X86/x86-disassemble.lisp
r7244 r7245 2754 2754 (setq seq (funcall collect-function ds instruction seq))))))) 2755 2755 2756 ;;; A function object in the IA-32 port has a two-byte "immediate word2757 ;;; count" between the header and the start of the machine2758 ;;; instructions. This is interpreted as the number of (32 bit) words2759 ;;; there are to the GC-able constants.2760 ;;;2761 ;;; Before the constants, there is a table of self-reference offsets.2762 ;;; This table is separated from the code by four zero bytes. We scan2763 ;;; backwards to find this delimiter, which marks the end of the2764 ;;; machine instructions.2765 (defun nbytes-to-delimiter (imm-word-count code-vector)2766 (check-type code-vector (simple-array (unsigned-byte 8) (*)))2767 (do ((i (* 4 imm-word-count) (decf i 4)))2768 ((and (zerop (aref code-vector (+ i 0)))2769 (zerop (aref code-vector (+ i 1)))2770 (zerop (aref code-vector (+ i 2)))2771 (zerop (aref code-vector (+ i 3)))) i)))2772 2773 2756 (defun x8632-disassemble-xfunction (xfunction &key (symbolic-names 2774 2757 x8632::*x8632-symbolic-register-names*) (collect-function #'x86-print-disassembled-instruction)) … … 2783 2766 :symbolic-names symbolic-names 2784 2767 :pending-labels (list 2))) 2785 (blocks (x86-ds-blocks ds)) 2786 (imm-word-count (x86-ds-next-u16 ds))) 2787 (setf (x86-ds-code-limit ds) 2788 (nbytes-to-delimiter imm-word-count (uvref xfunction 0))) 2768 (blocks (x86-ds-blocks ds))) 2769 (setf (x86-ds-code-limit ds) (ash (x86-ds-next-u16 ds) 2)) 2789 2770 (do* () 2790 2771 ((null (x86-ds-pending-labels ds))) -
branches/ia32/compiler/X86/x86-lap.lisp
r7218 r7245 423 423 designator (x86::reg-entry-reg-name r))) 424 424 (case designator 425 (:%b (x86::x86-reg8 r)) 425 (:%b (if (x86-byte-reg-p (x86::reg-entry-reg-name r)) 426 (x86::x86-reg8 r) 427 (error "Designator ~a can't be used with register ~a" 428 designator (x86::reg-entry-reg-name r)))) 426 429 (:%w (x86::x86-reg16 r)) 427 430 (:%l (x86::x86-reg32 r)) … … 717 720 ;; special case 718 721 (when (eq val :self) 719 (setq type (x86::encode-operand-type :self)) 720 (format t "~&self operand: type = ~s" type)) 722 (setq type (x86::encode-operand-type :self))) 721 723 (x86::make-x86-immediate-operand :type type 722 724 :value expr)))) … … 1494 1496 ;; count of 32-bit words between header and function boundary 1495 1497 ;; marker, inclusive. 1496 (x86-lap-directive frag-list :short `(ash (+ ( :^ ,end-code-tag)1498 (x86-lap-directive frag-list :short `(ash (+ (- (:^ ,end-code-tag) 4) 1497 1499 *x86-lap-entry-offset*) -2)) 1498 1500 (emit-x86-lap-label frag-list entry-code-tag) … … 1554 1556 #+x86-target ; just shorthand for defun 1555 1557 (%defun (nfunction ,name (lambda (&lap 0) (x86-lap-function ,name ,arglist ,@body))) ,doc))) 1558 1559 (defmacro defx8632lapfunction (&environment env name arglist &body body 1560 &aux doc) 1561 (if (not (endp body)) 1562 (and (stringp (car body)) 1563 (cdr body) 1564 (setq doc (car body)) 1565 (setq body (cdr body)))) 1566 `(progn 1567 (eval-when (:compile-toplevel) 1568 (note-function-info ',name t ,env)) 1569 (progn 1570 (eval-when (:load-toplevel) 1571 (%defun (nfunction ,name (lambda (&lap 0) (x86-lap-function ,name ,arglist ,@body))) ,doc)) 1572 (eval-when (:execute) 1573 (%define-x8632-lap-function ',name '((let ,arglist ,@body))))) 1574 )) -
branches/ia32/compiler/X86/x862.lisp
r7244 r7245 575 575 (end-code-tag (gensym)) 576 576 (srt-tag (gensym)) 577 (*x86-lap-self-reference-offsets* nil)578 577 debug-info) 579 578 (make-x86-lap-label end-code-tag) … … 587 586 (:x8632 588 587 (make-x86-lap-label srt-tag) 589 ;; count of 32-bit words between header and 590 ;; function boundary marker, inclusive. 591 (x86-lap-directive frag-list :short `(ash (+ (:^ ,end-code-tag) 588 (x86-lap-directive frag-list :short `(ash (+ (- (:^ ,end-code-tag) 4) 592 589 *x86-lap-entry-offset*) -2)))) 593 590 (x862-expand-vinsns vinsns frag-list instruction)
