From af98b18f64ad7040ac2e45fa418001d0fed77072 Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Fri, 8 Apr 2005 04:11:02 +0000 Subject: [PATCH] The ppc port no longer uses the ppc-fun-hack where the function-pointer and instance-pointer tags were swapped compared to all other ports. Remove code for ppc-fun-hack. --- assembly/ppc/arith.lisp | 76 +----------------------------------- assembly/ppc/assem-rtns.lisp | 15 +------ assembly/ppc/support.lisp | 3 +- compiler/generic/objdef.lisp | 9 ++--- compiler/ppc/alloc.lisp | 6 +-- compiler/ppc/call.lisp | 40 ++----------------- compiler/ppc/cell.lisp | 5 +-- compiler/ppc/insts.lisp | 4 +- compiler/ppc/macros.lisp | 22 +---------- compiler/ppc/static-fn.lisp | 11 +----- lisp/ppc-assem.S | 48 ++++++----------------- 11 files changed, 26 insertions(+), 213 deletions(-) diff --git a/assembly/ppc/arith.lisp b/assembly/ppc/arith.lisp index 24f27d3bf..6c775c897 100644 --- a/assembly/ppc/arith.lisp +++ b/assembly/ppc/arith.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/ppc/arith.lisp,v 1.4 2004/08/09 03:23:19 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/ppc/arith.lisp,v 1.5 2005/04/08 04:11:01 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -39,7 +39,6 @@ (:temp flag non-descriptor-reg nl3-offset) (:temp lra descriptor-reg lra-offset) (:temp nargs any-reg nargs-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp ocfp any-reg ocfp-offset)) @@ -56,23 +55,13 @@ (inst add temp2 temp2 temp) (with-fixed-allocation (res flag temp bignum-type (1+ bignum-digits-offset)) (storew temp2 res bignum-digits-offset other-pointer-type)) - #+PPC-FUN-HACK - (lisp-return lra :offset 2) - #-PPC-FUN-HACK (lisp-return lra lip :offset 2) DO-STATIC-FUN - #+PPC-FUN-HACK - (inst lwz code-tn null-tn (static-function-offset 'two-arg-+)) - #-PPC-FUN-HACK (inst lwz lip null-tn (static-function-offset 'two-arg-+)) (inst li nargs (fixnumize 2)) (inst mr ocfp cfp-tn) (inst mr cfp-tn csp-tn) - #+PPC-FUN-HACK - (inst j code-tn - (- (* function-code-offset word-bytes) function-pointer-type)) - #-PPC-FUN-HACK (inst j lip 0) DONE @@ -96,7 +85,6 @@ (:temp flag non-descriptor-reg nl3-offset) (:temp lra descriptor-reg lra-offset) (:temp nargs any-reg nargs-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp ocfp any-reg ocfp-offset)) @@ -115,23 +103,13 @@ (inst sub temp2 temp temp2) (with-fixed-allocation (res flag temp bignum-type (1+ bignum-digits-offset)) (storew temp2 res bignum-digits-offset other-pointer-type)) - #+PPC-FUN-HACK - (lisp-return lra :offset 2) - #-PPC-FUN-HACK (lisp-return lra lip :offset 2) DO-STATIC-FUN - #+PPC-FUN-HACK - (inst lwz code-tn null-tn (static-function-offset 'two-arg--)) - #-PPC-FUN-HACK (inst lwz lip null-tn (static-function-offset 'two-arg--)) (inst li nargs (fixnumize 2)) (inst mr ocfp cfp-tn) (inst mr cfp-tn csp-tn) - #+PPC-FUN-HACK - (inst j code-tn - (- (* function-code-offset word-bytes) function-pointer-type)) - #-PPC-FUN-HACK (inst j lip 0) DONE @@ -158,7 +136,6 @@ (:temp lo non-descriptor-reg nl1-offset) (:temp hi non-descriptor-reg nl2-offset) (:temp pa-flag non-descriptor-reg nl3-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp lra descriptor-reg lra-offset) (:temp nargs any-reg nargs-offset) @@ -203,23 +180,13 @@ (storew lo res bignum-digits-offset other-pointer-type))) ;; Out of here GO-HOME - #+PPC-FUN-HACK - (lisp-return lra :offset 2) - #-PPC-FUN-HACK (lisp-return lra lip :offset 2) DO-STATIC-FUN - #+PPC-FUN-HACK - (inst lwz code-tn null-tn (static-function-offset 'two-arg-*)) - #-PPC-FUN-HACK (inst lwz lip null-tn (static-function-offset 'two-arg-*)) (inst li nargs (fixnumize 2)) (inst mr ocfp cfp-tn) (inst mr cfp-tn csp-tn) - #+PPC-FUN-HACK - (inst j code-tn - (- (* function-code-offset word-bytes) function-pointer-type)) - #-PPC-FUN-HACK (inst j lip 0) LOW-FITS-IN-FIXNUM @@ -338,7 +305,6 @@ (:res res descriptor-reg a0-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp nargs any-reg nargs-offset) (:temp ocfp any-reg ocfp-offset)) @@ -349,17 +315,10 @@ (inst beq DO-COMPARE) DO-STATIC-FN - #+PPC-FUN-HACK - (inst lwz code-tn null-tn (static-function-offset ',static-fn)) - #-PPC-FUN-HACK (inst lwz lip null-tn (static-function-offset ',static-fn)) (inst li nargs (fixnumize 2)) (inst mr ocfp cfp-tn) (inst mr cfp-tn csp-tn) - #+PPC-FUN-HACK - (inst j code-tn - (- (* function-code-offset word-bytes) function-pointer-type)) - #-PPC-FUN-HACK (inst j lip 0) DO-COMPARE @@ -386,7 +345,6 @@ (:res res descriptor-reg a0-offset) (:temp lra descriptor-reg lra-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp nargs any-reg nargs-offset) (:temp ocfp any-reg ocfp-offset)) @@ -399,23 +357,13 @@ RETURN-NIL (inst mr res null-tn) - #+PPC-FUN-HACK - (lisp-return lra :offset 2) - #-PPC-FUN-HACK (lisp-return lra lip :offset 2) DO-STATIC-FN - #+PPC-FUN-HACK - (inst lwz code-tn null-tn (static-function-offset 'eql)) - #-PPC-FUN-HACK (inst lwz lip null-tn (static-function-offset 'eql)) (inst li nargs (fixnumize 2)) (inst mr ocfp cfp-tn) (inst mr cfp-tn csp-tn) - #+PPC-FUN-HACK - (inst j code-tn - (- (* function-code-offset word-bytes) function-pointer-type)) - #-PPC-FUN-HACK (inst j lip 0) RETURN-T @@ -434,7 +382,6 @@ (:res res descriptor-reg a0-offset) (:temp lra descriptor-reg lra-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp nargs any-reg nargs-offset) (:temp ocfp any-reg ocfp-offset)) @@ -446,23 +393,13 @@ (inst beq :cr1 RETURN-T) (inst mr res null-tn) - #+PPC-FUN-HACK - (lisp-return lra :offset 2) - #-PPC-FUN-HACK (lisp-return lra lip :offset 2) DO-STATIC-FN - #+PPC-FUN-HACK - (inst lwz code-tn null-tn (static-function-offset 'two-arg-=)) - #-PPC-FUN-HACK (inst lwz lip null-tn (static-function-offset 'two-arg-=)) (inst li nargs (fixnumize 2)) (inst mr ocfp cfp-tn) (inst mr cfp-tn csp-tn) - #+PPC-FUN-HACK - (inst j code-tn - (- (* function-code-offset word-bytes) function-pointer-type)) - #-PPC-FUN-HACK (inst j lip 0) RETURN-T @@ -480,7 +417,6 @@ (:res res descriptor-reg a0-offset) (:temp lra descriptor-reg lra-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp nargs any-reg nargs-offset) (:temp ocfp any-reg ocfp-offset)) @@ -491,22 +427,12 @@ (inst beq :cr1 RETURN-NIL) (load-symbol res t) - #+PPC-FUN-HACK - (lisp-return lra :offset 2) - #-PPC-FUN-HACK (lisp-return lra lip :offset 2) DO-STATIC-FN - #+PPC-FUN-HACK - (inst lwz code-tn null-tn (static-function-offset 'two-arg-=)) - #-PPC-FUN-HACK (inst lwz lip null-tn (static-function-offset 'two-arg-=)) (inst li nargs (fixnumize 2)) (inst mr ocfp cfp-tn) - #+PPC-FUN-HACK - (inst j code-tn - (- (* function-code-offset word-bytes) function-pointer-type)) - #-PPC-FUN-HACK (inst j lip 0) (inst mr cfp-tn csp-tn) diff --git a/assembly/ppc/assem-rtns.lisp b/assembly/ppc/assem-rtns.lisp index 654149ead..caa333b55 100644 --- a/assembly/ppc/assem-rtns.lisp +++ b/assembly/ppc/assem-rtns.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman (FAHLMAN@CMUC). ;;; ********************************************************************** ;;; -;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/ppc/assem-rtns.lisp,v 1.3 2004/07/25 18:15:52 pmai Exp $ +;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/ppc/assem-rtns.lisp,v 1.4 2005/04/08 04:11:01 rtoy Exp $ ;;; ;;; (in-package "PPC") @@ -27,7 +27,7 @@ (:temp lra descriptor-reg lra-offset) ;; These are just needed to facilitate the transfer - #-PPC-FUN-HACK + (:temp lip interior-reg lip-offset) (:temp count any-reg nl2-offset) (:temp src any-reg nl3-offset) @@ -85,9 +85,6 @@ (inst add csp-tn ocfp-tn nvals) ;; Return. - #+PPC-FUN-HACK - (lisp-return lra) - #-PPC-FUN-HACK (lisp-return lra lip)) @@ -111,7 +108,6 @@ (:temp dst any-reg nl2-offset) (:temp count any-reg nl3-offset) (:temp temp descriptor-reg l0-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) ;; These are needed so we can get at the register args. @@ -149,9 +145,6 @@ DONE ;; We are done. Do the jump. (loadw temp lexenv vm:closure-function-slot vm:function-pointer-type) - #+PPC-FUN-HACK - (lisp-jump temp) - #-PPC-FUN-HACK (lisp-jump temp lip)) @@ -166,7 +159,6 @@ (:arg start (any-reg descriptor-reg) ocfp-offset) (:arg count (any-reg descriptor-reg) nargs-offset) (:temp lra descriptor-reg lra-offset) - #-PPC-FUN-HACK (:temp lip interior-reg lip-offset) (:temp cur-uwp any-reg nl0-offset) (:temp next-uwp any-reg nl1-offset) @@ -189,9 +181,6 @@ (loadw cfp-tn cur-uwp vm:unwind-block-current-cont-slot) (loadw code-tn cur-uwp vm:unwind-block-current-code-slot) (loadw lra cur-uwp vm:unwind-block-entry-pc-slot) - #+PPC-FUN-HACK - (lisp-return lra :frob-code nil) - #-PPC-FUN-HACK (lisp-return lra lip :frob-code nil) DO-UWP diff --git a/assembly/ppc/support.lisp b/assembly/ppc/support.lisp index bc234b6e5..81596ebee 100644 --- a/assembly/ppc/support.lisp +++ b/assembly/ppc/support.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/ppc/support.lisp,v 1.2 2004/07/25 18:15:52 pmai Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/ppc/support.lisp,v 1.3 2005/04/08 04:11:01 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -61,7 +61,6 @@ `((lisp-return (make-random-tn :kind :normal :sc (sc-or-lose 'descriptor-reg *backend*) :offset lra-offset) - #-PPC-FUN-HACK (make-random-tn :kind :normal :sc (sc-or-lose 'interior-reg *backend*) :offset lip-offset) diff --git a/compiler/generic/objdef.lisp b/compiler/generic/objdef.lisp index 2c035608e..1c3138b61 100644 --- a/compiler/generic/objdef.lisp +++ b/compiler/generic/objdef.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/generic/objdef.lisp,v 1.58 2004/09/08 02:10:55 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/generic/objdef.lisp,v 1.59 2005/04/08 04:11:01 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -96,11 +96,11 @@ ;;; (defenum (:suffix -type) even-fixnum - #-PPC-FUN-HACK function-pointer #+PPC-FUN-HACK instance-pointer + function-pointer other-immediate-0 list-pointer odd-fixnum - #-PPC-FUN-HACK instance-pointer #+PPC-FUN-HACK function-pointer + instance-pointer other-immediate-1 other-pointer) @@ -303,7 +303,6 @@ (define-primitive-object (function :type function :lowtag function-pointer-type :header function-header-type) - #+PPC-FUN-HACK (jump-insn) #-gengc (self :ref-trans %function-self :set-trans (setf %function-self)) #+gengc (entry-point :c-type "char *") (next :type (or function null) @@ -331,7 +330,6 @@ (define-primitive-object (closure :lowtag function-pointer-type :header closure-header-type) - #+PPC-FUN-HACK (jump-insn) #-gengc (function :init :arg :ref-trans %closure-function) #+gengc (entry-point :c-type "char *") (info :rest-p t)) @@ -340,7 +338,6 @@ :lowtag function-pointer-type :header funcallable-instance-header-type :alloc-trans %make-funcallable-instance) - #+PPC-FUN-HACK (jump-insn) #-gengc (function :ref-known (flushable) :ref-trans %funcallable-instance-function diff --git a/compiler/ppc/alloc.lisp b/compiler/ppc/alloc.lisp index 755ec1cd3..e564b8168 100644 --- a/compiler/ppc/alloc.lisp +++ b/compiler/ppc/alloc.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/alloc.lisp,v 1.9 2005/02/06 19:43:14 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/alloc.lisp,v 1.10 2005/04/08 04:11:02 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -158,10 +158,6 @@ (allocation result (pad-data-block size) function-pointer-type :temp-tn temp) (inst lr temp (logior (ash (1- size) type-bits) closure-header-type)) (storew temp result 0 function-pointer-type))) - #+PPC-FUN-HACK - (inst lis temp (ash 18 10)) - #+PPC-FUN-HACK - (storew temp result closure-jump-insn-slot function-pointer-type) (storew function result closure-function-slot function-pointer-type))) ;;; The compiler likes to be able to directly make value cells. diff --git a/compiler/ppc/call.lisp b/compiler/ppc/call.lisp index bc8faaa52..f05ba6937 100644 --- a/compiler/ppc/call.lisp +++ b/compiler/ppc/call.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/call.lisp,v 1.6 2004/08/09 01:36:47 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/call.lisp,v 1.7 2005/04/08 04:11:02 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -178,18 +178,6 @@ (align vm:lowtag-bits) (trace-table-entry trace-table-function-prologue) (emit-label start-lab) - #+PPC-FUN-HACK - (let* ((entry-label (gen-label))) - ;; Allocate function header. - (inst function-header-word) - (inst b entry-label) - (dotimes (i (1- (1- vm:function-code-offset))) - (inst word 0)) - (emit-label entry-label) - ;; The start of the actual code. - ;; Fix CODE, cause the function object was passed in. - (inst compute-code-from-fn code-tn code-tn start-lab temp)) - #-PPC-FUN-HACK (let* ((entry-label (gen-label))) ;; Allocate function header. (inst function-header-word) @@ -706,8 +694,7 @@ default-value-8 return-pc-pass) ,(if named - `(:temporary (:sc descriptor-reg :offset #+PPC-FUN-HACK cname-offset - #-PPC-FUN-HACK fdefn-offset + `(:temporary (:sc descriptor-reg :offset fdefn-offset :from (:argument ,(if (eq return :tail) 0 1)) :to :eval) name-pass) @@ -819,10 +806,6 @@ default-value-8 (loadw name-pass code-tn (tn-offset name) vm:other-pointer-type) (do-next-filler))) - #+PPC-FUN-HACK - (loadw function name-pass fdefn-raw-addr-slot - other-pointer-type) - #-PPC-FUN-HACK (loadw entry-point name-pass fdefn-raw-addr-slot other-pointer-type) (do-next-filler)) @@ -838,7 +821,6 @@ default-value-8 (loadw function lexenv vm:closure-function-slot vm:function-pointer-type) (do-next-filler) - #-PPC-FUN-HACK (inst addi entry-point function (- (ash vm:function-code-offset vm:word-shift) vm:function-pointer-type)))) @@ -848,8 +830,7 @@ default-value-8 (return))) (note-this-location vop :call-site) - (inst mtctr #+PPC-FUN-HACK function #-PPC-FUN-HACK entry-point) - #+PPC-FUN-HACK-MAYBE (inst mr code-tn function) + (inst mtctr entry-point) (inst bctr) #| (inst j function @@ -934,7 +915,6 @@ default-value-8 (return-pc :scs (descriptor-reg)) (value)) (:ignore value) - #-PPC-FUN-HACK (:temporary (:scs (interior-reg)) lip) (:vop-var vop) (:generator 6 @@ -949,9 +929,6 @@ default-value-8 (move csp-tn cfp-tn) (move cfp-tn old-fp) ;; Out of here. - #+PPC-FUN-HACK - (lisp-return return-pc :offset 2) - #-PPC-FUN-HACK (lisp-return return-pc lip :offset 2) (trace-table-entry trace-table-normal))) @@ -981,7 +958,6 @@ default-value-8 (:temporary (:sc descriptor-reg :offset a3-offset :from (:eval 0)) a3) (:temporary (:sc any-reg :offset nargs-offset) nargs) (:temporary (:sc any-reg :offset ocfp-offset) val-ptr) - #-PPC-FUN-HACK (:temporary (:scs (interior-reg)) lip) (:vop-var vop) (:generator 6 @@ -997,9 +973,6 @@ default-value-8 (move csp-tn cfp-tn) (move cfp-tn old-fp) ;; Out of here. - #+PPC-FUN-HACK - (lisp-return return-pc :offset 2) - #-PPC-FUN-HACK (lisp-return return-pc lip :offset 2)) (t ;; Establish the values pointer and values count. @@ -1014,9 +987,6 @@ default-value-8 (dolist (reg (subseq (list a0 a1 a2 a3) nvals)) (move reg null-tn))) ;; And away we go. - #+PPC-FUN-HACK - (lisp-return return-pc) - #-PPC-FUN-HACK (lisp-return return-pc lip))) (trace-table-entry trace-table-normal))) @@ -1037,7 +1007,6 @@ default-value-8 (:temporary (:sc any-reg :offset nl0-offset :from (:argument 2)) vals) (:temporary (:sc any-reg :offset nargs-offset :from (:argument 3)) nvals) (:temporary (:sc descriptor-reg :offset a0-offset) a0) - #-PPC-FUN-HACK (:temporary (:scs (interior-reg)) lip) @@ -1061,9 +1030,6 @@ default-value-8 ;; Return with one value. (move csp-tn cfp-tn) (move cfp-tn old-fp-arg) - #+PPC-FUN-HACK - (lisp-return lra-arg :offset 2) - #-PPC-FUN-HACK (lisp-return lra-arg lip :offset 2) ;; Nope, not the single case. diff --git a/compiler/ppc/cell.lisp b/compiler/ppc/cell.lisp index 29c631199..1be9eb76e 100644 --- a/compiler/ppc/cell.lisp +++ b/compiler/ppc/cell.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/cell.lisp,v 1.4 2005/02/06 19:43:15 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/cell.lisp,v 1.5 2005/04/08 04:11:02 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -140,9 +140,6 @@ (let ((normal-fn (gen-label))) (load-type type function (- function-pointer-type)) (inst cmpwi type function-header-type) - #+PPC-FUN-HACK - (inst mr lip function) - #-PPC-FUN-HACK (inst addi lip function (- (ash vm:function-code-offset vm:word-shift) function-pointer-type)) diff --git a/compiler/ppc/insts.lisp b/compiler/ppc/insts.lisp index e44f6544a..826459cfa 100644 --- a/compiler/ppc/insts.lisp +++ b/compiler/ppc/insts.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/insts.lisp,v 1.7 2005/02/11 05:45:57 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/insts.lisp,v 1.8 2005/04/08 04:11:02 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -2095,8 +2095,6 @@ (emit-compute-inst segment vop dst src label temp #'(lambda (label posn delta-if-after) (- other-pointer-type - #+PPC-FUN-HACK-MAYBE - function-pointer-type (label-position label posn delta-if-after) (component-header-length)))))) diff --git a/compiler/ppc/macros.lisp b/compiler/ppc/macros.lisp index bd0a9459f..4b6ba6125 100644 --- a/compiler/ppc/macros.lisp +++ b/compiler/ppc/macros.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman (FAHLMAN@CMUC). ;;; ********************************************************************** ;;; -;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/macros.lisp,v 1.6 2005/02/12 03:08:51 rtoy Exp $ +;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/macros.lisp,v 1.7 2005/04/08 04:11:02 rtoy Exp $ ;;; ;;; This file contains various useful macros for generating PC code. ;;; @@ -78,15 +78,6 @@ ;;; Macros to handle the fact that we cannot use the machine native call and ;;; return instructions. -#+PPC-FUN-HACK -(defmacro lisp-jump (function) - "Jump to the lisp function FUNCTION." - `(progn - (inst mtctr ,function) - (move code-tn ,function) - (inst bctr))) - -#-PPC-FUN-HACK (defmacro lisp-jump (function lip) "Jump to the lisp function FUNCTION." `(progn @@ -96,17 +87,6 @@ (move code-tn ,function) (inst bctr))) -#+PPC-FUN-HACK -(defmacro lisp-return (return-pc &key (offset 0) (frob-code t)) - "Return to RETURN-PC." - `(progn - (inst addi lip-tn ,return-pc (- (* (1+ ,offset) word-bytes) other-pointer-type)) - (inst mtlr lip-tn) - ,@(if frob-code - `((move code-tn ,return-pc))) - (inst blr))) - -#-PPC-FUN-HACK (defmacro lisp-return (return-pc lip &key (offset 0) (frob-code t)) "Return to RETURN-PC." `(progn diff --git a/compiler/ppc/static-fn.lisp b/compiler/ppc/static-fn.lisp index 870372a54..16790f71a 100644 --- a/compiler/ppc/static-fn.lisp +++ b/compiler/ppc/static-fn.lisp @@ -7,7 +7,7 @@ ;;; Lisp, please contact Scott Fahlman (Scott.Fahlman@CS.CMU.EDU) ;;; ********************************************************************** ;;; -;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/static-fn.lisp,v 1.3 2004/07/25 18:15:52 pmai Exp $ +;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/static-fn.lisp,v 1.4 2005/04/08 04:11:02 rtoy Exp $ ;;; ;;; This file contains the VOPs and macro magic necessary to call static ;;; functions. @@ -26,7 +26,6 @@ (:temporary (:scs (non-descriptor-reg)) temp) (:temporary (:scs (descriptor-reg)) move-temp) (:temporary (:sc descriptor-reg :offset lra-offset) lra) - #-PPC-FUN-HACK (:temporary (:sc interior-reg :offset lip-offset) entry-point) (:temporary (:scs (descriptor-reg)) func) (:temporary (:sc any-reg :offset nargs-offset) nargs) @@ -88,9 +87,6 @@ (let ((lra-label (gen-label)) (cur-nfp (current-nfp-tn vop))) ,@(moves (temp-names) (arg-names)) - #+PPC-FUN-HACK - (inst lwz func null-tn (static-function-offset symbol)) - #-PPC-FUN-HACK (inst lwz entry-point null-tn (static-function-offset symbol)) (inst lr nargs (fixnumize ,num-args)) (when cur-nfp @@ -99,11 +95,6 @@ (inst mr cfp-tn csp-tn) (inst compute-lra-from-code lra code-tn lra-label temp) (note-this-location vop :call-site) - #+PPC-FUN-HACK-MAYBE - (inst mr code-tn func) - #+PPC-FUN-HACK - (inst mtctr func) - #-PPC-FUN-HACK (inst mtctr entry-point) (inst bctr) (emit-return-pc lra-label) diff --git a/lisp/ppc-assem.S b/lisp/ppc-assem.S index dac3fed0a..eaf03a145 100644 --- a/lisp/ppc-assem.S +++ b/lisp/ppc-assem.S @@ -232,12 +232,12 @@ x: /* Function is an indirect closure */ lwz reg_CODE,CLOSURE_FUNCTION_OFFSET(reg_LEXENV) -#ifdef PPC_FUN_HACK - mtctr reg_CODE -#else + /* + * The 6 is vm:function-code-offset, the 4 is + * the number of bytes in a lispobj. + */ addi reg_LIP,reg_CODE,6*4-type_FunctionPointer mtctr reg_LIP -#endif slwi reg_NARGS,reg_NL2,2 bctr .align 3 @@ -395,25 +395,14 @@ lra: GFUNCDEF(xundefined_tramp) .globl _undefined_tramp - .byte 0,0,0,type_FunctionHeader + .byte 0,0,0,type_FunctionHeader /* Header */ -#ifdef PPC_FUN_HACK - /* - * The next 4 bytes are the encoding for a PPC jump instruction. - * The jump should go to the twllei instruction below. - */ - .byte 18<<2 + .long _undefined_tramp /* self slot */ + .long NIL /* next slot */ + .long NIL /* name slot */ + .long NIL /* arglist slot */ + .long NIL /* type slot */ _undefined_tramp: - .byte 0,0,24 -#endif - .long _undefined_tramp - .long NIL - .long NIL - .long NIL - .long NIL -#ifndef PPC_FUN_HACK -_undefined_tramp: -#endif twllei reg_ZERO,trap_Cerror /* Number of argument bytes */ .byte 4 @@ -428,11 +417,7 @@ _undefined_tramp: .byte 1 */ .align 2 -#ifdef PPC_FUN_HACK_MAYBE -1: lwz reg_CODE,FDEFN_RAW_ADDR_OFFSET(reg_CNAME) -#else 1: lwz reg_CODE,FDEFN_RAW_ADDR_OFFSET(reg_FDEFN) -#endif la reg_LIP,FUNCTION_CODE_OFFSET(reg_CODE) mtctr reg_LIP bctr @@ -444,25 +429,14 @@ _undefined_tramp: GFUNCDEF(xclosure_tramp) .globl _closure_tramp - .byte 0,0,0,type_FunctionHeader -#ifdef PPC_FUN_HACK - .byte 18<<2 -_closure_tramp: - .byte 0,0,24 -#endif + .byte 0,0,0,type_FunctionHeader /* Header */ .long _closure_tramp .long NIL .long NIL .long NIL .long NIL -#ifndef PPC_FUN_HACK _closure_tramp: -#endif -#ifdef PPC_FUN_HACK_MAYBE - lwz reg_LEXENV,FDEFN_FUNCTION_OFFSET(reg_CNAME) -#else lwz reg_LEXENV,FDEFN_FUNCTION_OFFSET(reg_FDEFN) -#endif lwz reg_CODE,CLOSURE_FUNCTION_OFFSET(reg_LEXENV) la reg_LIP,FUNCTION_CODE_OFFSET(reg_CODE) mtctr reg_LIP -- GitLab