Changeset 12349


Ignore:
Timestamp:
Jul 2, 2009, 4:16:28 AM (10 years ago)
Author:
rme
Message:

Preliminary bootstrapping changes to support new function scheme on x8632.

Location:
branches/x8632-functions
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/x8632-functions/compiler/X86/X8632/x8632-vinsns.lisp

    r11862 r12349  
    33223322
    33233323(define-x8632-vinsn finalize-closure (((closure :lisp))
    3324                                       ((closure :lisp)))
    3325   (nop))
    3326 
     3324                                      ((closure :lisp))
     3325                                      ((imm :u32)))
     3326  (movl (:@ x8632::misc-header-offset (:%l closure)) (:%l imm))
     3327  (shrl (:$ub x8632::num-subtag-bits) (:%l imm))
     3328  (subl (:$b 6) (:%l imm))              ;compute nconstants
     3329  (orl (:$l #x8000) (:%l imm))          ;XXX bootstrapping
     3330  (movw (:%w imm) (:@ x8632::misc-data-offset (:%l closure))))
    33273331
    33283332(define-x8632-vinsn (ref-symbol-value :call :subprim-call)
  • branches/x8632-functions/compiler/X86/x86-asm.lisp

    r11255 r12349  
    33803380   ))
    33813381
    3382 
    3383 (dotimes (i (length *x86-opcode-templates*))
    3384   (setf (x86-opcode-template-ordinal (svref *x86-opcode-templates* i)) i))
     3382(defun init-opcode-ordinals ()
     3383  (dotimes (i (length *x86-opcode-templates*))
     3384    (setf (x86-opcode-template-ordinal (svref *x86-opcode-templates* i)) i)))
     3385
     3386(init-opcode-ordinals)
    33853387 
    3386 
     3388(format *trace-output* "past opcode ordinals")
    33873389
    33883390(defparameter *x86-opcode-template-lists*
    33893391  (make-hash-table :test #'equalp))
    33903392
     3393(format *trace-output* "past creating opcode template lists")
    33913394
    33923395(defun initialize-x86-opcode-templates ()
  • branches/x8632-functions/compiler/X86/x86-lap.lisp

    r12302 r12349  
    14761476      (dolist (c constants)
    14771477        (setf (uvref function-vector (decf last)) (car c)))
     1478      #+nil
     1479      (format t "~& ~d constants, ~d other junk" (length constants)
     1480              (- (uvsize function-vector) last))
     1481      (setf (ldb (byte 16 0) (uvref function-vector 0))
     1482            (logior #x8000 (- (uvsize function-vector) last)))
    14781483      #+x8632-target
    14791484      (if (> last #xffff)
  • branches/x8632-functions/compiler/X86/x86-lapmacros.lisp

    r11088 r12349  
    629629   (:x8664
    630630    (error "compose-digit on x8664?"))))
     631
     632(defx86lapmacro imm-word-count (fn imm dest)
     633  `(progn
     634     (movzwl (@ x8632::misc-data-offset (% ,fn)) (% ,imm))
     635     (btr ($ 15) (% ,imm))
     636     (vector-length ,fn ,dest)
     637     (box-fixnum ,imm ,imm)
     638     (subl (% ,imm) (% ,dest))))
  • branches/x8632-functions/level-0/X86/X8632/x8632-def.lisp

    r12074 r12349  
    2222(defx8632lapfunction %update-self-references ((fun arg_z))
    2323  (movzwl (@ x8632::misc-data-offset (% fun)) (% imm0)) ;imm word count
     24  (btr ($ 15) (% imm0))
     25  (jnc @proceed)
     26  (imm-word-count fun imm0 temp0)
     27  (subl ($ '2) (% temp0))
     28  (jmp @load-offset)
     29  @proceed
    2430  (subl ($ 2) (% imm0))
    2531  (box-fixnum imm0 temp0)               ;byte offset of first self-ref offset
     
    3743  (trap-unless-typecode= fun x8632::subtag-function)
    3844  (movzwl (@ x8632::misc-data-offset (% fun)) (% imm0))
     45  (btr ($ 15) (% imm0))
     46  (jnc @proceed)
     47  (imm-word-count fun imm0 temp0)
     48  (movl (% temp0) (% arg_z))
     49  (single-value-return)
     50  @proceed
    3951  (box-fixnum imm0 arg_z)
    4052  (single-value-return))
     
    4355  (trap-unless-typecode= fun x8632::subtag-function)
    4456  (movzwl (@ x8632::misc-data-offset (% fun)) (% imm0))
     57  (btr ($ 15) (% imm0))
     58  (jnc @proceed)
     59  (imm-word-count fun imm0 temp0)
     60  (unbox-fixnum temp0 imm0)
     61  @proceed
    4562  (lea (@ (% n) (% imm0) 4) (% imm0))
    4663  (movl (@ x8632::misc-data-offset (% fun) (% imm0)) (% arg_z))
  • branches/x8632-functions/lisp-kernel/x86-gc.c

    r11791 r12349  
    200200#ifdef X8632
    201201        int skip = *(unsigned short *)current;
     202
     203        /* XXX bootstrapping */
     204        if (skip & 0x8000)
     205          skip = elements - (skip & 0x7fff);
    202206#else
    203207        int skip = *(int *)current;
     
    518522#ifdef X8632
    519523        prefix_nodes = (natural) ((unsigned short) deref(base,1));
     524
     525        /* XXX bootstrapping */
     526        if (prefix_nodes & 0x8000)
     527          prefix_nodes = element_count - (prefix_nodes & 0x7fff);
    520528#else
    521529        prefix_nodes = (natural) ((int) deref(base,1));
     
    725733#else
    726734        int code_words = (unsigned short)base[1];
     735
     736        /* XXX bootstrapping */
     737        if (code_words & 0x8000)
     738          code_words = element_count - (code_words & 0x7fff);
    727739#endif
    728740        if (code_words >= nmark) {
     
    948960      subtag = header_subtag(header);
    949961      boundary = base + (unsigned short)base[1];
     962
     963      /* XXX bootstrapping */
     964      {
     965        natural word_count = (unsigned short)base[1];
     966        natural element_count = header_element_count(header);
     967
     968        if (word_count & 0x8000)
     969          boundary = base + element_count - (word_count & 0x7fff);
     970      }
     971
    950972      /*
    951973       * On x8632, the upper 24 bits of the boundary word are zero.
     
    970992      if (subtag == subtag_function) {
    971993        boundary = base + (unsigned short)base[1];
     994        /* XXX bootstrapping */
     995        {
     996          natural word_count = (unsigned short)base[1];
     997          natural element_count = header_element_count(header);
     998
     999          if (word_count & 0x8000)
     1000            boundary = base + element_count - (word_count & 0x7fff);
     1001        }
     1002
    9721003        *((int *)boundary) &= 0xff;
    9731004        *((int *)boundary) |= ((this-((LispObj)boundary)) << 8);
     
    11401171#ifdef X8632
    11411172        int skip = (unsigned short)deref(start,1);
     1173        /* XXX bootstrapping */
     1174        if (skip & 0x8000)
     1175          skip = header_element_count(x1) - (skip & 0x7fff);
    11421176#else
    11431177        int skip = (int) deref(start,1);
     
    13181352      if (subtag == subtag_function) {
    13191353#ifdef X8632
    1320         element_count -= (unsigned short)start[1];
     1354        natural skip = (unsigned short)start[1];
     1355
     1356        /* XXX bootstrapping */
     1357        if (skip & 0x8000)
     1358          skip = element_count - (skip & 0x7fff);
     1359
     1360        element_count -= skip;
     1361
    13211362#else
    13221363        element_count -= (int)start[1];
     
    17091750#ifdef X8632
    17101751          int skip = (unsigned short)(p[1]);
     1752
     1753          /* XXX bootstrapping */
     1754          if (skip & 0x8000)
     1755            skip = header_element_count(node) - (skip & 0x7fff);
     1756
    17111757#else
    17121758          int skip = (int)(p[1]);
     
    18571903  unsigned char *p = (unsigned char *)node;
    18581904  natural i, offset;
     1905  LispObj header = *node;
    18591906
    18601907  i = ((unsigned short *)node)[2];
    18611908  if (i) {
     1909    /* XXX bootstrapping for new scheme */
     1910    if (i & 0x8000) {
     1911      i = header_element_count(header) - (i & 0x7fff);
     1912    }
    18621913    offset = node[--i];
     1914
    18631915    while (offset) {
    18641916      *(LispObj *)(p + offset) = fn;
     
    19331985            int skip = *((unsigned short *)src);
    19341986            LispObj *f = dest;
     1987
     1988            /* XXX bootstrapping for new scheme */
     1989            if (skip & 0x8000)
     1990              skip = elements - (skip & 0x7fff);
    19351991#else
    19361992            int skip = *((int *)src);
     
    22762332#ifdef X8632
    22772333            int skip = (unsigned short)(start[1]);
     2334
     2335            /* XXX bootstrapping */
     2336            if (skip & 0x8000)
     2337              skip = header_element_count(header) - (skip & 0x7fff);
    22782338#else
    22792339            int skip = (int)(start[1]);
     
    25942654        } else {
    25952655          if (header_subtag(header) == subtag_function) {
     2656#ifdef X8632
     2657            int skip = (unsigned short)start[1];
     2658#else
    25962659            int skip = (int)(start[1]);
     2660#endif
    25972661            start += skip;
    25982662            nwords -= skip;
  • branches/x8632-functions/lisp-kernel/x86-spentry32.s

    r12008 r12349  
    346346local_label(misc_ref_function):
    347347        __(movzwl misc_data_offset(%arg_y), %imm0)
     348        /* XXX bootstrapping */
     349        __(btr $15,%imm0)
     350        __(jnc 0f)
     351        __(movl $0xffffff00,%temp0)
     352        __(andl misc_header_offset(%arg_y),%temp0)
     353        __(shr $num_subtag_bits-fixnumshift,%temp0)
     354        __(shl $fixnumshift,%imm0)
     355        __(subl %imm0,%temp0)
     356        __(movl %temp0,%imm0)
     357        __(shr $fixnumshift,%imm0)
     3580:     
    348359        __(shl $fixnumshift,%imm0)
    349360        __(rcmpl(%arg_z,%imm0))
     
    769780        /* (UNSIGNED-BYTE 32), where N is the low 16 bits of the first word. */
    770781        __(movzwl misc_data_offset(%temp0),%imm0)
     782        /* XXX bootstrapping */
     783        __(btr $15,%imm0)
     784        __(jnc 0f)
     785        __(movl $0xffffff00,%temp1)
     786        __(andl misc_header_offset(%arg_y),%temp1)
     787        __(shr $num_subtag_bits-fixnumshift,%temp1)
     788        __(shl $fixnumshift,%imm0)
     789        __(subl %imm0,%temp1)
     790        __(movl %temp1,%imm0)
     791        __(shr $fixnumshift,%imm0)
     7920:
    771793        __(shl $fixnumshift,%imm0)
    772794        __(rcmpl(%arg_y,%imm0))
     
    22402262        /* for each declared keyword. */
    22412263        __(movzwl misc_data_offset(%fn),%imm0)
     2264        /* XXX bootstrapping */
     2265        __(btr $15,%imm0)
     2266        __(jnc 0f)
     2267        __(vector_length(%fn,%arg_y))
     2268        __(box_fixnum(%imm0,%imm0))
     2269        __(subl %imm0,%arg_y)
     2270        __(movl %arg_y,%imm0)
     2271        __(shrl $fixnumshift,%imm0)
     22720:
    22422273        __(movl misc_data_offset(%fn,%imm0,node_size),%arg_y)
    22432274        __(vector_length(%arg_y,%imm0))
     
    23802411local_label(no_keyword_values):
    23812412        __(movzwl misc_data_offset(%fn),%imm0)
     2413        /* XXX bootstrapping */
     2414        __(btr $15,%imm0)
     2415        __(jnc 9f)
     2416        __(vector_length(%fn,%arg_y))
     2417        __(box_fixnum(%imm0,%imm0))
     2418        __(subl %imm0,%arg_y)
     2419        __(movl %arg_y,%imm0)
     2420        __(shrl $fixnumshift,%imm0)
     24219:
    23822422        __(movl misc_data_offset(%fn,%imm0,node_size),%arg_y)
    23832423        __(vector_length(%arg_y,%arg_z))
Note: See TracChangeset for help on using the changeset viewer.