Changeset 12374


Ignore:
Timestamp:
Jul 9, 2009, 6:55:18 AM (10 years ago)
Author:
gb
Message:

New Japanese character encodings cp 932, eucjp from Yoshinori Tahara.
New x8632 large function support (from rme, mostly.)
The latter's a bit hard to bootstrap; new binaries, fasl/image versions
soon.

Location:
trunk/source
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x86-lap.lisp

    r12302 r12374  
    14611461                         (incf nbytes (frag-length frag)))))
    14621462         (code-words (ash code-bytes (- target::word-shift)))
    1463          (function-vector (allocate-typed-vector :function code-words)))
    1464     (declare (fixnum code-bytes code-words))
     1463         (function-vector (allocate-typed-vector :function code-words))
     1464         (nconstants (length constants))
     1465         (ncode code-words))
     1466    (declare (fixnum code-bytes code-words ncode))
     1467    (when name (incf nconstants))
     1468    (when debug-info (incf nconstants))
     1469    (incf nconstants)
     1470    (setq ncode (- code-words nconstants))
     1471
     1472    #+x8632-target
     1473    (when (>= ncode #x8000)
     1474      (if (>= nconstants #x8000)
     1475        (compiler-function-overflow)
     1476        (let* ((buf (car (frag-code-buffer (dll-header-first frag-list))))
     1477               (new-word (logior #x8000 nconstants)))
     1478          (setf (aref buf 0) (ldb (byte 8 0) new-word)
     1479                (aref buf 1) (ldb (byte 8 8) new-word)))))
    14651480    (let* ((target-offset 0))
    14661481      (declare (fixnum target-offset))
     
    14771492        (setf (uvref function-vector (decf last)) (car c)))
    14781493      #+x8632-target
    1479       (if (> last #xffff)
    1480         (compiler-function-overflow)
    1481         (%update-self-references function-vector))
     1494      (%update-self-references function-vector)
    14821495      (function-vector-to-function function-vector))))
    14831496
  • trunk/source/compiler/X86/x86-lapmacros.lisp

    r11088 r12374  
    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))))
  • trunk/source/level-0/X86/X8632/x8632-def.lisp

    r12074 r12374  
    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))
     
    83100    (declare (fixnum code-words numimms))
    84101    (%copy-ivector-to-ivector protov 0 newv 0 (the fixnum (ash code-words target::word-shift)))
     102    #||
     103    ;; XXX bootstrapping
     104    (setf (ldb (byte 16 0) (uvref newv 0)) (logior #x8000 numimms))
     105    ||#
    85106    (%update-self-references newv)
    86107    (do* ((k code-words (1+ k))
     
    105126    (loop for k fixnum from code-words below total-words
    106127      do (setf (%svref newv k) (%svref protov k)))
     128    #||
     129    (setf (ldb (byte 16 0) (uvref newv 0))
     130          (logior #x8000 (- total-words code-words)))
     131    ||#
    107132    (%update-self-references (function-vector-to-function newv))))
    108133
  • trunk/source/lib/compile-ccl.lisp

    r12353 r12374  
    209209    asdf
    210210    defsystem
     211    jp-encode-table
     212    jp-encode
    211213    ))
    212214
  • trunk/source/lib/systems.lisp

    r12300 r12374  
    209209    (prepare-mcl-environment "ccl:bin;prepare-mcl-environment" ("ccl:lib;prepare-mcl-environment.lisp"))
    210210    (defsystem        "ccl:tools;defsystem"      ("ccl:tools;defsystem.lisp"))
    211     (asdf             "ccl:tools;asdf"      ("ccl:tools;asdf.lisp"))))
    212 
     211    (asdf             "ccl:tools;asdf"      ("ccl:tools;asdf.lisp"))
     212    (jp-encode-table  "ccl:bin;jp-encode-table"  ("ccl:library;jp-encode-table.lisp"))
     213    (jp-encode        "ccl:bin;jp-encode"        ("ccl:library;jp-encode.lisp"))))
     214
  • trunk/source/lisp-kernel/x86-gc.c

    r11791 r12374  
    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;
  • trunk/source/lisp-kernel/x86-spentry32.s

    r12362 r12374  
    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(%temp0),%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.