Changeset 13699


Ignore:
Timestamp:
May 14, 2010, 4:49:03 AM (10 years ago)
Author:
gb
Message:

It's early, still.

Location:
branches/arm
Files:
7 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/compiler/ARM/arm-arch.lisp

    r13695 r13699  
    2121
    2222(in-package "ARM")
     23
     24
    2325;;; Lisp registers.
    24 (eval-when (:compile-toplevel :execute)
    25   (defmacro defregs (&body regs)
    26     `(progn
    27        (ccl::defenum () ,@regs)
    28        (defparameter *gpr-register-names* ,(coerce (mapcar #'string regs) 'vector))))
    29   (defmacro deffpregs (&body regs)
    30     `(progn
    31        (ccl::defenum () ,@regs)
    32        (defparameter *fpr-register-names* ,(coerce (mapcar #'string regs) 'vector))))
    33   (defmacro defvregs (&body regs)
    34     `(progn
    35       (ccl::defenum () ,@regs)
    36       (defparameter *vector-register-names* ,(coerce (mapcar #'string regs) 'vector))
    37       )))
    38 
    39 (defregs
    40   imm0                                  ; unboxed, immediate register
    41   imm1
    42   imm2                                  ; doubles as nargs
    43   rcontext                              ; TCR when running lisp
    44   arg_z                                 ; tagged, last arg, primary return value
    45   arg_y                                 ;
    46   arg_x
    47   temp0                                 ; volatile tagged regs
    48   temp1
    49   temp2
    50   vsp                                   ; value stack pointer
    51   fn                                    ; current function
    52   allocptr                              ; for consing
    53   sp                                    ; conventional sp
    54   lr
    55   pc
    56   )
    57 
    58 (deffpregs
    59   fp0
    60   fp1
    61   fp2
    62   fp3
    63   fp4
    64   fp5
    65   fp6
    66   fp7
    67   fp8
    68   fp9
    69   fp10
    70   fp11
    71   fp12
    72   fp13
    73   fp14
    74   fp15
    75   fp16
    76   fp17
    77   fp18
    78   fp19
    79   fp20
    80   fp21
    81   fp22
    82   fp23
    83   fp24
    84   fp25
    85   fp26
    86   fp27
    87   fp28
    88   fp29
    89   fp30
    90   fp31)
    91 
    92 
    93 
    94 
     26
     27
     28
     29(defvar *arm-gprs* (make-hash-table :test #'equalp))
     30
     31(defun get-arm-gpr (name)
     32  (values (gethash (string name)  *arm-gprs*)))
     33
     34
     35(defun define-arm-gpr (name val)
     36  (etypecase val
     37    ((mod 16) (setf (gethash (string name) *arm-gprs*) val))
     38    (symbol (let* ((defined (get-arm-gpr val)))
     39              (if defined
     40                (setf (gethash (string name) *arm-gprs*) defined)
     41                (error "ARM register value ~s not defined" val))))))
     42
     43(defmacro defarmgpr (name val)
     44  `(define-arm-gpr ',name ',val))
     45
     46(defarmgpr r0 0)
     47(defarmgpr r1 1)
     48(defarmgpr r2 2)
     49(defarmgpr r3 3)
     50(defarmgpr r4 4)
     51(defarmgpr r5 5)
     52(defarmgpr r6 6)
     53(defarmgpr r7 7)
     54(defarmgpr r8 8)
     55(defarmgpr r9 9)
     56(defarmgpr r10 10)
     57(defarmgpr r11 11)
     58(defarmgpr r12 12)
     59(defarmgpr r13 13)
     60(defarmgpr r14 14)
     61(defarmgpr r15 15)
     62
     63(defarmgpr imm0 r0)
     64(defarmgpr imm1 r1)
     65(defarmgpr imm2 r2)
     66(defarmgpr rcontext r3)
     67(defarmgpr arg_z r4)
     68(defarmgpr arg_y r5)
     69(defarmgpr arg_x r6)
     70(defarmgpr temp0 r7)
     71(defarmgpr temp1 r8)
     72(defarmgpr temp2 r9)
     73(defarmgpr vsp r10)
     74(defarmgpr fn r11)
     75(defarmgpr allocptr r12)
     76(defarmgpr sp r13)
     77(defarmgpr lr r14)
     78(defarmgpr pc r15)
    9579
    9680;;; Calling sequence may pass additional arguments in temp registers.
    9781;;; "nfn" (new function) is always passed; it's the new value of "fn".
    98 (defconstant nfn temp2)
    99 
     82(defarmgpr nfn temp2)
    10083;;; CLOS may pass the context for, e.g.., CALL-NEXT-METHOD in
    10184;;;; the "next-method-context" register.
    102 (defconstant next-method-context temp1)
    103 
    104 
    105 
    106 (defconstant fname temp3)
     85(defarmgpr next-method-context temp1)
     86
     87(defarmgpr fname temp1)
     88
    10789
    10890
     
    413395
    414396 
    415 )
     397
    416398
    417399(eval-when (:compile-toplevel :load-toplevel :execute)
     
    586568(defconstant max-non-array-node-subtag (logior (ash 18 ntagbits) fulltag-nodeheader))
    587569
     570(define-subtag lisp-frame-marker fulltag-imm 2)
    588571(define-subtag character fulltag-imm 9)
    589 (define-subtag vsp-protect fulltag-imm 7)
    590572(define-subtag slot-unbound fulltag-imm 10)
    591573(defconstant slot-unbound-marker subtag-slot-unbound)
     
    598580(defconstant unbound-marker subtag-unbound)
    599581(defconstant undefined unbound-marker)
    600 
    601 
    602 (defconstant max-64-bit-constant-index (ash (+ #x7fff arm::misc-dfloat-offset) -3))
    603 (defconstant max-32-bit-constant-index (ash (+ #x7fff arm::misc-data-offset) -2))
    604 (defconstant max-16-bit-constant-index (ash (+ #x7fff arm::misc-data-offset) -1))
    605 (defconstant max-8-bit-constant-index (+ #x7fff arm::misc-data-offset))
    606 (defconstant max-1-bit-constant-index (ash (+ #x7fff arm::misc-data-offset) 5))
     582(defconstant lisp-frame-marker subtag-lisp-frame-marker)
     583
     584(defconstant max-64-bit-constant-index (ash (+ #xfff arm::misc-dfloat-offset) -3))
     585(defconstant max-32-bit-constant-index (ash (+ #xfff arm::misc-data-offset) -2))
     586(defconstant max-16-bit-constant-index (ash (+ #xfff arm::misc-data-offset) -1))
     587(defconstant max-8-bit-constant-index (+ #xfff arm::misc-data-offset))
     588(defconstant max-1-bit-constant-index (ash (+ #xfff arm::misc-data-offset) 5))
    607589
    608590
     
    683665  binding-index
    684666)
     667
     668(define-fixedsized-object function
     669  entrypoint
     670  codevector
     671  )
     672
    685673
    686674
     
    860848
    861849(defun %kernel-global (sym)
     850  ;; Returns index relative to (- nil-value fulltag-nil)
    862851  (let* ((pos (position sym arm::*arm-kernel-globals* :test #'string=)))
    863852    (if pos
    864       (- (+ fulltag-nil (* (1+ pos) 4)))
     853      (- (* (1+ pos) 4))
    865854      (error "Unknown kernel global : ~s ." sym))))
    866855
     
    868857  (let* ((pos (position sym arm::*arm-kernel-globals* :test #'string=)))
    869858    (if pos
    870       (- (+ fulltag-nil (* (1+ pos) 4)))
     859      (- (* (1+ pos) 4))
    871860      (error "Unknown kernel global : ~s ." sym))))
    872861
     
    12491238(defconstant arg-check-trap-pc-limit 8)
    12501239
     1240;;; UUO encoding
     1241(defconstant uuo-format-nullary 0)      ; 12 bits of code
     1242(defconstant uuo-format-unary 1)        ; 8 bits of info - NOT type info - 4-bit reg
     1243(defconstant uuo-format-error-lisptag 2) ; 2 bits of lisptag info, 4-bit reg
     1244(defconstant uuo-format-error-fulltag 3) ; 3 bits of fulltag info, 4 bit reg
     1245
     1246(defconstant uuo-format-error-xtype 4)  ; 8 bits of extended type/subtag info, 4 bit reg
     1247(defconstant uuo-format-cerror-lisptag 10) ; continuable, lisptag, reg
     1248(defconstant uuo-format-cerror-fulltag 11) ; continuable, fulltag, reg
     1249(defconstant uuo-format-cerror-xtype 12) ; continuable, xtype, reg         
     1250(defconstant uuo-format-binary 15)      ;  4 bits of code, r1, r0
     1251
    12511252 
    12521253(provide "ARM-ARCH")
Note: See TracChangeset for help on using the changeset viewer.