Changeset 13865


Ignore:
Timestamp:
Jun 21, 2010, 4:48:16 PM (9 years ago)
Author:
gb
Message:

arm-vinsns.lisp: shift the right reg left, then shift right logical
in UNBOX-U8. Don't let the compiler clobber nargs in SAVE-LEXPR-ARGREGS.
arm2.lisp: account for entryoint in runtime fixup of forward-referenced
LABELS functions in ARM2-LABELS.
arm-clos.lisp: fixes in the LAP slot getters/setters. (May still be more
bugs here.)
l1-clos-boot: fix ARM slot-reader/writer function creation. #+arm-target
a DBG on NO-APPLICABLE-METHOD.
l1-dcode.lisp: for no real reason, remove an ARM breakpoint on
%%NO-APPLICABLE-METHOD.
arm-spentry.s: Implement _SPsave_values, _SPadd_values, _SPrecover_values.

Location:
branches/arm
Files:
6 edited

Legend:

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

    r13863 r13865  
    11091109(define-arm-vinsn unbox-u8 (((dest :u8))
    11101110                            ((src :lisp)))
    1111   (mov dest (:lsl dest (:$ (- 24 arm::fixnumshift))))
    1112   (mov dest (:asr dest (:$ 24)))
     1111  (mov dest (:lsl src (:$ (- 24 arm::fixnumshift))))
     1112  (mov dest (:lsr dest (:$ 24)))
    11131113  (cmp src (:lsl dest (:$ arm::fixnumshift)))
    11141114  (uuo-error-reg-not-xtype (:? ne) src (:$ arm::xtype-u8)))
     
    28342834     ((entry-vsp (:u32 #.arm::imm1))
    28352835      (arg-temp (:u32 #.arm::imm0))
     2836      (preserve (:u32 #.arm::nargs))
    28362837      (other-temp :imm)))
    28372838  ((:pred >= min-fixed $numarmargregs)
  • branches/arm/compiler/ARM/arm2.lisp

    r13863 r13865  
    69676967        (push v real-vars)
    69686968        (push func real-funcs)
    6969         (let* ((i 2)
     6969        (let* ((i 3)
    69706970               (our-var nil)
    69716971               (item nil))
  • branches/arm/level-0/ARM/arm-clos.lisp

    r13864 r13865  
    3535  (mov imm1 (:$ arm::misc-data-offset))
    3636  (ldrblo imm1 (:@ temp1 imm0))
    37   (movlo imm1 (:lsr imm1 (:$ arm::word-shift)))
     37  (movlo imm1 (:lsl imm1 (:$ arm::word-shift)))
    3838  (addlo imm1 imm1 (:$ arm::misc-data-offset))
    3939  (ldr arg_z (:@ temp0 imm1))
     
    5151  (mov imm1 (:$ arm::misc-data-offset))
    5252  (ldrlo imm1 (:@ temp1 imm0))
    53   (movhi imm1 (:lsr imm1 (:$ arm::word-shift)))
    5453  (addlo imm1 imm1 (:$ arm::misc-data-offset))
    5554  (ldr arg_z (:@ temp0 imm1))
     
    6867  (ldrb imm1 (:@ temp1 imm0))
    6968  (cmp imm1 (:$ 0))
    70   (mov imm1 (:lsr imm1 (:$ arm::word-shift)))
     69  (mov imm1 (:lsl imm1 (:$ arm::word-shift)))
    7170  (add imm1 imm1 (:$ arm::misc-data-offset))
    7271  (beq @missing)
     
    9291  (ldr imm1 (:@ temp1 imm0))
    9392  (cmp imm1 (:$ 0))
    94   (mov imm1 (:lsr imm1 (:$ arm::word-shift)))
    9593  (add imm1 imm1 (:$ arm::misc-data-offset))
    9694  (beq @missing)
     
    112110  (svref temp0 slot-id.index slot-id)
    113111  (getvheader imm0 temp1)
    114   (ldr temp0 (:@ nfn 'table))
    115112  (header-length imm1 imm0)
    116113  (cmp temp0 imm1)
    117114  (mov imm0 (:lsr temp0 (:$ arm::word-shift)))
     115  (ldr temp0 (:@ nfn 'table))
    118116  (add imm0 imm0 (:$ arm::misc-data-offset))
    119117  (bhs @missing)
    120118  (ldrb imm1 (:@ temp1 imm0))
    121119  (cmp imm1 (:$ 0))
    122   (mov imm1 (:lsr imm1 (:$ arm::word-shift)))
     120  (mov imm1 (:lsl imm1 (:$ arm::word-shift)))
    123121  (add imm1 imm1 (:$ arm::misc-data-offset))
    124122  (beq @missing)
     
    148146  (ldr imm1 (:@ temp1 imm0))
    149147  (cmp imm1 (:$ 0))
    150   (mov imm1 (:lsr imm1 (:$ arm::word-shift)))
    151148  (add imm1 imm1 (:$ arm::misc-data-offset))
    152149  (beq @missing)
  • branches/arm/level-1/l1-clos-boot.lisp

    r13863 r13865  
    26342634  (gvector :function
    26352635           arm::*function-initial-entrypoint*
    2636            (uvref *reader-method-function-proto* 0)
     2636           (uvref *reader-method-function-proto* 1)
    26372637           (ensure-slot-id (%slot-definition-name dslotd))
    26382638           'slot-id-value
     
    26602660    (gvector :function
    26612661             arm::*function-initial-entrypoint*
    2662              (uvref *writer-method-function-proto* 0)
     2662             (uvref *writer-method-function-proto* 1)
    26632663             (ensure-slot-id (%slot-definition-name dslotd))
    26642664             'set-slot-id-value
     
    36283628
    36293629(defmethod no-applicable-method (gf &rest args)
     3630  #+arm-target (dbg (cons gf args))
    36303631  (cerror "Try calling it again"
    36313632          "There is no applicable method for the generic function:~%  ~s~%when called with arguments:~%  ~s" gf args)
  • branches/arm/level-1/l1-dcode.lisp

    r13863 r13865  
    751751
    752752(defun %%no-applicable-method (gf args)
    753   #+arm-target (dbg args)
    754753  (if (listp args)
    755754    (apply #'no-applicable-method gf args)
  • branches/arm/lisp-kernel/arm-spentry.s

    r13863 r13865  
    18301830_spentry(unused2)
    18311831
    1832 dnl /* vpush the values in the value set atop the vsp, incrementing nargs.  */
    1833 dnl /* Discard the tsp frame; leave values atop the vsp.  */
    1834 dnl
     1832/* vpush the values in the value set atop the stack, incrementing nargs.  */
     1833
     1834
    18351835_spentry(recover_values)
    1836         __(uuo_debug_trap(al))
    1837 dnl
    1838 dnl /* First, walk the segments reversing the pointer to previous segment pointers  */
    1839 dnl /* Can tell the end because that previous segment pointer is the prev tsp pointer  */
    1840 dnl  __(ldr imm0,[tsp,#tsp_frame.backlink]) /* previous tsp  */
    1841 dnl  __(mov imm1,tsp) /* current segment  */
    1842 dnl  __(mov imm2,tsp) /* last segment  */
    1843 dnl local_label(walkloop):
    1844 dnl  __(ldr imm3,[imm1,#tsp_frame.fixed_overhead+node_size]) /* next segment  */
    1845 dnl  __(cmpr(imm0,imm3)) /* last segment?  */
    1846 dnl  __(str(imm2,tsp_frame.fixed_overhead+node_size(imm1))) /* reverse pointer  */
    1847 dnl  __(mov imm2,imm1) /* last segment <- current segment  */
    1848 dnl  __(mov imm1,imm3) /* current segment <- next segment  */
    1849 dnl  __(bne local_label(walkloop))
    1850 dnl
    1851 dnl         /* the final segment ptr is now in imm2  */
    1852 dnl         /* walk backwards, pushing values on VSP and incrementing NARGS  */
    1853 dnl local_label(pushloop):
    1854 dnl  __(ldr imm0,[imm2,#tsp_frame.data_offset]) /* nargs in segment  */
    1855 dnl  __(cmpri(imm0,0))
    1856 dnl  __(cmpr(cr1,imm2,tsp))
    1857 dnl  __(la imm3,tsp_frame.data_offset+(2*node_size)(imm2))
    1858 dnl  __(add imm3,imm3,imm0)
    1859 dnl  __(add nargs,nargs,imm0)
    1860 dnl  __(b 2f)
    1861 dnl 1:
    1862 dnl  __(ldru(arg_z,-node_size(imm3)))
    1863 dnl  __(cmpri(imm0,fixnum_one))
    1864 dnl  __(subi imm0,imm0,fixnum_one)
    1865 dnl  __(vpush1(arg_z))
    1866 dnl 2:
    1867 dnl  __(bne 1b)
    1868 dnl  __(ldr imm2,[imm2,#tsp_frame.data_offset+node_size]) /* previous segment  */
    1869 dnl  __(bne cr1,local_label(pushloop))
    1870 dnl  __(unlink(tsp))
    1871 dnl  __(bx lr)
    1872 
     1836        __(add temp0,sp,#dnode_size)
     1837        /* Find the oldest set of values by walking links from the newest */
     18380:             
     1839        __(ldr temp1,[temp0,#node_size+4])
     1840        __(cmp temp1,#0)
     1841        __(movne temp0,temp1)
     1842        __(bne 0b)
     18431:      __(ldr imm0,[temp0])
     1844        __(header_length(imm0,imm0))
     1845        __(subs imm0,imm0,#2<<fixnumshift)
     1846        __(add temp1,temp0,#node_size+8)
     1847        __(add temp1,temp1,imm0)
     1848        __(b 3f)
     18492:      __(subs imm0,imm0,#fixnumone)       
     1850        __(ldr arg_z,[temp1,#-node_size]!)
     1851        __(vpush1(arg_z))
     1852        __(add nargs,nargs,#fixnumone)
     18533:      __(bne 2b)
     1854        __(ldr temp0,[temp0,#node_size+4])
     1855        __(cmp temp0,#0)
     1856        __(bne 1b)
     1857        __(ldr sp,[sp,#node_size])
     1858        __(bx lr)
    18731859
    18741860
     
    19971983        __(str temp0,[imm1,#-node_size]!)
    19981984        __(bne 1b)
    1999         2:
     19852:
    20001986        __(mov vsp,imm1)
    20011987        __(bx lr)
    20021988
    2003 dnl /* Build a new TSP area to hold nargs worth of multiple-values.  */
    2004 dnl /* Pop the multiple values off of the vstack.  */
    2005 dnl /* The new TSP frame will look like this:  */
    2006 dnl /*  */
    2007 dnl /*+--------+-------+-------+---------+--------+--------+--------+======+----------+ */
    2008 dnl /*| ptr to | zero  | nargs | ptr to  | valn-1 | valn-2 | val-0  | ???? | prev TSP |  */
    2009 dnl /*|  prev  |       |       |  prev   |        |        |        | fill |          |  */
    2010 dnl /*| TSP    |       |       | segment |        |        |        |      |          | */
    2011 dnl /*+--------+-------+-------+---------+--------+--------+--------+------+----------+  */
    2012 dnl /*  */
    2013 dnl /* e.g., the first multiple value goes in the last cell in the frame, the  */
    2014 dnl /* count of values goes in the first word, and the word after the value count  */
    2015 dnl /* is 0 if the number of values is even (for alignment).  */
    2016 dnl /* Subsequent calls to .SPadd_values preserve this alignment.  */
    2017 dnl /* .SPrecover_values is therefore pretty simple.  */
    2018 dnl
    20191989_spentry(save_values)
    2020         __(uuo_debug_trap(al))
    2021 dnl  __(mov imm1,tsp)
    2022 dnl
    2023 dnl         /* common exit: nargs = values in this set, imm1 = ptr to tsp before  */
    2024 dnl         /* call to save_values  */
    2025 dnl local_label(save_values_to_tsp):
    2026 dnl  __(mov imm2,tsp)
    2027 dnl  __(dnode_align(imm0,nargs,tsp_frame.fixed_overhead+(2*node_size))) /* count, link  */
    2028 dnl  __(TSP_Alloc_Var_Boxed_nz(imm0,imm3))
    2029 dnl  __(str(imm1,tsp_frame.backlink(tsp))) /* keep one tsp "frame" as far as rest of lisp is concerned  */
    2030 dnl  __(str(nargs,tsp_frame.data_offset(tsp)))
    2031 dnl  __(str(imm2,tsp_frame.data_offset+node_size(tsp))) /* previous tsp  */
    2032 dnl  __(la imm3,tsp_frame.data_offset+node_size*2(tsp))
    2033 dnl  __(add imm3,imm3,nargs)
    2034 dnl  __(add imm0,vsp,nargs)
    2035 dnl  __(cmpr(imm0,vsp))
    2036 dnl  __(b 2f)
    2037 dnl 1:
    2038 dnl  __(ldru(arg_z,-node_size(imm0)))
    2039 dnl  __(cmpr(imm0,vsp))
    2040 dnl  __(stru(arg_z,-node_size(imm3)))
    2041 dnl 2:
    2042 dnl  __(bne 1b)
    2043 dnl  __(add vsp,vsp,nargs) /*  discard values  */
    2044 dnl  __(bx lr)
    2045 dnl 
    2046 dnl
    2047 dnl /* Add the multiple values that are on top of the vstack to the set  */
    2048 dnl /* saved in the top tsp frame, popping them off of the vstack in the  */
    2049 dnl /* process.  It is an error (a bad one) if the TSP contains something  */
    2050 dnl /* other than a previously saved set of multiple-values.  */
    2051 dnl /* Since adding to the TSP may cause a new TSP segment to be allocated,  */
    2052 dnl /* each add_values call adds another linked element to the list of  */
    2053 dnl /* values. This makes recover_values harder.  */
    2054 dnl
     1990        __(mov temp1,#0)
     1991        __(mov arg_x,sp)
     1992local_label(save_values_to_tsp):
     1993        __(add imm1,nargs,#node_size*2)
     1994        __(dnode_align(imm0,imm1,node_size))
     1995        __(mov imm1,imm1,lsl #num_subtag_bits-fixnumshift)
     1996        __(orr imm1,imm1,#subtag_u32_vector)
     1997        __(stack_allocate_zeroed_ivector(imm1,imm0))
     1998        __(cmp temp1,$0)
     1999        __(mov imm1,#subtag_simple_vector)
     2000        __(mov arg_y,#stack_alloc_marker)
     2001        __(strb imm1,[sp])
     2002        __(mov temp0,sp)
     2003        __(stmdb sp!,{arg_y,arg_x})
     2004        __(str temp1,[temp0,#node_size])
     2005        __(strne temp0,[temp1,#node_size+4])
     2006        __(add temp0,temp0,#node_size+8)
     2007        __(mov imm0,#0)
     2008        __(b 2f)
     20091:      __(vpop1(temp1))
     2010        __(str temp1,[temp0],#node_size)
     2011        __(add imm0,imm0,#node_size)
     20122:      __(cmp imm0,nargs)
     2013        __(bne 1b)
     2014        __(bx lr)
     2015       
    20552016_spentry(add_values)
    2056         __(uuo_debug_trap(al))
    2057 dnl  __(cmpri(nargs,0))
    2058 dnl  __(ldr imm1,[tsp,#0])
    2059 dnl  __(bne local_label(save_values_to_tsp))
    2060 dnl  __(bx lr)
    2061 dnl         
     2017        __(cmp nargs,#0)
     2018        __(ldr arg_x,[sp,#node_size])
     2019        __(bxeq lr)
     2020        __(add sp,sp,#dnode_size)
     2021        __(mov temp1,sp)
     2022        __(b local_label(save_values_to_tsp))
     2023
    20622024
    20632025/* Like misc_alloc (a LOT like it, since it does most of the work), but takes  */
Note: See TracChangeset for help on using the changeset viewer.