Home | History | Annotate | Line # | Download | only in arc
lib1funcs.S revision 1.1.1.7
      1 ; libgcc1 routines for Synopsys DesignWare ARC cpu.
      2 
      3 /* Copyright (C) 1995-2019 Free Software Foundation, Inc.
      4    Contributor: Joern Rennecke <joern.rennecke (at) embecosm.com>
      5 		on behalf of Synopsys Inc.
      6 
      7 This file is part of GCC.
      8 
      9 GCC is free software; you can redistribute it and/or modify it under
     10 the terms of the GNU General Public License as published by the Free
     11 Software Foundation; either version 3, or (at your option) any later
     12 version.
     13 
     14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
     16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     17 for more details.
     18 
     19 Under Section 7 of GPL version 3, you are granted additional
     20 permissions described in the GCC Runtime Library Exception, version
     21 3.1, as published by the Free Software Foundation.
     22 
     23 You should have received a copy of the GNU General Public License and
     24 a copy of the GCC Runtime Library Exception along with this program;
     25 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     26 <http://www.gnu.org/licenses/>.  */
     27 
     28 /* As a special exception, if you link this library with other files,
     29    some of which are compiled with GCC, to produce an executable,
     30    this library does not by itself cause the resulting executable
     31    to be covered by the GNU General Public License.
     32    This exception does not however invalidate any other reasons why
     33    the executable file might be covered by the GNU General Public License.  */
     34 
     35 
     36  /* ANSI concatenation macros.  */
     37 
     38  #define CONCAT1(a, b) CONCAT2(a, b)
     39  #define CONCAT2(a, b) a ## b
     40 
     41  /* Use the right prefix for global labels.  */
     42 
     43  #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
     44 
     45 #ifndef WORKING_ASSEMBLER
     46 #define abs_l abs
     47 #define asl_l asl
     48 #define mov_l mov
     49 #endif
     50 
     51 #define FUNC(X)         .type SYM(X),@function
     52 #define HIDDEN_FUNC(X)	FUNC(X)` .hidden X
     53 #define ENDFUNC0(X)     .Lfe_##X: .size X,.Lfe_##X-X
     54 #define ENDFUNC(X)      ENDFUNC0(X)
     55 
     56 
     57 
     58 #ifdef  L_mulsi3
     59 	.section .text
     60 	.align 4
     61 
     62 	.global SYM(__mulsi3)
     63 SYM(__mulsi3):
     64 
     65 /* This the simple version.
     66 
     67   while (a)
     68     {
     69       if (a & 1)
     70 	r += b;
     71       a >>= 1;
     72       b <<= 1;
     73     }
     74 */
     75 
     76 #if defined (__ARC_MUL64__)
     77 	FUNC(__mulsi3)
     78 	mulu64 r0,r1
     79 	j_s.d [blink]
     80 	mov_s r0,mlo
     81 	ENDFUNC(__mulsi3)
     82 #elif defined (__ARC_MPY__)
     83 	HIDDEN_FUNC(__mulsi3)
     84 	mpyu	r0,r0,r1
     85 	nop_s
     86 	j_s	[blink]
     87 	ENDFUNC(__mulsi3)
     88 #elif defined (__ARC_NORM__)
     89 	FUNC(__mulsi3)
     90 	norm.f	r2,r0
     91 	rsub	lp_count,r2,31
     92 	mov.mi	lp_count,32
     93 	mov_s	r2,r0
     94 	mov_s	r0,0
     95 	lpnz	@.Lend		; loop is aligned
     96 	lsr.f	r2,r2
     97 	add.cs	r0,r0,r1
     98 	add_s	r1,r1,r1
     99 .Lend:	j_s [blink]
    100 	ENDFUNC(__mulsi3)
    101 #elif !defined (__OPTIMIZE_SIZE__) && defined (__ARC_BARREL_SHIFTER__)
    102 	/* Up to 3.5 times faster than the simpler code below, but larger.  */
    103 	FUNC(__mulsi3)
    104 	ror.f	r2,r0,4
    105 	mov_s	r0,0
    106 	add3.mi	r0,r0,r1
    107 	asl.f	r2,r2,2
    108 	add2.cs	r0,r0,r1
    109 	jeq_s	[blink]
    110 .Loop:
    111 	add1.mi	r0,r0,r1
    112 	asl.f	r2,r2,2
    113 	add.cs	r0,r0,r1
    114 	asl_s	r1,r1,4
    115 	ror.f	r2,r2,8
    116 	add3.mi	r0,r0,r1
    117 	asl.f	r2,r2,2
    118 	bne.d	.Loop
    119 	add2.cs	r0,r0,r1
    120 	j_s	[blink]
    121 	ENDFUNC(__mulsi3)
    122 #elif !defined (__OPTIMIZE_SIZE__) /* __ARC601__ */
    123 	FUNC(__mulsi3)
    124 	lsr.f r2,r0
    125 	mov_s r0,0
    126 	mov_s r3,0
    127 	add.cs r0,r0,r1
    128 .Loop:
    129 	lsr.f r2,r2
    130 	add1.cs r0,r0,r1
    131 	lsr.f r2,r2
    132 	add2.cs r0,r0,r1
    133 	lsr.f r2,r2
    134 	add3.cs r0,r0,r1
    135 	bne.d .Loop
    136 	add3 r1,r3,r1
    137 	j_s	[blink]
    138 	ENDFUNC(__mulsi3)
    139 #else
    140 /********************************************************/
    141 	FUNC(__mulsi3)
    142 	mov_s r2,0		; Accumulate result here.
    143 .Lloop:
    144 	bbit0 r0,0,@.Ly
    145 	add_s r2,r2,r1		; r += b
    146 .Ly:
    147 	lsr_s r0,r0		; a >>= 1
    148 	asl_s r1,r1		; b <<= 1
    149 	brne_s r0,0,@.Lloop
    150 .Ldone:
    151 	j_s.d [blink]
    152 	mov_s r0,r2
    153 	ENDFUNC(__mulsi3)
    154 /********************************************************/
    155 #endif
    156 
    157 #endif /* L_mulsi3 */
    158 
    159 #ifdef  L_umulsidi3
    160 	.section .text
    161 	.align 4
    162 
    163 	.global SYM(__umulsidi3)
    164 SYM(__umulsidi3):
    165 	HIDDEN_FUNC(__umulsidi3)
    166 /* We need ARC700 /ARC_MUL64 definitions of __umulsidi3 / __umulsi3_highpart
    167    in case some code has been compiled without multiply support enabled,
    168    but linked with the multiply-support enabled libraries.
    169    For ARC601 (i.e. without a barrel shifter), we also use umuldisi3 as our
    170    umulsi3_highpart implementation; the use of the latter label doesn't
    171    actually benefit ARC601 platforms, but is useful when ARC601 code is linked
    172    against other libraries.  */
    173 #if defined (__ARC_MPY__) || defined (__ARC_MUL64__) \
    174 	|| !defined (__ARC_BARREL_SHIFTER__)
    175 	.global SYM(__umulsi3_highpart)
    176 SYM(__umulsi3_highpart):
    177 	HIDDEN_FUNC(__umulsi3_highpart)
    178 #endif
    179 
    180 /* This the simple version.
    181 
    182   while (a)
    183     {
    184       if (a & 1)
    185 	r += b;
    186       a >>= 1;
    187       b <<= 1;
    188     }
    189 */
    190 #include "ieee-754/arc-ieee-754.h"
    191 
    192 #ifdef __ARC_MPY__
    193 	mov_s	r12,DBL0L
    194 	mpyu	DBL0L,r12,DBL0H
    195 	j_s.d	[blink]
    196 	MPYHU	DBL0H,r12,DBL0H
    197 #elif defined (__ARC_MUL64__)
    198 /* Likewise for __ARC_MUL64__ */
    199 	mulu64 r0,r1
    200 	mov_s DBL0L,mlo
    201 	j_s.d [blink]
    202 	mov_s DBL0H,mhi
    203 #else /* !__ARC_MPY__ && !__ARC_MUL64__ */
    204 /* Although it might look tempting to extend this to handle muldi3,
    205    using mulsi3 twice with 2.25 cycles per 32 bit add is faster
    206    than one loop with 3 or four cycles per 32 bit add.  */
    207 	asl.f r12,0		; Top part of b.
    208 	mov_s r2,0		; Accumulate result here.
    209 	bbit1.d r0,0,@.Ladd
    210 	mov_s r3,0
    211 .Llooptst:
    212 	rlc r12,r12
    213 	breq r0,0,@.Ldone	; while (a)
    214 .Lloop:
    215 	asl.f r1,r1		; b <<= 1
    216 	bbit0.d r0,1,@.Llooptst
    217 	lsr r0,r0		; a >>= 1
    218 	rlc r12,r12
    219 .Ladd:
    220 	add.f r3,r3,r1	; r += b
    221 	brne.d r0,0,@.Lloop	; while (a);
    222 	adc   r2,r2,r12
    223 .Ldone:
    224 	mov_s DBL0L,r3
    225 	j_s.d [blink]
    226 	mov DBL0H,r2
    227 #endif /* !__ARC_MPY__*/
    228 	ENDFUNC(__umulsidi3)
    229 #if defined (__ARC_MPY__) || defined (__ARC_MUL64__) \
    230 	|| !defined (__ARC_BARREL_SHIFTER__)
    231 	ENDFUNC(__umulsi3_highpart)
    232 #endif
    233 #endif /* L_umulsidi3 */
    234 
    235 #ifdef L_muldi3
    236 	.section .text
    237 	.align 4
    238 	.global SYM(__muldi3)
    239 SYM(__muldi3):
    240 #ifdef __LITTLE_ENDIAN__
    241         push_s blink
    242         mov_s r4,r3     ;4
    243         mov_s r5,r2     ;4
    244         mov_s r9,r0     ;4
    245         mov_s r8,r1     ;4
    246         bl.d @__umulsidi3
    247         mov_s r1,r2     ;4
    248         mov_s r6,r0     ;4
    249         mov_s r7,r1     ;4
    250         mov_s r0,r9     ;4
    251         bl.d @__mulsi3
    252         mov_s r1,r4     ;4
    253         mov_s r4,r0     ;4
    254         mov_s r1,r8     ;4
    255         bl.d @__mulsi3
    256         mov_s r0,r5     ;4
    257         pop_s blink
    258         add_s r0,r0,r4 ;2
    259         add r1,r0,r7
    260         j_s.d [blink]
    261         mov_s r0,r6     ;4
    262 #else
    263 	push_s  blink
    264 	mov_s   r5,r3
    265 	mov_s   r9,r2
    266 	mov_s   r4,r1
    267 	mov_s   r8,r0
    268 	mov_s   r0,r1
    269 	bl.d 	@__umulsidi3
    270 	mov_s   r1,r3
    271 	mov_s   r7,r0
    272 	mov_s   r6,r1
    273 	mov_s   r0,r4
    274 	bl.d    @__mulsi3
    275 	mov_s   r1,r9
    276 	mov_s   r4,r0
    277 	mov_s   r1,r8
    278 	bl.d    @__mulsi3
    279 	mov_s   r0,r5
    280 	pop_s   blink
    281 	add_s   r0,r0,r4
    282 	add_s   r0,r0,r7
    283 	j_s.d   [blink]
    284 	mov_s   r1,r6
    285 #endif /* __LITTLE_ENDIAN__ */
    286 ENDFUNC(__muldi3)
    287 #endif /* L_muldi3 */
    288 
    289 #ifdef  L_umulsi3_highpart
    290 #include "ieee-754/arc-ieee-754.h"
    291 /* For use without a barrel shifter, and for ARC700 / ARC_MUL64, the
    292    mulsidi3 algorithms above look better, so for these, there is an
    293    extra label up there.  */
    294 #if !defined (__ARC_MPY__) && !defined (__ARC_MUL64__) \
    295 	&& defined (__ARC_BARREL_SHIFTER__)
    296 	.global SYM(__umulsi3_highpart)
    297 SYM(__umulsi3_highpart):
    298 	HIDDEN_FUNC(__umulsi3_highpart)
    299 	mov_s r2,0
    300 	mov_s r3,32
    301 .Loop:
    302 	lsr.f r0,r0
    303 	add.cs.f r2,r2,r1
    304 	sub_s r3,r3,1
    305 	brne.d r0,0,.Loop
    306 	rrc r2,r2
    307 	j_s.d	[blink]
    308 /* Make the result register peephole-compatible with mulsidi3.  */
    309 	lsr DBL0H,r2,r3
    310 	ENDFUNC(__umulsi3_highpart)
    311 #endif /* !__ARC_MPY__  && __ARC_BARREL_SHIFTER__ */
    312 #endif /* L_umulsi3_highpart */
    313 
    314 #ifdef L_divmod_tools
    315 
    316 ; Utilities used by all routines.
    317 
    318 	.section .text
    319 
    320 /*
    321 unsigned long
    322 udivmodsi4(int modwanted, unsigned long num, unsigned long den)
    323 {
    324   unsigned long bit = 1;
    325   unsigned long res = 0;
    326 
    327   while (den < num && bit && !(den & (1L<<31)))
    328     {
    329       den <<=1;
    330       bit <<=1;
    331     }
    332   while (bit)
    333     {
    334       if (num >= den)
    335 	{
    336 	  num -= den;
    337 	  res |= bit;
    338 	}
    339       bit >>=1;
    340       den >>=1;
    341     }
    342   if (modwanted) return num;
    343   return res;
    344 }
    345 */
    346 
    347 ; inputs: r0 = numerator, r1 = denominator
    348 ; outputs: r0 = quotient, r1 = remainder, r2/r3 trashed
    349 
    350 	.balign 4
    351 	.global SYM(__udivmodsi4)
    352 	FUNC(__udivmodsi4)
    353 SYM(__udivmodsi4):
    354 
    355 #if defined (__ARC_EA__)
    356 /* Normalize divisor and divident, and then use the appropriate number of
    357    divaw (the number of result bits, or one more) to produce the result.
    358    There are some special conditions that need to be tested:
    359    - We can only directly normalize unsigned numbers that fit in 31 bit.  For
    360      the divisor, we test early on that it is not 'negative'.
    361    - divaw can't corrrectly process a divident that is larger than the divisor.
    362      We handle this be checking that the divident prior to normalization is
    363      not larger than the normalized divisor.  As we then already know then
    364      that the divisor fits 31 bit, this check also makes sure that the
    365      divident fits.
    366    - ordinary normalization of the divident could make it larger than the
    367      normalized divisor, which again would be unsuitable for divaw.
    368      Thus, we want to shift left the divident by one less, except that we
    369      want to leave it alone if it is already 31 bit.  To this end, we
    370      double the input to norm with adds.
    371    - If the divident has less bits than the divisor, that would leave us
    372      with a negative number of divaw to execute.  Although we could use a
    373      conditional loop to avoid excess divaw, and then the quotient could
    374      be extracted correctly as there'd be more than enough zero bits, the
    375      remainder would be shifted left too far, requiring a conditional shift
    376      right.  The cost of that shift and the possible mispredict on the
    377      conditional loop cost as much as putting in an early check for a zero
    378      result.  */
    379 	bmsk	r3,r0,29
    380 	brne.d	r3,r0,.Large_dividend
    381 	norm.f	r2,r1
    382 	brlo	r0,r1,.Lret0
    383 	norm	r3,r0
    384 	asl_s	r1,r1,r2
    385 	sub_s	r3,r3,1
    386 	asl_l	r0,r0,r3	; not short to keep loop aligned
    387 	sub	lp_count,r2,r3
    388 	lp	.Ldiv_end
    389 	divaw	r0,r0,r1
    390 .Ldiv_end:sub_s	r3,r2,1
    391 	lsr	r1,r0,r2
    392 	j_s.d	[blink]
    393 	bmsk	r0,r0,r3
    394 
    395 	.balign 4
    396 .Large_dividend:
    397 	bmi	.Ltrivial
    398 	asl_s	r1,r1,r2
    399 	mov_s	r3,0
    400 	sub1.f	r4,r0,r1
    401 	mov.lo	r4,r0
    402 	mov.hs	r3,2
    403 	cmp	r4,r1
    404 	sub.hs	r4,r4,r1
    405 	add.hs	r3,r3,1
    406 	mov.f	lp_count,r2
    407 	lpne	.Ldiv_end2
    408 	divaw	r4,r4,r1
    409 .Ldiv_end2:asl	r0,r3,r2
    410 	lsr	r1,r4,r2
    411 	sub_s	r2,r2,1
    412 	bmsk	r4,r4,r2
    413 	j_s.d	[blink]
    414 	or.ne	r0,r0,r4
    415 
    416 .Lret0:
    417 	mov_s	r1,r0
    418 	j_s.d	[blink]
    419 	mov_l	r0,0
    420 	.balign	4
    421 .Ltrivial:
    422 	sub.f	r1,r0,r1
    423 	mov.c	r1,r0
    424 	mov_s	r0,1
    425 	j_s.d	[blink]
    426 	mov.c	r0,0
    427 #elif !defined (__OPTIMIZE_SIZE__) && !defined (__ARC_RF16__)
    428 #if defined (__ARC_NORM__) && defined (__ARC_BARREL_SHIFTER__)
    429 	lsr_s r2,r0
    430 	brhs.d r1,r2,.Lret0_3
    431 	norm r2,r2
    432 	norm r3,r1
    433 	sub_s r3,r3,r2
    434 	asl_s r1,r1,r3
    435 	sub1.f 0,r0,r1
    436 	lsr.cs r1,r1,1
    437 	sbc r2,r3,0
    438 	sub1 r0,r0,r1
    439 	cmp_s r0,r1
    440 	mov.f lp_count,r2
    441 #else /* ! __ARC_NORM__ */
    442 	lsr_s r2,r0
    443 	brhs.d r1,r2,.Lret0_3
    444 	mov lp_count,32
    445 .Lloop1:
    446 	asl_s r1,r1		; den <<= 1
    447 	brls.d r1,r2,@.Lloop1
    448 	sub lp_count,lp_count,1
    449 	sub_s r0,r0,r1
    450 	lsr_s r1,r1
    451 	cmp_s r0,r1
    452 	xor.f r2,lp_count,31
    453 #if !defined (__ARCEM__) && !defined (__ARCHS__)
    454 	mov_s lp_count,r2
    455 #else
    456 	mov lp_count,r2
    457 	nop_s
    458 #endif /* !__ARCEM__ && !__ARCHS__ */
    459 #endif /* !__ARC_NORM__ */
    460 	sub.cc r0,r0,r1
    461 	mov_s r3,3
    462 	sbc r3,r3,0
    463 #if defined (__ARC_BARREL_SHIFTER__)
    464 	asl_s r3,r3,r2
    465 	rsub r1,r1,1
    466 	lpne @.Lloop2_end
    467 	add1.f r0,r1,r0
    468 	sub.cc r0,r0,r1
    469 .Lloop2_end:
    470 	lsr r1,r0,r2
    471 #else
    472 	rsub r1,r1,1
    473 	lpne @.Lloop2_end
    474 	asl_s r3,r3
    475 	add1.f r0,r1,r0
    476 	sub.cc r0,r0,r1
    477 .Lloop2_end:
    478 	lsr_s r1,r0
    479 	lsr.f lp_count,r2
    480 	mov.cc r1,r0
    481 	lpnz 1f
    482 	lsr_s r1,r1
    483 	lsr_s r1,r1
    484 1:
    485 #endif
    486 	bmsk r0,r0,r2
    487 	bclr r0,r0,r2
    488 	j_s.d [blink]
    489 	or_s r0,r0,r3
    490 .Lret0_3:
    491 #if 0 /* Slightly shorter, but slower.  */
    492 	lp .Loop3_end
    493 	brhi.d r1,r0,.Loop3_end
    494 	sub_s r0,r0,r1
    495 .Loop3_end
    496 	add_s r1,r1,r0
    497 	j_s.d [blink]
    498 	rsub r0,lp_count,32-1
    499 #else
    500 	mov_s r4,r1
    501 	sub.f r1,r0,r1
    502 	sbc r0,r0,r0
    503 	sub.cc.f r1,r1,r4
    504 	sbc r0,r0,0
    505 	sub.cc.f r1,r1,r4
    506 	sbc r0,r0,-3
    507 	j_s.d [blink]
    508 	add.cs r1,r1,r4
    509 #endif
    510 #else /* Arctangent-A5 */
    511 	breq_s r1,0,@.Ldivmodend
    512 	mov_s r2,1		; bit = 1
    513 	mov_s r3,0		; res = 0
    514 .Lloop1:
    515 	brhs r1,r0,@.Lloop2
    516 	bbit1 r1,31,@.Lloop2
    517 	asl_s r1,r1		; den <<= 1
    518 	b.d @.Lloop1
    519 	asl_s r2,r2		; bit <<= 1
    520 .Lloop2:
    521 	brlo r0,r1,@.Lshiftdown
    522 	sub_s r0,r0,r1		; num -= den
    523 	or_s r3,r3,r2		; res |= bit
    524 .Lshiftdown:
    525 	lsr_s r2,r2		; bit >>= 1
    526 	lsr_s r1,r1		; den >>= 1
    527 	brne_s r2,0,@.Lloop2
    528 .Ldivmodend:
    529 	mov_s r1,r0		; r1 = mod
    530 	j.d [blink]
    531 	mov_s r0,r3		; r0 = res
    532 /******************************************************/
    533 #endif
    534 	ENDFUNC(__udivmodsi4)
    535 
    536 #endif
    537 
    538 #ifdef  L_udivsi3
    539 	.section .text
    540 	.align 4
    541 
    542 	.global SYM(__udivsi3)
    543 	FUNC(__udivsi3)
    544 SYM(__udivsi3):
    545 	b @SYM(__udivmodsi4)
    546 	ENDFUNC(__udivsi3)
    547 #if 0 /* interferes with linux loader */
    548 	.section .__arc_profile_forward, "a"
    549 	.long SYM(__udivsi3)
    550 	.long SYM(__udivmodsi4)
    551 	.long 65536
    552 #endif
    553 
    554 #endif /* L_udivsi3 */
    555 
    556 #ifdef  L_divsi3
    557 	.section .text
    558 	.align 4
    559 
    560 	.global SYM(__divsi3)
    561 	FUNC(__divsi3)
    562 
    563 #ifndef __ARC_EA__
    564 SYM(__divsi3):
    565 	/* A5 / ARC60? */
    566 	mov r12,blink
    567 	xor r11,r0,r1
    568 	abs_s r0,r0
    569 	bl.d @SYM(__udivmodsi4)
    570 	abs_s r1,r1
    571 	tst r11,r11
    572 	j.d [r12]
    573 	neg.mi r0,r0
    574 #else 	/* !ifndef __ARC_EA__ */
    575 	;; We can use the abs, norm, divaw and mpy instructions for ARC700
    576 #define MULDIV
    577 #ifdef MULDIV
    578 /* This table has been generated by divtab-arc700.c.  */
    579 /* 1/512 .. 1/256, normalized.  There is a leading 1 in bit 31.
    580    For powers of two, we list unnormalized numbers instead.  The values
    581    for powers of 2 are loaded, but not used.  The value for 1 is actually
    582    the first instruction after .Lmuldiv.  */
    583 	.balign 4
    584 .Ldivtab:
    585 
    586 	.long	0x1000000
    587 	.long	0x80808081
    588 	.long	0x81020409
    589 	.long	0x81848DA9
    590 	.long	0x82082083
    591 	.long	0x828CBFBF
    592 	.long	0x83126E98
    593 	.long	0x83993053
    594 	.long	0x84210843
    595 	.long	0x84A9F9C9
    596 	.long	0x85340854
    597 	.long	0x85BF3762
    598 	.long	0x864B8A7E
    599 	.long	0x86D90545
    600 	.long	0x8767AB60
    601 	.long	0x87F78088
    602 	.long	0x88888889
    603 	.long	0x891AC73B
    604 	.long	0x89AE408A
    605 	.long	0x8A42F871
    606 	.long	0x8AD8F2FC
    607 	.long	0x8B70344B
    608 	.long	0x8C08C08D
    609 	.long	0x8CA29C05
    610 	.long	0x8D3DCB09
    611 	.long	0x8DDA5203
    612 	.long	0x8E78356E
    613 	.long	0x8F1779DA
    614 	.long	0x8FB823EF
    615 	.long	0x905A3864
    616 	.long	0x90FDBC0A
    617 	.long	0x91A2B3C5
    618 	.long	0x92492493
    619 	.long	0x92F11385
    620 	.long	0x939A85C5
    621 	.long	0x94458095
    622 	.long	0x94F20950
    623 	.long	0x95A02569
    624 	.long	0x964FDA6D
    625 	.long	0x97012E03
    626 	.long	0x97B425EE
    627 	.long	0x9868C80A
    628 	.long	0x991F1A52
    629 	.long	0x99D722DB
    630 	.long	0x9A90E7DA
    631 	.long	0x9B4C6F9F
    632 	.long	0x9C09C09D
    633 	.long	0x9CC8E161
    634 	.long	0x9D89D89E
    635 	.long	0x9E4CAD24
    636 	.long	0x9F1165E8
    637 	.long	0x9FD809FE
    638 	.long	0xA0A0A0A1
    639 	.long	0xA16B312F
    640 	.long	0xA237C32C
    641 	.long	0xA3065E40
    642 	.long	0xA3D70A3E
    643 	.long	0xA4A9CF1E
    644 	.long	0xA57EB503
    645 	.long	0xA655C43A
    646 	.long	0xA72F053A
    647 	.long	0xA80A80A9
    648 	.long	0xA8E83F58
    649 	.long	0xA9C84A48
    650 	.long	0xAAAAAAAB
    651 	.long	0xAB8F69E3
    652 	.long	0xAC769185
    653 	.long	0xAD602B59
    654 	.long	0xAE4C415D
    655 	.long	0xAF3ADDC7
    656 	.long	0xB02C0B03
    657 	.long	0xB11FD3B9
    658 	.long	0xB21642C9
    659 	.long	0xB30F6353
    660 	.long	0xB40B40B5
    661 	.long	0xB509E68B
    662 	.long	0xB60B60B7
    663 	.long	0xB70FBB5B
    664 	.long	0xB81702E1
    665 	.long	0xB92143FB
    666 	.long	0xBA2E8BA3
    667 	.long	0xBB3EE722
    668 	.long	0xBC52640C
    669 	.long	0xBD691048
    670 	.long	0xBE82FA0C
    671 	.long	0xBFA02FE9
    672 	.long	0xC0C0C0C1
    673 	.long	0xC1E4BBD6
    674 	.long	0xC30C30C4
    675 	.long	0xC4372F86
    676 	.long	0xC565C87C
    677 	.long	0xC6980C6A
    678 	.long	0xC7CE0C7D
    679 	.long	0xC907DA4F
    680 	.long	0xCA4587E7
    681 	.long	0xCB8727C1
    682 	.long	0xCCCCCCCD
    683 	.long	0xCE168A78
    684 	.long	0xCF6474A9
    685 	.long	0xD0B69FCC
    686 	.long	0xD20D20D3
    687 	.long	0xD3680D37
    688 	.long	0xD4C77B04
    689 	.long	0xD62B80D7
    690 	.long	0xD79435E6
    691 	.long	0xD901B204
    692 	.long	0xDA740DA8
    693 	.long	0xDBEB61EF
    694 	.long	0xDD67C8A7
    695 	.long	0xDEE95C4D
    696 	.long	0xE070381D
    697 	.long	0xE1FC780F
    698 	.long	0xE38E38E4
    699 	.long	0xE525982B
    700 	.long	0xE6C2B449
    701 	.long	0xE865AC7C
    702 	.long	0xEA0EA0EB
    703 	.long	0xEBBDB2A6
    704 	.long	0xED7303B6
    705 	.long	0xEF2EB720
    706 	.long	0xF0F0F0F1
    707 	.long	0xF2B9D649
    708 	.long	0xF4898D60
    709 	.long	0xF6603D99
    710 	.long	0xF83E0F84
    711 	.long	0xFA232CF3
    712 	.long	0xFC0FC0FD
    713 	.long	0xFE03F810
    714 	.long	0x2000000
    715 	.long	0x81020409
    716 	.long	0x82082083
    717 	.long	0x83126E98
    718 	.long	0x84210843
    719 	.long	0x85340854
    720 	.long	0x864B8A7E
    721 	.long	0x8767AB60
    722 	.long	0x88888889
    723 	.long	0x89AE408A
    724 	.long	0x8AD8F2FC
    725 	.long	0x8C08C08D
    726 	.long	0x8D3DCB09
    727 	.long	0x8E78356E
    728 	.long	0x8FB823EF
    729 	.long	0x90FDBC0A
    730 	.long	0x92492493
    731 	.long	0x939A85C5
    732 	.long	0x94F20950
    733 	.long	0x964FDA6D
    734 	.long	0x97B425EE
    735 	.long	0x991F1A52
    736 	.long	0x9A90E7DA
    737 	.long	0x9C09C09D
    738 	.long	0x9D89D89E
    739 	.long	0x9F1165E8
    740 	.long	0xA0A0A0A1
    741 	.long	0xA237C32C
    742 	.long	0xA3D70A3E
    743 	.long	0xA57EB503
    744 	.long	0xA72F053A
    745 	.long	0xA8E83F58
    746 	.long	0xAAAAAAAB
    747 	.long	0xAC769185
    748 	.long	0xAE4C415D
    749 	.long	0xB02C0B03
    750 	.long	0xB21642C9
    751 	.long	0xB40B40B5
    752 	.long	0xB60B60B7
    753 	.long	0xB81702E1
    754 	.long	0xBA2E8BA3
    755 	.long	0xBC52640C
    756 	.long	0xBE82FA0C
    757 	.long	0xC0C0C0C1
    758 	.long	0xC30C30C4
    759 	.long	0xC565C87C
    760 	.long	0xC7CE0C7D
    761 	.long	0xCA4587E7
    762 	.long	0xCCCCCCCD
    763 	.long	0xCF6474A9
    764 	.long	0xD20D20D3
    765 	.long	0xD4C77B04
    766 	.long	0xD79435E6
    767 	.long	0xDA740DA8
    768 	.long	0xDD67C8A7
    769 	.long	0xE070381D
    770 	.long	0xE38E38E4
    771 	.long	0xE6C2B449
    772 	.long	0xEA0EA0EB
    773 	.long	0xED7303B6
    774 	.long	0xF0F0F0F1
    775 	.long	0xF4898D60
    776 	.long	0xF83E0F84
    777 	.long	0xFC0FC0FD
    778 	.long	0x4000000
    779 	.long	0x82082083
    780 	.long	0x84210843
    781 	.long	0x864B8A7E
    782 	.long	0x88888889
    783 	.long	0x8AD8F2FC
    784 	.long	0x8D3DCB09
    785 	.long	0x8FB823EF
    786 	.long	0x92492493
    787 	.long	0x94F20950
    788 	.long	0x97B425EE
    789 	.long	0x9A90E7DA
    790 	.long	0x9D89D89E
    791 	.long	0xA0A0A0A1
    792 	.long	0xA3D70A3E
    793 	.long	0xA72F053A
    794 	.long	0xAAAAAAAB
    795 	.long	0xAE4C415D
    796 	.long	0xB21642C9
    797 	.long	0xB60B60B7
    798 	.long	0xBA2E8BA3
    799 	.long	0xBE82FA0C
    800 	.long	0xC30C30C4
    801 	.long	0xC7CE0C7D
    802 	.long	0xCCCCCCCD
    803 	.long	0xD20D20D3
    804 	.long	0xD79435E6
    805 	.long	0xDD67C8A7
    806 	.long	0xE38E38E4
    807 	.long	0xEA0EA0EB
    808 	.long	0xF0F0F0F1
    809 	.long	0xF83E0F84
    810 	.long	0x8000000
    811 	.long	0x84210843
    812 	.long	0x88888889
    813 	.long	0x8D3DCB09
    814 	.long	0x92492493
    815 	.long	0x97B425EE
    816 	.long	0x9D89D89E
    817 	.long	0xA3D70A3E
    818 	.long	0xAAAAAAAB
    819 	.long	0xB21642C9
    820 	.long	0xBA2E8BA3
    821 	.long	0xC30C30C4
    822 	.long	0xCCCCCCCD
    823 	.long	0xD79435E6
    824 	.long	0xE38E38E4
    825 	.long	0xF0F0F0F1
    826 	.long	0x10000000
    827 	.long	0x88888889
    828 	.long	0x92492493
    829 	.long	0x9D89D89E
    830 	.long	0xAAAAAAAB
    831 	.long	0xBA2E8BA3
    832 	.long	0xCCCCCCCD
    833 	.long	0xE38E38E4
    834 	.long	0x20000000
    835 	.long	0x92492493
    836 	.long	0xAAAAAAAB
    837 	.long	0xCCCCCCCD
    838 	.long	0x40000000
    839 	.long	0xAAAAAAAB
    840 	.long	0x80000000
    841 __muldiv:
    842 	neg	r4,r2
    843 	ld.as	r5,[pcl,r4]
    844 	abs_s	r12,r0
    845 	bic.f	0,r2,r4
    846 	mpyhu.ne r12,r12,r5
    847 	norm	r3,r2
    848 	xor.f	0,r0,r1
    849 	; write port allocation stall
    850 	rsub	r3,r3,30
    851 	lsr	r0,r12,r3
    852 	j_s.d	[blink]
    853 	neg.mi	r0,r0
    854 
    855 	.balign	4
    856 SYM(__divsi3):
    857 	norm	r3,r1
    858 	abs_s	r2,r1
    859 	brhs	r3,23,__muldiv
    860 	norm	r4,r0
    861 	abs_l	r12,r0
    862 	brhs	r4,r3,.Lonebit
    863 	asl_s	r2,r2,r3
    864 	asl	r12,r12,r4
    865 	sub	lp_count,r3,r4
    866 	sub.f	r12,r12,r2
    867 	brge.d	r12,r2,.Lsbit
    868 	sub	r4,r3,r4
    869 	add.lo	r12,r12,r2
    870 	lp	.Ldivend
    871 .Ldivstart:divaw r12,r12,r2
    872 .Ldivend:xor_s	r1,r1,r0
    873 	sub	r0,r4,1
    874 	bmsk	r0,r12,r0
    875 	bset.hs	r0,r0,r4
    876 	tst_s	r1,r1
    877 	j_s.d	[blink]
    878 	neg.mi	r0,r0
    879 .Lonebit:
    880 	xor_s	r1,r1,r0
    881 	asr_s	r1,r1,31
    882 	sub1.f	0,r12,r2	; special case:	-2**(n+1) / 2**n
    883 	or	r0,r1,1
    884 	add.eq	r0,r0,r0
    885 	cmp_s	r12,r2
    886 	j_s.d	[blink]
    887 	mov.lo	r0,0
    888 .Lsbit:
    889 	; Need to handle special cases involving negative powers of two:
    890 	; r12,r2 are normalized dividend / divisor;
    891 	; divide anything by 0x80000000, or divide 0x80000000 by 0x40000000
    892 	add_s	r12,r12,r2
    893 	xor_s	r1,r1,r0
    894 	rsub	r4,r4,-1
    895 	ror	r0,r12,r4
    896 	tst_s	r2,r2
    897 	bmsk	r0,r0,r3
    898 	add.pl	r0,r0,r0
    899 	tst_s	r1,r1
    900 	j_s.d	[blink]
    901 	neg.mi	r0,r0
    902 #else /* !MULDIV */
    903 /* This version requires that divaw works with a divisor of 0x80000000U  */
    904 	abs_s	r2,r1
    905 	norm	r4,r0
    906 	neg_s	r3,r2
    907 	norm	r3,r3
    908 	abs_s	r12,r0
    909 	brhs	r4,r3,.Lonebit
    910 	asl_s	r2,r2,r3
    911 	asl	r12,r12,r4
    912 	sub	lp_count,r3,r4
    913 	cmp_s	r12,r2
    914 	sub.hs	r12,r12,r2
    915 	lp	.Ldivend
    916 .Ldivstart:divaw r12,r12,r2
    917 .Ldivend:xor_s	r1,r1,r0
    918 	sub_s	r0,r3,1
    919 	bmsk	r0,r12,r0
    920 	bset.hs	r0,r0,r3
    921 	tst_s	r1,r1
    922 	j_s.d	[blink]
    923 	negmi	r0,r0
    924 .Lonebit:
    925 	xor_s	r1,r1,r0
    926 	asr_s	r1,r1,31
    927 	cmp_s	r12,r2
    928 	mov_s	r0,0
    929 	j_s.d	[blink]
    930 	orhs	r0,r1,1
    931 #endif /* MULDIV */
    932 
    933 #endif	/* ifndef __ARC700__ */
    934 	ENDFUNC(__divsi3)
    935 
    936 
    937 #endif /* L_divsi3 */
    938 
    939 #ifdef  L_umodsi3
    940 	.section .text
    941 	.align 4
    942 
    943 	.global SYM(__umodsi3)
    944 	FUNC(__umodsi3)
    945 SYM(__umodsi3):
    946 	mov r7,blink
    947 	bl.nd @SYM(__udivmodsi4)
    948 	j.d [r7]
    949 	mov r0,r1
    950 	ENDFUNC(__umodsi3)
    951 #if 0 /* interferes with linux loader */
    952 	.section .__arc_profile_forward, "a"
    953 	.long SYM(__umodsi3)
    954 	.long SYM(__udivmodsi4)
    955 	.long 65536
    956 #endif
    957 
    958 #endif /* L_umodsi3 */
    959 
    960 #ifdef  L_modsi3
    961 	.section .text
    962 	.align 4
    963 
    964 	.global SYM (__modsi3)
    965 	FUNC(__modsi3)
    966 SYM(__modsi3):
    967 #ifndef __ARC_EA__
    968 	/* A5 / ARC60? */
    969 	mov_s r12,blink
    970 	mov_s r11,r0
    971 	abs_s r0,r0
    972 	bl.d @SYM(__udivmodsi4)
    973 	abs_s r1,r1
    974 	tst r11,r11
    975 	neg_s r0,r1
    976 	j_s.d [r12]
    977 	mov.pl r0,r1
    978 #else /* __ARC_EA__ */
    979 	abs_s	r2,r1
    980 	norm.f	r4,r0
    981 	neg	r5,r2
    982 	norm	r3,r5
    983 	abs_l	r12,r0
    984 	brhs	r4,r3,.Lonebit
    985 	asl_s	r2,r2,r3
    986 	asl	r12,r12,r4
    987 	sub	lp_count,r3,r4
    988 	cmp_s	r12,r2
    989 	sub.hs	r12,r12,r2
    990 	tst_s	r0,r0
    991 	lp	.Ldivend
    992 .Ldivstart:divaw r12,r12,r2
    993 .Ldivend:
    994 	lsr	r0,r12,r3
    995 	j_s.d	[blink]
    996 	neg.mi	r0,r0
    997 	.balign	4
    998 .Lonebit:neg.pl	r5,r5
    999 	cmp_s	r12,r2
   1000 	j_s.d	[blink]
   1001 	sub.hs	r0,r0,r5
   1002 #endif /* !__ARC_EA__ */
   1003 	ENDFUNC(__modsi3)
   1004 
   1005 #endif /* L_modsi3 */
   1006 
   1007 #ifdef L_clzsi2
   1008        .section .text
   1009        .align 4
   1010        .global SYM (__clzsi2)
   1011 SYM(__clzsi2):
   1012 #ifdef __ARC_NORM__
   1013 	HIDDEN_FUNC(__clzsi2)
   1014 	norm.f	r0,r0
   1015 	mov.n	r0,0
   1016 	j_s.d	[blink]
   1017 	add.pl	r0,r0,1
   1018 	ENDFUNC(__clzsi2)
   1019 #elif !defined (__ARC_BARREL_SHIFTER__)
   1020 	FUNC(__clzsi2)
   1021 	mov lp_count,10
   1022 	mov_l r1,0
   1023 	bset r2,r1,29
   1024 	lp .Loop_end
   1025 	brhs r0,r2,.Loop_end
   1026 	add3 r0,r1,r0
   1027 .Loop_end:
   1028 	asl.f 0,r0
   1029 	sub2 r0,lp_count,lp_count
   1030 	sub.cs.f r0,r0,1
   1031 	add r0,r0,31
   1032 	j_s.d [blink]
   1033 	add.pl r0,r0,1
   1034 	ENDFUNC(__clzsi2)
   1035 #else
   1036 	FUNC(__clzsi2)
   1037 	asl.f 0,r0,2
   1038 	mov r1,-1
   1039 .Lcheck:
   1040 	bbit1.d r0,31,.Ldone
   1041 	asl.pl r0,r0,3
   1042 	bcs.d .Ldone_1
   1043 	add_s r1,r1,3
   1044 	bpnz.d .Lcheck
   1045 	asl.f 0,r0,2
   1046 	mov_s r0,32
   1047 	j_s.d [blink]
   1048 	mov.ne r0,r1
   1049 .Ldone:
   1050 	j_s.d [blink]
   1051 	add_s r0,r1,1
   1052 .Ldone_1:
   1053 	j_s.d [blink]
   1054 	sub_s r0,r1,1
   1055 	ENDFUNC(__clzsi2)
   1056 #endif
   1057 #endif /* L_clzsi2 */
   1058        .section .text
   1059 
   1060 
   1061 ;;; MILLICODE THUNK LIB ;***************
   1062 
   1063 ;;; 	.macro push_regs from, to, offset
   1064 ;;; 		st_s "\from", [sp, \offset]
   1065 ;;; 		.if \to-\from
   1066 ;;; 			push_regs "(\from+1)", \to, "(\offset+4)"
   1067 ;;; 		.endif
   1068 ;;; 	.endm
   1069 ;;; 	push_regs 13, 18, 0
   1070 ;;;
   1071 
   1072 ;;;;   	.macro sum from, to, three
   1073 ;;;;   		.long \from
   1074 ;;;;   		.long \three
   1075 ;;;;   		.local regno
   1076 ;;;;   		.set regno, \from+1
   1077 ;;;;   		.set shift, 32
   1078 ;;;;   		.set shift, shift - 1
   1079 ;;;;   #		st_s %shift @3 lsl #shift
   1080 ;;;;   		.if \to-\from
   1081 ;;;;   		sum "(\from+1)", \to, "(\three)"
   1082 ;;;;   		.endif
   1083 ;;;;   	.endm
   1084 ;;;;
   1085 ;;;;   	SUM 0,5, 9
   1086 ;;;;
   1087 ;	.altmacro
   1088 ;;  	.macro push_regs from=0, to=3, offset
   1089 ;;  		st_s r\from, [sp, \offset]
   1090 ;;  		.if \to-\from
   1091 ;;  			push_regs "\from+1 ",\to,"(\offset+4)"
   1092 ;;  		.endif
   1093 ;;  	.endm
   1094 ;;
   1095 ;;  	.macro expand_to_push from=13, to
   1096 ;;  ;		.section .text
   1097 ;;  ;		.align 4
   1098 ;;  ;		.global st_
   1099 ;;  ;		.type foo,
   1100 ;;  	st_13_to_25:
   1101 ;;  ;		push_regs \from, \to, 0
   1102 ;;  	push_regs 0,3		;
   1103 ;;  	.endm
   1104 ;;
   1105 ;;  	expand_to_push 13,18
   1106 ;;
   1107 ;#endif
   1108 
   1109 #ifdef L_millicodethunk_st
   1110 	.section .text
   1111 	.align 4
   1112 	.global SYM(__st_r13_to_r15)
   1113 	.global SYM(__st_r13_to_r16)
   1114 	.global SYM(__st_r13_to_r17)
   1115 	.global SYM(__st_r13_to_r18)
   1116 	.global SYM(__st_r13_to_r19)
   1117 	.global SYM(__st_r13_to_r20)
   1118 	.global SYM(__st_r13_to_r21)
   1119 	.global SYM(__st_r13_to_r22)
   1120 	.global SYM(__st_r13_to_r23)
   1121 	.global SYM(__st_r13_to_r24)
   1122 	.global SYM(__st_r13_to_r25)
   1123 	HIDDEN_FUNC(__st_r13_to_r15)
   1124 	HIDDEN_FUNC(__st_r13_to_r16)
   1125 	HIDDEN_FUNC(__st_r13_to_r17)
   1126 	HIDDEN_FUNC(__st_r13_to_r18)
   1127 	HIDDEN_FUNC(__st_r13_to_r19)
   1128 	HIDDEN_FUNC(__st_r13_to_r20)
   1129 	HIDDEN_FUNC(__st_r13_to_r21)
   1130 	HIDDEN_FUNC(__st_r13_to_r22)
   1131 	HIDDEN_FUNC(__st_r13_to_r23)
   1132 	HIDDEN_FUNC(__st_r13_to_r24)
   1133 	HIDDEN_FUNC(__st_r13_to_r25)
   1134 	.align 4
   1135 SYM(__st_r13_to_r25):
   1136 	st r25, [sp,48]
   1137 SYM(__st_r13_to_r24):
   1138 	st r24, [sp,44]
   1139 SYM(__st_r13_to_r23):
   1140 	st r23, [sp,40]
   1141 SYM(__st_r13_to_r22):
   1142 	st r22, [sp,36]
   1143 SYM(__st_r13_to_r21):
   1144 	st r21, [sp,32]
   1145 SYM(__st_r13_to_r20):
   1146 	st r20, [sp,28]
   1147 SYM(__st_r13_to_r19):
   1148 	st r19, [sp,24]
   1149 SYM(__st_r13_to_r18):
   1150 	st r18, [sp,20]
   1151 SYM(__st_r13_to_r17):
   1152 	st r17, [sp,16]
   1153 SYM(__st_r13_to_r16):
   1154 	st r16, [sp,12]
   1155 SYM(__st_r13_to_r15):
   1156 #ifdef __ARC700__
   1157 	st r15, [sp,8] ; minimum function size to avoid stall: 6 bytes.
   1158 #else
   1159 	st_s r15, [sp,8]
   1160 #endif
   1161 	st_s r14, [sp,4]
   1162 	j_s.d [%blink]
   1163 	st_s r13, [sp,0]
   1164 	ENDFUNC(__st_r13_to_r15)
   1165 	ENDFUNC(__st_r13_to_r16)
   1166 	ENDFUNC(__st_r13_to_r17)
   1167 	ENDFUNC(__st_r13_to_r18)
   1168 	ENDFUNC(__st_r13_to_r19)
   1169 	ENDFUNC(__st_r13_to_r20)
   1170 	ENDFUNC(__st_r13_to_r21)
   1171 	ENDFUNC(__st_r13_to_r22)
   1172 	ENDFUNC(__st_r13_to_r23)
   1173 	ENDFUNC(__st_r13_to_r24)
   1174 	ENDFUNC(__st_r13_to_r25)
   1175 #endif  /* L_millicodethunk_st */
   1176 
   1177 
   1178 #ifdef L_millicodethunk_ld
   1179 	.section .text
   1180 	.align 4
   1181 ;	==================================
   1182 ;	the loads
   1183 
   1184 	.global SYM(__ld_r13_to_r15)
   1185 	.global SYM(__ld_r13_to_r16)
   1186 	.global SYM(__ld_r13_to_r17)
   1187 	.global SYM(__ld_r13_to_r18)
   1188 	.global SYM(__ld_r13_to_r19)
   1189 	.global SYM(__ld_r13_to_r20)
   1190 	.global SYM(__ld_r13_to_r21)
   1191 	.global SYM(__ld_r13_to_r22)
   1192 	.global SYM(__ld_r13_to_r23)
   1193 	.global SYM(__ld_r13_to_r24)
   1194 	.global SYM(__ld_r13_to_r25)
   1195 	HIDDEN_FUNC(__ld_r13_to_r15)
   1196 	HIDDEN_FUNC(__ld_r13_to_r16)
   1197 	HIDDEN_FUNC(__ld_r13_to_r17)
   1198 	HIDDEN_FUNC(__ld_r13_to_r18)
   1199 	HIDDEN_FUNC(__ld_r13_to_r19)
   1200 	HIDDEN_FUNC(__ld_r13_to_r20)
   1201 	HIDDEN_FUNC(__ld_r13_to_r21)
   1202 	HIDDEN_FUNC(__ld_r13_to_r22)
   1203 	HIDDEN_FUNC(__ld_r13_to_r23)
   1204 	HIDDEN_FUNC(__ld_r13_to_r24)
   1205 	HIDDEN_FUNC(__ld_r13_to_r25)
   1206 SYM(__ld_r13_to_r25):
   1207 	ld r25, [sp,48]
   1208 SYM(__ld_r13_to_r24):
   1209 	ld r24, [sp,44]
   1210 SYM(__ld_r13_to_r23):
   1211 	ld r23, [sp,40]
   1212 SYM(__ld_r13_to_r22):
   1213 	ld r22, [sp,36]
   1214 SYM(__ld_r13_to_r21):
   1215 	ld r21, [sp,32]
   1216 SYM(__ld_r13_to_r20):
   1217 	ld r20, [sp,28]
   1218 SYM(__ld_r13_to_r19):
   1219 	ld r19, [sp,24]
   1220 SYM(__ld_r13_to_r18):
   1221 	ld r18, [sp,20]
   1222 SYM(__ld_r13_to_r17):
   1223 	ld r17, [sp,16]
   1224 SYM(__ld_r13_to_r16):
   1225 	ld r16, [sp,12]
   1226 SYM(__ld_r13_to_r15):
   1227 #ifdef __ARC700__
   1228 	ld r15, [sp,8] ; minimum function size to avoid stall: 6 bytes.
   1229 #else
   1230 	ld_s r15, [sp,8]
   1231 #endif
   1232 	ld_s r14, [sp,4]
   1233 	j_s.d [%blink]
   1234 	ld_s r13, [sp,0]
   1235 	ENDFUNC(__ld_r13_to_r15)
   1236 	ENDFUNC(__ld_r13_to_r16)
   1237 	ENDFUNC(__ld_r13_to_r17)
   1238 	ENDFUNC(__ld_r13_to_r18)
   1239 	ENDFUNC(__ld_r13_to_r19)
   1240 	ENDFUNC(__ld_r13_to_r20)
   1241 	ENDFUNC(__ld_r13_to_r21)
   1242 	ENDFUNC(__ld_r13_to_r22)
   1243 	ENDFUNC(__ld_r13_to_r23)
   1244 	ENDFUNC(__ld_r13_to_r24)
   1245 	ENDFUNC(__ld_r13_to_r25)
   1246 
   1247 #endif /* L_millicodethunk_ld */
   1248 #ifdef L_millicodethunk_ret
   1249 	.global SYM(__ld_r13_to_r14_ret)
   1250 	.global SYM(__ld_r13_to_r15_ret)
   1251 	.global SYM(__ld_r13_to_r16_ret)
   1252 	.global SYM(__ld_r13_to_r17_ret)
   1253 	.global SYM(__ld_r13_to_r18_ret)
   1254 	.global SYM(__ld_r13_to_r19_ret)
   1255 	.global SYM(__ld_r13_to_r20_ret)
   1256 	.global SYM(__ld_r13_to_r21_ret)
   1257 	.global SYM(__ld_r13_to_r22_ret)
   1258 	.global SYM(__ld_r13_to_r23_ret)
   1259 	.global SYM(__ld_r13_to_r24_ret)
   1260 	.global SYM(__ld_r13_to_r25_ret)
   1261 	HIDDEN_FUNC(__ld_r13_to_r14_ret)
   1262 	HIDDEN_FUNC(__ld_r13_to_r15_ret)
   1263 	HIDDEN_FUNC(__ld_r13_to_r16_ret)
   1264 	HIDDEN_FUNC(__ld_r13_to_r17_ret)
   1265 	HIDDEN_FUNC(__ld_r13_to_r18_ret)
   1266 	HIDDEN_FUNC(__ld_r13_to_r19_ret)
   1267 	HIDDEN_FUNC(__ld_r13_to_r20_ret)
   1268 	HIDDEN_FUNC(__ld_r13_to_r21_ret)
   1269 	HIDDEN_FUNC(__ld_r13_to_r22_ret)
   1270 	HIDDEN_FUNC(__ld_r13_to_r23_ret)
   1271 	HIDDEN_FUNC(__ld_r13_to_r24_ret)
   1272 	HIDDEN_FUNC(__ld_r13_to_r25_ret)
   1273 	.section .text
   1274 	.align 4
   1275 SYM(__ld_r13_to_r25_ret):
   1276 	ld r25, [sp,48]
   1277 SYM(__ld_r13_to_r24_ret):
   1278 	ld r24, [sp,44]
   1279 SYM(__ld_r13_to_r23_ret):
   1280 	ld r23, [sp,40]
   1281 SYM(__ld_r13_to_r22_ret):
   1282 	ld r22, [sp,36]
   1283 SYM(__ld_r13_to_r21_ret):
   1284 	ld r21, [sp,32]
   1285 SYM(__ld_r13_to_r20_ret):
   1286 	ld r20, [sp,28]
   1287 SYM(__ld_r13_to_r19_ret):
   1288 	ld r19, [sp,24]
   1289 SYM(__ld_r13_to_r18_ret):
   1290 	ld r18, [sp,20]
   1291 SYM(__ld_r13_to_r17_ret):
   1292 	ld r17, [sp,16]
   1293 SYM(__ld_r13_to_r16_ret):
   1294 	ld r16, [sp,12]
   1295 SYM(__ld_r13_to_r15_ret):
   1296 	ld r15, [sp,8]
   1297 SYM(__ld_r13_to_r14_ret):
   1298 	ld blink,[sp,r12]
   1299 	ld_s r14, [sp,4]
   1300 	ld.ab r13, [sp,r12]
   1301 	j_s.d [%blink]
   1302 	add_s sp,sp,4
   1303 	ENDFUNC(__ld_r13_to_r14_ret)
   1304 	ENDFUNC(__ld_r13_to_r15_ret)
   1305 	ENDFUNC(__ld_r13_to_r16_ret)
   1306 	ENDFUNC(__ld_r13_to_r17_ret)
   1307 	ENDFUNC(__ld_r13_to_r18_ret)
   1308 	ENDFUNC(__ld_r13_to_r19_ret)
   1309 	ENDFUNC(__ld_r13_to_r20_ret)
   1310 	ENDFUNC(__ld_r13_to_r21_ret)
   1311 	ENDFUNC(__ld_r13_to_r22_ret)
   1312 	ENDFUNC(__ld_r13_to_r23_ret)
   1313 	ENDFUNC(__ld_r13_to_r24_ret)
   1314 	ENDFUNC(__ld_r13_to_r25_ret)
   1315 
   1316 #endif /* L_millicodethunk_ret */
   1317 
   1318 #define ARC_OPTFPE (defined (__ARC700__) || defined (__ARC_FPX_QUARK__))
   1319 
   1320 #if ARC_OPTFPE
   1321 #ifdef  L_adddf3
   1322 #ifdef __ARC_NORM__
   1323 #include "ieee-754/adddf3.S"
   1324 #endif
   1325 #endif
   1326 
   1327 #ifdef  L_muldf3
   1328 #ifdef __ARC_MPY__
   1329 #include "ieee-754/muldf3.S"
   1330 #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__)
   1331 #include "ieee-754/arc600-mul64/muldf3.S"
   1332 #elif defined (__ARC_NORM__) && defined(__ARC_MUL32BY16__)
   1333 #include "ieee-754/arc600-dsp/muldf3.S"
   1334 #endif
   1335 #endif
   1336 
   1337 #ifdef  L_addsf3
   1338 #ifdef __ARC_NORM__
   1339 #include "ieee-754/addsf3.S"
   1340 #endif
   1341 #endif
   1342 
   1343 #ifdef  L_mulsf3
   1344 #ifdef  __ARC_MPY__
   1345 #include "ieee-754/mulsf3.S"
   1346 #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__)
   1347 #include "ieee-754/arc600-mul64/mulsf3.S"
   1348 #elif defined (__ARC_NORM__) && defined(__ARC_MUL32BY16__)
   1349 #include "ieee-754/arc600-dsp/mulsf3.S"
   1350 #elif defined (__ARC_NORM__)
   1351 #include "ieee-754/arc600/mulsf3.S"
   1352 #endif
   1353 #endif
   1354 
   1355 #ifdef  L_divdf3
   1356 #ifdef  __ARC_MPY__
   1357 #include "ieee-754/divdf3.S"
   1358 #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__)
   1359 #include "ieee-754/arc600-mul64/divdf3.S"
   1360 #elif defined (__ARC_NORM__) && defined(__ARC_MUL32BY16__)
   1361 #include "ieee-754/arc600-dsp/divdf3.S"
   1362 #endif
   1363 #endif
   1364 
   1365 #ifdef  L_divsf3
   1366 #ifdef  __ARC_MPY__
   1367 #include "ieee-754/divsf3-stdmul.S"
   1368 #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__)
   1369 #include "ieee-754/arc600-mul64/divsf3.S"
   1370 #elif defined (__ARC_NORM__) && defined(__ARC_MUL32BY16__)
   1371 #include "ieee-754/arc600-dsp/divsf3.S"
   1372 #elif defined (__ARC_NORM__)
   1373 #include "ieee-754/arc600/divsf3.S"
   1374 #endif
   1375 #endif
   1376 
   1377 #ifdef L_extendsfdf2
   1378 #ifdef __ARC_NORM__
   1379 #include "ieee-754/extendsfdf2.S"
   1380 #endif
   1381 #endif
   1382 
   1383 #ifdef L_truncdfsf2
   1384 #ifdef __ARC_NORM__
   1385 #include "ieee-754/truncdfsf2.S"
   1386 #endif
   1387 #endif
   1388 
   1389 #ifdef L_floatsidf
   1390 #ifdef __ARC_NORM__
   1391 #include "ieee-754/floatsidf.S"
   1392 #endif
   1393 #endif
   1394 
   1395 #ifdef L_floatsisf
   1396 #ifdef __ARC_NORM__
   1397 #include "ieee-754/floatsisf.S"
   1398 #endif
   1399 #endif
   1400 
   1401 #ifdef L_floatunsidf
   1402 #ifdef __ARC_NORM__
   1403 #include "ieee-754/floatunsidf.S"
   1404 #endif
   1405 #endif
   1406 
   1407 #ifdef L_fixdfsi
   1408 #ifdef __ARC_NORM__
   1409 #include "ieee-754/fixdfsi.S"
   1410 #endif
   1411 #endif
   1412 
   1413 #ifdef L_fixsfsi
   1414 #ifdef __ARC_NORM__
   1415 #include "ieee-754/fixsfsi.S"
   1416 #endif
   1417 #endif
   1418 
   1419 #ifdef L_fixunsdfsi
   1420 #ifdef __ARC_NORM__
   1421 #include "ieee-754/fixunsdfsi.S"
   1422 #endif
   1423 #endif
   1424 
   1425 #ifdef L_eqdf2
   1426 #ifdef __ARC_NORM__
   1427 #include "ieee-754/eqdf2.S"
   1428 #endif
   1429 #endif
   1430 
   1431 #ifdef L_eqsf2
   1432 #ifdef __ARC_NORM__
   1433 #include "ieee-754/eqsf2.S"
   1434 #endif
   1435 #endif
   1436 
   1437 #ifdef L_gtdf2
   1438 #ifdef __ARC_NORM__
   1439 #include "ieee-754/gtdf2.S"
   1440 #endif
   1441 #endif
   1442 
   1443 #ifdef L_gtsf2
   1444 #ifdef __ARC_NORM__
   1445 #include "ieee-754/gtsf2.S"
   1446 #endif
   1447 #endif
   1448 
   1449 #ifdef L_gedf2
   1450 #ifdef __ARC_NORM__
   1451 #include "ieee-754/gedf2.S"
   1452 #endif
   1453 #endif
   1454 
   1455 #ifdef L_gesf2
   1456 #ifdef __ARC_NORM__
   1457 #include "ieee-754/gesf2.S"
   1458 #endif
   1459 #endif
   1460 
   1461 #ifdef L_uneqdf2
   1462 #ifdef __ARC_NORM__
   1463 #include "ieee-754/uneqdf2.S"
   1464 #endif
   1465 #endif
   1466 
   1467 #ifdef L_uneqsf2
   1468 #ifdef __ARC_NORM__
   1469 #include "ieee-754/uneqsf2.S"
   1470 #endif
   1471 #endif
   1472 
   1473 #ifdef L_orddf2
   1474 #ifdef __ARC_NORM__
   1475 #include "ieee-754/orddf2.S"
   1476 #endif
   1477 #endif
   1478 
   1479 #ifdef L_ordsf2
   1480 #ifdef __ARC_NORM__
   1481 #include "ieee-754/ordsf2.S"
   1482 #endif
   1483 #endif
   1484 #endif /* ARC_OPTFPE */
   1485