Changeset 10698
- Timestamp:
- 04/08/05 04:11:02 (4 years ago)
- Location:
- trunk/src
- Files:
-
- 7 modified
-
assembly/ppc/arith.lisp (modified) (16 diffs)
-
assembly/ppc/assem-rtns.lisp (modified) (6 diffs)
-
assembly/ppc/support.lisp (modified) (1 diff)
-
compiler/generic/objdef.lisp (modified) (6 diffs)
-
compiler/ppc/alloc.lisp (modified) (1 diff)
-
compiler/ppc/call.lisp (modified) (17 diffs)
-
compiler/ppc/static-fn.lisp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/assembly/ppc/arith.lisp
r9845 r10562 40 40 (:temp lra descriptor-reg lra-offset) 41 41 (:temp nargs any-reg nargs-offset) 42 #-PPC-FUN-HACK 43 (:temp lip interior-reg lip-offset) 42 44 (:temp ocfp any-reg ocfp-offset)) 43 45 … … 55 57 (with-fixed-allocation (res flag temp bignum-type (1+ bignum-digits-offset)) 56 58 (storew temp2 res bignum-digits-offset other-pointer-type)) 59 #+PPC-FUN-HACK 57 60 (lisp-return lra :offset 2) 61 #-PPC-FUN-HACK 62 (lisp-return lra lip :offset 2) 58 63 59 64 DO-STATIC-FUN 65 #+PPC-FUN-HACK 60 66 (inst lwz code-tn null-tn (static-function-offset 'two-arg-+)) 67 #-PPC-FUN-HACK 68 (inst lwz lip null-tn (static-function-offset 'two-arg-+)) 61 69 (inst li nargs (fixnumize 2)) 62 70 (inst mr ocfp cfp-tn) 63 71 (inst mr cfp-tn csp-tn) 72 #+PPC-FUN-HACK 64 73 (inst j code-tn 65 74 (- (* function-code-offset word-bytes) function-pointer-type)) 75 #-PPC-FUN-HACK 76 (inst j lip 0) 66 77 67 78 DONE … … 86 97 (:temp lra descriptor-reg lra-offset) 87 98 (:temp nargs any-reg nargs-offset) 99 #-PPC-FUN-HACK 100 (:temp lip interior-reg lip-offset) 88 101 (:temp ocfp any-reg ocfp-offset)) 89 102 … … 103 116 (with-fixed-allocation (res flag temp bignum-type (1+ bignum-digits-offset)) 104 117 (storew temp2 res bignum-digits-offset other-pointer-type)) 118 #+PPC-FUN-HACK 105 119 (lisp-return lra :offset 2) 120 #-PPC-FUN-HACK 121 (lisp-return lra lip :offset 2) 106 122 107 123 DO-STATIC-FUN 124 #+PPC-FUN-HACK 108 125 (inst lwz code-tn null-tn (static-function-offset 'two-arg--)) 126 #-PPC-FUN-HACK 127 (inst lwz lip null-tn (static-function-offset 'two-arg--)) 109 128 (inst li nargs (fixnumize 2)) 110 129 (inst mr ocfp cfp-tn) 111 130 (inst mr cfp-tn csp-tn) 131 #+PPC-FUN-HACK 112 132 (inst j code-tn 113 133 (- (* function-code-offset word-bytes) function-pointer-type)) 134 #-PPC-FUN-HACK 135 (inst j lip 0) 114 136 115 137 DONE … … 137 159 (:temp hi non-descriptor-reg nl2-offset) 138 160 (:temp pa-flag non-descriptor-reg nl3-offset) 161 #-PPC-FUN-HACK 162 (:temp lip interior-reg lip-offset) 139 163 (:temp lra descriptor-reg lra-offset) 140 164 (:temp nargs any-reg nargs-offset) … … 165 189 CONS-BIGNUM 166 190 ;; Allocate a BIGNUM for the result. 167 ( pseudo-atomic (pa-flag :extra (pad-data-block (1+ bignum-digits-offset)))191 (with-fixed-allocation (res pa-flag temp bignum-type (+ 2 bignum-digits-offset)) 168 192 (let ((one-word (gen-label))) 169 (inst ori res alloc-tn other-pointer-type)170 193 ;; We start out assuming that we need one word. Is that correct? 171 194 (inst srawi temp lo 31) … … 174 197 (inst beq one-word) 175 198 ;; Nope, we need two, so allocate the additional space. 176 (inst addi alloc-tn alloc-tn (- (pad-data-block (+ 2 bignum-digits-offset))177 (pad-data-block (1+ bignum-digits-offset))))178 199 (inst li temp (logior (ash 2 type-bits) bignum-type)) 179 200 (storew hi res (1+ bignum-digits-offset) other-pointer-type) … … 183 204 ;; Out of here 184 205 GO-HOME 206 #+PPC-FUN-HACK 185 207 (lisp-return lra :offset 2) 208 #-PPC-FUN-HACK 209 (lisp-return lra lip :offset 2) 186 210 187 211 DO-STATIC-FUN 212 #+PPC-FUN-HACK 188 213 (inst lwz code-tn null-tn (static-function-offset 'two-arg-*)) 214 #-PPC-FUN-HACK 215 (inst lwz lip null-tn (static-function-offset 'two-arg-*)) 189 216 (inst li nargs (fixnumize 2)) 190 217 (inst mr ocfp cfp-tn) 191 218 (inst mr cfp-tn csp-tn) 219 #+PPC-FUN-HACK 192 220 (inst j code-tn 193 221 (- (* function-code-offset word-bytes) function-pointer-type)) 222 #-PPC-FUN-HACK 223 (inst j lip 0) 194 224 195 225 LOW-FITS-IN-FIXNUM … … 309 339 (:res res descriptor-reg a0-offset) 310 340 341 #-PPC-FUN-HACK 342 (:temp lip interior-reg lip-offset) 311 343 (:temp nargs any-reg nargs-offset) 312 344 (:temp ocfp any-reg ocfp-offset)) … … 318 350 319 351 DO-STATIC-FN 352 #+PPC-FUN-HACK 320 353 (inst lwz code-tn null-tn (static-function-offset ',static-fn)) 354 #-PPC-FUN-HACK 355 (inst lwz lip null-tn (static-function-offset ',static-fn)) 321 356 (inst li nargs (fixnumize 2)) 322 357 (inst mr ocfp cfp-tn) 323 358 (inst mr cfp-tn csp-tn) 359 #+PPC-FUN-HACK 324 360 (inst j code-tn 325 361 (- (* function-code-offset word-bytes) function-pointer-type)) 362 #-PPC-FUN-HACK 363 (inst j lip 0) 326 364 327 365 DO-COMPARE … … 349 387 350 388 (:temp lra descriptor-reg lra-offset) 389 #-PPC-FUN-HACK 390 (:temp lip interior-reg lip-offset) 351 391 (:temp nargs any-reg nargs-offset) 352 392 (:temp ocfp any-reg ocfp-offset)) … … 360 400 RETURN-NIL 361 401 (inst mr res null-tn) 402 #+PPC-FUN-HACK 362 403 (lisp-return lra :offset 2) 404 #-PPC-FUN-HACK 405 (lisp-return lra lip :offset 2) 363 406 364 407 DO-STATIC-FN 408 #+PPC-FUN-HACK 365 409 (inst lwz code-tn null-tn (static-function-offset 'eql)) 410 #-PPC-FUN-HACK 411 (inst lwz lip null-tn (static-function-offset 'eql)) 366 412 (inst li nargs (fixnumize 2)) 367 413 (inst mr ocfp cfp-tn) 368 414 (inst mr cfp-tn csp-tn) 415 #+PPC-FUN-HACK 369 416 (inst j code-tn 370 417 (- (* function-code-offset word-bytes) function-pointer-type)) 418 #-PPC-FUN-HACK 419 (inst j lip 0) 371 420 372 421 RETURN-T … … 386 435 387 436 (:temp lra descriptor-reg lra-offset) 437 #-PPC-FUN-HACK 438 (:temp lip interior-reg lip-offset) 388 439 (:temp nargs any-reg nargs-offset) 389 440 (:temp ocfp any-reg ocfp-offset)) … … 396 447 397 448 (inst mr res null-tn) 449 #+PPC-FUN-HACK 398 450 (lisp-return lra :offset 2) 451 #-PPC-FUN-HACK 452 (lisp-return lra lip :offset 2) 399 453 400 454 DO-STATIC-FN 455 #+PPC-FUN-HACK 401 456 (inst lwz code-tn null-tn (static-function-offset 'two-arg-=)) 457 #-PPC-FUN-HACK 458 (inst lwz lip null-tn (static-function-offset 'two-arg-=)) 402 459 (inst li nargs (fixnumize 2)) 403 460 (inst mr ocfp cfp-tn) 404 461 (inst mr cfp-tn csp-tn) 462 #+PPC-FUN-HACK 405 463 (inst j code-tn 406 464 (- (* function-code-offset word-bytes) function-pointer-type)) 465 #-PPC-FUN-HACK 466 (inst j lip 0) 407 467 408 468 RETURN-T … … 421 481 422 482 (:temp lra descriptor-reg lra-offset) 483 #-PPC-FUN-HACK 484 (:temp lip interior-reg lip-offset) 423 485 (:temp nargs any-reg nargs-offset) 424 486 (:temp ocfp any-reg ocfp-offset)) … … 430 492 431 493 (load-symbol res t) 494 #+PPC-FUN-HACK 432 495 (lisp-return lra :offset 2) 496 #-PPC-FUN-HACK 497 (lisp-return lra lip :offset 2) 433 498 434 499 DO-STATIC-FN 500 #+PPC-FUN-HACK 435 501 (inst lwz code-tn null-tn (static-function-offset 'two-arg-=)) 502 #-PPC-FUN-HACK 503 (inst lwz lip null-tn (static-function-offset 'two-arg-=)) 436 504 (inst li nargs (fixnumize 2)) 437 505 (inst mr ocfp cfp-tn) 506 #+PPC-FUN-HACK 438 507 (inst j code-tn 439 508 (- (* function-code-offset word-bytes) function-pointer-type)) 509 #-PPC-FUN-HACK 510 (inst j lip 0) 440 511 (inst mr cfp-tn csp-tn) 441 512 -
trunk/src/assembly/ppc/assem-rtns.lisp
r9845 r10507 28 28 29 29 ;; These are just needed to facilitate the transfer 30 #-PPC-FUN-HACK 31 (:temp lip interior-reg lip-offset) 30 32 (:temp count any-reg nl2-offset) 31 33 (:temp src any-reg nl3-offset) … … 84 86 85 87 ;; Return. 86 (lisp-return lra)) 88 #+PPC-FUN-HACK 89 (lisp-return lra) 90 #-PPC-FUN-HACK 91 (lisp-return lra lip)) 87 92 88 93 … … 107 112 (:temp count any-reg nl3-offset) 108 113 (:temp temp descriptor-reg l0-offset) 114 #-PPC-FUN-HACK 115 (:temp lip interior-reg lip-offset) 109 116 110 117 ;; These are needed so we can get at the register args. … … 143 150 ;; We are done. Do the jump. 144 151 (loadw temp lexenv vm:closure-function-slot vm:function-pointer-type) 145 (lisp-jump temp)) 152 #+PPC-FUN-HACK 153 (lisp-jump temp) 154 #-PPC-FUN-HACK 155 (lisp-jump temp lip)) 146 156 147 157 … … 157 167 (:arg count (any-reg descriptor-reg) nargs-offset) 158 168 (:temp lra descriptor-reg lra-offset) 169 #-PPC-FUN-HACK 170 (:temp lip interior-reg lip-offset) 159 171 (:temp cur-uwp any-reg nl0-offset) 160 172 (:temp next-uwp any-reg nl1-offset) … … 178 190 (loadw code-tn cur-uwp vm:unwind-block-current-code-slot) 179 191 (loadw lra cur-uwp vm:unwind-block-entry-pc-slot) 192 #+PPC-FUN-HACK 180 193 (lisp-return lra :frob-code nil) 194 #-PPC-FUN-HACK 195 (lisp-return lra lip :frob-code nil) 181 196 182 197 DO-UWP -
trunk/src/assembly/ppc/support.lisp
r8637 r10507 62 62 :sc (sc-or-lose 'descriptor-reg *backend*) 63 63 :offset lra-offset) 64 #-PPC-FUN-HACK 65 (make-random-tn :kind :normal 66 :sc (sc-or-lose 'interior-reg *backend*) 67 :offset lip-offset) 64 68 :offset 2))) 65 69 (:none))) -
trunk/src/compiler/generic/objdef.lisp
r10360 r10602 97 97 (defenum (:suffix -type) 98 98 even-fixnum 99 #- ppc function-pointer #+ppcinstance-pointer99 #-PPC-FUN-HACK function-pointer #+PPC-FUN-HACK instance-pointer 100 100 other-immediate-0 101 101 list-pointer 102 102 odd-fixnum 103 #- ppc instance-pointer #+ppcfunction-pointer103 #-PPC-FUN-HACK instance-pointer #+PPC-FUN-HACK function-pointer 104 104 other-immediate-1 105 105 other-pointer) … … 304 304 :lowtag function-pointer-type 305 305 :header function-header-type) 306 #+ ppc(jump-insn)306 #+PPC-FUN-HACK (jump-insn) 307 307 #-gengc (self :ref-trans %function-self :set-trans (setf %function-self)) 308 308 #+gengc (entry-point :c-type "char *") … … 332 332 (define-primitive-object (closure :lowtag function-pointer-type 333 333 :header closure-header-type) 334 #+ ppc(jump-insn)334 #+PPC-FUN-HACK (jump-insn) 335 335 #-gengc (function :init :arg :ref-trans %closure-function) 336 336 #+gengc (entry-point :c-type "char *") … … 341 341 :header funcallable-instance-header-type 342 342 :alloc-trans %make-funcallable-instance) 343 #+ ppc(jump-insn)343 #+PPC-FUN-HACK (jump-insn) 344 344 #-gengc 345 345 (function … … 467 467 ;;;; Symbols 468 468 469 #+(or gengc sparc x86 amd64 )469 #+(or gengc sparc x86 amd64 ppc) 470 470 (defknown %make-symbol (fixnum simple-string) symbol 471 471 (flushable movable)) 472 472 473 #+(or gengc sparc x86 amd64 )473 #+(or gengc sparc x86 amd64 ppc) 474 474 (defknown symbol-hash (symbol) fixnum 475 475 (flushable movable)) 476 476 477 #+(or gencgc sparc x86 amd64 )477 #+(or gencgc sparc x86 amd64 ppc) 478 478 (defknown %set-symbol-hash (symbol index) 479 479 t (unsafe)) … … 489 489 :header symbol-header-type 490 490 :alloc-trans 491 #-(or gengc x86 amd64 sparc ) make-symbol492 #+(or gengc x86 amd64 sparc ) %make-symbol)491 #-(or gengc x86 amd64 sparc ppc) make-symbol 492 #+(or gengc x86 amd64 sparc ppc) %make-symbol) 493 493 (value :set-trans %set-symbol-value 494 494 :init :unbound) 495 #-(or gengc x86 amd64 sparc ) unused496 #+(or gengc x86 amd64 sparc )495 #-(or gengc x86 amd64 sparc ppc) unused 496 #+(or gengc x86 amd64 sparc ppc) 497 497 (hash :init :arg) 498 498 (plist :ref-trans symbol-plist -
trunk/src/compiler/ppc/alloc.lisp
r10561 r10679 200 200 (:ignore name) 201 201 (:results (result :scs (descriptor-reg))) 202 (:temporary (:scs (any-reg)) bytes header) 202 (:temporary (:scs (any-reg)) bytes) 203 (:temporary (:scs (non-descriptor-reg)) header) 203 204 (:temporary (:sc non-descriptor-reg :offset nl3-offset) pa-flag) 204 205 (:generator 6 -
trunk/src/compiler/ppc/call.lisp
r9851 r10561 142 142 ;;; DISPLACEMENT.) 143 143 ;;; 144 ;;; Duh. PPC Linux (and VxWorks) adhere to the EABI .144 ;;; Duh. PPC Linux (and VxWorks) adhere to the EABI, but Darwin doesn't. 145 145 (defun bytes-needed-for-non-descriptor-stack-frame () 146 (logandc2 (+ 7number-stack-displacement146 (logandc2 (+ +stack-alignment-bytes+ number-stack-displacement 147 147 (* (sb-allocated-size 'non-descriptor-stack) vm:word-bytes)) 148 7))148 +stack-alignment-bytes+)) 149 149 150 150 … … 179 179 (trace-table-entry trace-table-function-prologue) 180 180 (emit-label start-lab) 181 #+PPC-FUN-HACK 181 182 (let* ((entry-label (gen-label))) 182 183 ;; Allocate function header. … … 185 186 (dotimes (i (1- (1- vm:function-code-offset))) 186 187 (inst word 0)) 187 (emit-label entry-label)) 188 ;; The start of the actual code. 189 ;; Fix CODE, cause the function object was passed in. 190 (inst compute-code-from-fn code-tn code-tn start-lab temp) 188 (emit-label entry-label) 189 ;; The start of the actual code. 190 ;; Fix CODE, cause the function object was passed in. 191 (inst compute-code-from-fn code-tn code-tn start-lab temp)) 192 #-PPC-FUN-HACK 193 (let* ((entry-label (gen-label))) 194 ;; Allocate function header. 195 (inst function-header-word) 196 (dotimes (i (1- vm:function-code-offset)) 197 (inst word 0)) 198 (emit-label entry-label) 199 ;; The start of the actual code. 200 (inst compute-code-from-fn code-tn lip-tn entry-label temp)) 191 201 ;; Build our stack frames. 192 202 (inst addi csp-tn cfp-tn … … 359 369 (let ((def (car remaining))) 360 370 (emit-label (car def)) 361 (when (null (cdr remaining))362 (inst b defaulting-done))363 371 (store-stack-tn (cdr def) null-tn))) 372 (inst b defaulting-done) 364 373 (trace-table-entry trace-table-normal)))))) 365 374 … … 698 707 699 708 ,(if named 700 `(:temporary (:sc descriptor-reg :offset cname-offset 709 `(:temporary (:sc descriptor-reg :offset #+PPC-FUN-HACK cname-offset 710 #-PPC-FUN-HACK fdefn-offset 701 711 :from (:argument ,(if (eq return :tail) 0 1)) 702 712 :to :eval) … … 725 735 '((:temporary (:scs (non-descriptor-reg)) temp) 726 736 (:temporary (:sc control-stack :offset nfp-save-offset) nfp-save))) 737 738 (:temporary (:sc interior-reg :offset lip-offset) entry-point) 727 739 728 740 (:generator ,(+ (if named 5 0) … … 808 820 vm:other-pointer-type) 809 821 (do-next-filler))) 822 #+PPC-FUN-HACK 810 823 (loadw function name-pass fdefn-raw-addr-slot 824 other-pointer-type) 825 #-PPC-FUN-HACK 826 (loadw entry-point name-pass fdefn-raw-addr-slot 811 827 other-pointer-type) 812 828 (do-next-filler)) … … 822 838 (loadw function lexenv vm:closure-function-slot 823 839 vm:function-pointer-type) 824 (do-next-filler))) 840 (do-next-filler) 841 #-PPC-FUN-HACK 842 (inst addi entry-point function 843 (- (ash vm:function-code-offset vm:word-shift) 844 vm:function-pointer-type)))) 825 845 (loop 826 846 (if filler … … 829 849 830 850 (note-this-location vop :call-site) 831 (inst mtctr function)832 (inst mr code-tn function)851 (inst mtctr #+PPC-FUN-HACK function #-PPC-FUN-HACK entry-point) 852 #+PPC-FUN-HACK-MAYBE (inst mr code-tn function) 833 853 (inst bctr) 834 854 #| … … 915 935 (value)) 916 936 (:ignore value) 937 #-PPC-FUN-HACK 938 (:temporary (:scs (interior-reg)) lip) 917 939 (:vop-var vop) 918 940 (:generator 6 … … 928 950 (move cfp-tn old-fp) 929 951 ;; Out of here. 952 #+PPC-FUN-HACK 930 953 (lisp-return return-pc :offset 2) 954 #-PPC-FUN-HACK 955 (lisp-return return-pc lip :offset 2) 931 956 (trace-table-entry trace-table-normal))) 932 957 … … 957 982 (:temporary (:sc any-reg :offset nargs-offset) nargs) 958 983 (:temporary (:sc any-reg :offset ocfp-offset) val-ptr) 984 #-PPC-FUN-HACK 985 (:temporary (:scs (interior-reg)) lip) 959 986 (:vop-var vop) 960 987 (:generator 6 … … 971 998 (move cfp-tn old-fp) 972 999 ;; Out of here. 973 (lisp-return return-pc :offset 2)) 1000 #+PPC-FUN-HACK 1001 (lisp-return return-pc :offset 2) 1002 #-PPC-FUN-HACK 1003 (lisp-return return-pc lip :offset 2)) 974 1004 (t 975 1005 ;; Establish the values pointer and values count. … … 985 1015 (move reg null-tn))) 986 1016 ;; And away we go. 987 (lisp-return return-pc))) 1017 #+PPC-FUN-HACK 1018 (lisp-return return-pc) 1019 #-PPC-FUN-HACK 1020 (lisp-return return-pc lip))) 988 1021 (trace-table-entry trace-table-normal))) 989 1022 … … 1005 1038 (:temporary (:sc any-reg :offset nargs-offset :from (:argument 3)) nvals) 1006 1039 (:temporary (:sc descriptor-reg :offset a0-offset) a0) 1040 #-PPC-FUN-HACK 1041 (:temporary (:scs (interior-reg)) lip) 1007 1042 1008 1043 … … 1027 1062 (move csp-tn cfp-tn) 1028 1063 (move cfp-tn old-fp-arg) 1064 #+PPC-FUN-HACK 1029 1065 (lisp-return lra-arg :offset 2) 1066 #-PPC-FUN-HACK 1067 (lisp-return lra-arg lip :offset 2) 1030 1068 1031 1069 ;; Nope, not the single case. … … 1161 1199 (assemble () 1162 1200 ;; Allocate a cons (2 words) for each item. 1163 (inst clrrwi result alloc-tn lowtag-bits)1164 (inst ori result result list-pointer-type)1201 (inst slwi temp count 1) 1202 (allocation result temp list-pointer-type :temp-tn dst) 1165 1203 (move dst result) 1166 (inst slwi temp count 1)1167 (inst add alloc-tn alloc-tn temp)1168 1204 (inst b enter) 1169 1205 -
trunk/src/compiler/ppc/static-fn.lisp
r9845 r10507 27 27 (:temporary (:scs (descriptor-reg)) move-temp) 28 28 (:temporary (:sc descriptor-reg :offset lra-offset) lra) 29 #-PPC-FUN-HACK 30 (:temporary (:sc interior-reg :offset lip-offset) entry-point) 29 31 (:temporary (:scs (descriptor-reg)) func) 30 32 (:temporary (:sc any-reg :offset nargs-offset) nargs) … … 87 89 (cur-nfp (current-nfp-tn vop))) 88 90 ,@(moves (temp-names) (arg-names)) 91 #+PPC-FUN-HACK 89 92 (inst lwz func null-tn (static-function-offset symbol)) 93 #-PPC-FUN-HACK 94 (inst lwz entry-point null-tn (static-function-offset symbol)) 90 95 (inst lr nargs (fixnumize ,num-args)) 91 96 (when cur-nfp … … 95 100 (inst compute-lra-from-code lra code-tn lra-label temp) 96 101 &
