Changeset 15294


Ignore:
Timestamp:
Apr 6, 2012, 1:34:27 AM (8 years ago)
Author:
gb
Message:

Don't call out in .SPbuiltin_eql. Implement #'EQL for ARM in terms
of .SPbuiltin_eql.

Note that running the old kernel with a new image will cause an
infinite loop in EQL in some cases. Don't do that; do
(REBUILD-CCL :FULL T) to avoid the issue.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/ARM/arm-pred.lisp

    r15093 r15294  
    2323  "Return T if OBJ1 and OBJ2 represent the same object, otherwise NIL."
    2424  (check-nargs 2)
    25   @tail
    26   (cmp x y)
    27   (extract-lisptag imm0 x)
    28   (extract-lisptag imm1 y)
    29   (beq @win)
    30   (cmp imm0 (:$ arm::tag-misc))
    31   (cmpeq imm1 (:$ arm::tag-misc))
    32   (bne @lose)
    33   ;; Objects are both of tag-misc.  Headers must match exactly;
    34   ;; dispatch on subtag.
    35   (getvheader imm1 y)
    36   (extract-lowbyte imm2 imm1)
    37   (getvheader imm0 x)
    38   (cmp imm2 (:$ arm::subtag-macptr))
    39   (beq @macptr)
    40   (cmp imm0 imm1)
    41   (bne @lose)
    42   (lri imm1 (logior (ash 1 target::tag-fixnum)
    43                     (ash 1 target::subtag-bignum)
    44                     (ash 1 target::subtag-single-float)
    45                     (ash 1 target::subtag-double-float)
    46                     (ash 1 target::subtag-ratio)
    47                     (ash 1 target::subtag-complex)))
    48   (mov imm0 (:$ 1))
    49   (tst imm1 (:lsl imm0 imm2))
    50   (getvheader imm0 x)
    51   (getvheader imm1 y)
    52   (beq @lose)
    53   (cmp imm2 (:$ arm::subtag-ratio))
    54   (cmpne imm2 (:$ arm::subtag-complex))
    55   (beq @node)
    56   (cmp imm2 (:$ arm::subtag-bignum))
    57   (beq @bignum)
    58   (cmp imm2 (:$ arm::subtag-double-float))
    59   (bne @one-unboxed-word)
    60   ;; This is the double-float case.
    61   (ldr imm0 (:@ x (:$ arm::double-float.val-low)))
    62   (ldr imm1 (:@ y (:$ arm::double-float.val-low)))
    63   (cmp imm0 imm1)
    64   (ldreq imm0 (:@ x (:$ arm::double-float.val-high)))
    65   (ldreq imm1 (:@ y (:$ arm::double-float.val-high)))
    66   (cmpeq imm0 imm1)
    67   (mov arg_z 'nil)
    68   (addeq arg_z arg_z (:$ arm::t-offset))
    69   (bx lr)
    70   @win
    71   (mov arg_z 'nil)
    72   (add arg_z arg_z (:$ arm::t-offset))
    73   (bx lr)
    74   @macptr
    75   (extract-lowbyte imm0 imm0)
    76   (cmp imm2 imm0)
    77   (bne @lose)
    78   @one-unboxed-word
    79   (ldr imm0 (:@ x (:$ arm::misc-data-offset)))
    80   (ldr imm1 (:@ y (:$ arm::misc-data-offset)))
    81   (cmp imm0 imm1)
    82   (beq  @win)
    83   @lose
    84   (mov arg_z 'nil)
    85   (bx lr)
    86   @bignum
    87   ;; Way back when, we got x's header into imm0.  We know that y's
    88   ;; header is identical.  Use the element-count from imm0 to control
    89   ;; the loop.  There's no such thing as a 0-element bignum, so the
    90   ;; loop must always execute at least once.
    91   (header-length temp0 imm0)
    92   (mov imm2 (:$ arm::misc-data-offset))
    93   @bignum-next
    94   (ldr imm0 (:@ x imm2))
    95   (ldr imm1 (:@ y imm2))
    96   (cmp imm0 imm1)
    97   (add imm2 imm2 (:$ arm::node-size))
    98   (bne @lose)
    99   (subs temp0 temp0 '1)
    100   (bne @bignum-next)
    101   (mov arg_z 'nil)
    102   (add arg_z arg_z (:$ arm::t-offset))
    103   (bx lr)
    104   @node
    105   ;; Have either a ratio or a complex.  In either case, corresponding
    106   ;; elements of both objects must be EQL.  Recurse on the first
    107   ;; elements.  If true, tail-call on the second, else fail.
    108   (vpush1 x)
    109   (vpush1 y)
    110   (build-lisp-frame imm0)
    111   (ldr x (:@ x (:$ arm::misc-data-offset)))
    112   (ldr y (:@ y (:$ arm::misc-data-offset)))
    113   (bl @tail)
    114   (cmp arg_z 'nil)
    115   (restore-lisp-frame imm0)
    116   (vpop1 y)
    117   (vpop1 x)
    118   (beq @lose)
    119   (ldr x (:@ x (:$ (+ 4 arm::misc-data-offset))))
    120   (ldr y (:@ y (:$ (+ 4 arm::misc-data-offset))))
    121   (b @tail))
     25  (spjump .SPbuiltin-eql))
    12226
    12327
  • trunk/source/lisp-kernel/arm-spentry.s

    r15258 r15294  
    151151
    152152_spentry(builtin_eql)
    153         __(cmp arg_y,arg_z)
    154         __(beq 1f)
     1530:      __(cmp arg_y,arg_z)
     154        __(beq 8f)
    155155        __(extract_fulltag(imm0,arg_y))
    156156        __(extract_fulltag(imm1,arg_z))
    157157        __(cmp imm0,imm1)
     158        __(bne 9f)
     159        __(cmp imm0,#fulltag_misc)
     160        __(bne 9f)
     161        __(extract_subtag(imm0,arg_y))
     162        __(extract_subtag(imm1,arg_z))
     163        __(cmp imm0,imm1)
     164        __(bne 9f)
     165        __(cmp imm0,#subtag_macptr)
     166        __(cmpne imm0,#subtag_single_float)
     167        __(bne 1f)
     168        __(ldr imm0,[arg_y,#misc_data_offset])
     169        __(ldr imm1,[arg_z,#misc_data_offset])
     170        __(cmp imm0,imm1)
     171        __(mov arg_z,#nil_value)
     172        __(addeq arg_z,arg_z,#t_offset)
     173        __(bx lr)
     1741:      __(cmp imm0,#subtag_double_float)
    158175        __(bne 2f)
    159         __(cmp imm0,#fulltag_misc)
    160         __(bne 2f)
    161         __(jump_builtin(_builtin_eql,2))
    162 1:      __(mov arg_z,#nil_value)
     176        __(ldr imm0,[arg_y,#misc_dfloat_offset])
     177        __(ldr imm1,[arg_z,#misc_dfloat_offset])
     178        __(cmp imm0,imm1)
     179        __(ldreq imm0,[arg_y,#misc_dfloat_offset+node_size])
     180        __(ldreq imm1,[arg_z,#misc_dfloat_offset+node_size])
     181        __(cmpeq imm0,imm1)
     182        __(mov arg_z,#nil_value)
     183        __(addeq arg_z,arg_z,#t_offset)
     184        __(bx lr)
     1852:      __(cmp imm0,#subtag_ratio)
     186        __(cmpne imm0,#subtag_complex)
     187        __(bne 3f)
     188        __(ldr temp0,[arg_y,#ratio.denom])
     189        __(ldr temp1,[arg_z,#ratio.denom])
     190        __(stmdb vsp!,{temp0,temp1})
     191        __(ldr arg_y,[arg_y,#ratio.numer])
     192        __(ldr arg_z,[arg_z,#ratio.numer])
     193        __(build_lisp_frame(imm0))
     194        __(bl 0b)
     195        __(cmp arg_z,#nil_value)
     196        __(restore_lisp_frame(imm0))
     197        __(ldmia vsp!,{arg_z,arg_y})
     198        __(bne 0b)
     199        __(bx lr)
     2003:      __(cmp imm0,#subtag_bignum)
     201        __(bne 9f)
     202        __(getvheader(imm0,arg_y))
     203        __(getvheader(imm1,arg_z))
     204        __(cmp imm0,imm1)
     205        __(bne 9f)
     206        __(header_length(temp0,imm0))
     207        __(mov imm2,#misc_data_offset)
     2084:      __(ldr imm0,[arg_y,imm2])
     209        __(ldr imm1,[arg_z,imm2])
     210        __(cmp imm0,imm1)
     211        __(bne 9f)
     212        __(add imm2,imm2,#node_size)
     213        __(subs temp0,temp0,#fixnumone)
     214        __(bne 4b)               
     2158:      __(mov arg_z,#nil_value)
    163216        __(add arg_z,arg_z,#t_offset)
    164217        __(bx lr)
    165 2:      __(mov arg_z,#nil_value)
     2189:      __(mov arg_z,#nil_value)
    166219        __(bx lr)
    167220       
Note: See TracChangeset for help on using the changeset viewer.