lib1funcs.S (__ashldi3): Use __tmp_reg__ to restore R16 instead of push + pop.
libgcc/ 2016-12-12 George Spelvin <linux@sciencehorizons.net> * config/avr/lib1funcs.S (__ashldi3): Use __tmp_reg__ to restore R16 instead of push + pop. (__ashrdi3, __lshrdi3): Same. And use __zero_reg__ for signs. From-SVN: r243545
This commit is contained in:
parent
9e9034937b
commit
a5b947fa66
|
@ -1,3 +1,9 @@
|
||||||
|
2016-12-12 George Spelvin <linux@sciencehorizons.net>
|
||||||
|
|
||||||
|
* config/avr/lib1funcs.S (__ashldi3): Use __tmp_reg__ to restore
|
||||||
|
R16 instead of push + pop.
|
||||||
|
(__ashrdi3, __lshrdi3): Same. And use __zero_reg__ for signs.
|
||||||
|
|
||||||
2016-12-10 Krister Walfridsson <krister.walfridsson@gmail.com>
|
2016-12-10 Krister Walfridsson <krister.walfridsson@gmail.com>
|
||||||
|
|
||||||
* config.host (i[34567]86-*-netbsdelf*): Add i386/t-crtstuff to
|
* config.host (i[34567]86-*-netbsdelf*): Add i386/t-crtstuff to
|
||||||
|
|
|
@ -3113,20 +3113,22 @@ ENDF __bswapdi2
|
||||||
**********************************/
|
**********************************/
|
||||||
|
|
||||||
#if defined (L_ashrdi3)
|
#if defined (L_ashrdi3)
|
||||||
|
|
||||||
|
#define SS __zero_reg__
|
||||||
|
|
||||||
;; Arithmetic shift right
|
;; Arithmetic shift right
|
||||||
;; r25:r18 = ashr64 (r25:r18, r17:r16)
|
;; r25:r18 = ashr64 (r25:r18, r17:r16)
|
||||||
DEFUN __ashrdi3
|
DEFUN __ashrdi3
|
||||||
bst r25, 7
|
sbrc r25, 7
|
||||||
bld __zero_reg__, 0
|
neg SS
|
||||||
;; FALLTHRU
|
;; FALLTHRU
|
||||||
ENDF __ashrdi3
|
ENDF __ashrdi3
|
||||||
|
|
||||||
;; Logic shift right
|
;; Logic shift right
|
||||||
;; r25:r18 = lshr64 (r25:r18, r17:r16)
|
;; r25:r18 = lshr64 (r25:r18, r17:r16)
|
||||||
DEFUN __lshrdi3
|
DEFUN __lshrdi3
|
||||||
lsr __zero_reg__
|
;; Signs are in SS (zero_reg)
|
||||||
sbc __tmp_reg__, __tmp_reg__
|
mov __tmp_reg__, r16
|
||||||
push r16
|
|
||||||
0: cpi r16, 8
|
0: cpi r16, 8
|
||||||
brlo 2f
|
brlo 2f
|
||||||
subi r16, 8
|
subi r16, 8
|
||||||
|
@ -3137,9 +3139,9 @@ DEFUN __lshrdi3
|
||||||
mov r22, r23
|
mov r22, r23
|
||||||
mov r23, r24
|
mov r23, r24
|
||||||
mov r24, r25
|
mov r24, r25
|
||||||
mov r25, __tmp_reg__
|
mov r25, SS
|
||||||
rjmp 0b
|
rjmp 0b
|
||||||
1: asr __tmp_reg__
|
1: asr SS
|
||||||
ror r25
|
ror r25
|
||||||
ror r24
|
ror r24
|
||||||
ror r23
|
ror r23
|
||||||
|
@ -3150,16 +3152,21 @@ DEFUN __lshrdi3
|
||||||
ror r18
|
ror r18
|
||||||
2: dec r16
|
2: dec r16
|
||||||
brpl 1b
|
brpl 1b
|
||||||
pop r16
|
clr __zero_reg__
|
||||||
|
mov r16, __tmp_reg__
|
||||||
ret
|
ret
|
||||||
ENDF __lshrdi3
|
ENDF __lshrdi3
|
||||||
|
|
||||||
|
#undef SS
|
||||||
|
|
||||||
#endif /* defined (L_ashrdi3) */
|
#endif /* defined (L_ashrdi3) */
|
||||||
|
|
||||||
#if defined (L_ashldi3)
|
#if defined (L_ashldi3)
|
||||||
;; Shift left
|
;; Shift left
|
||||||
;; r25:r18 = ashl64 (r25:r18, r17:r16)
|
;; r25:r18 = ashl64 (r25:r18, r17:r16)
|
||||||
|
;; This function does not clobber T.
|
||||||
DEFUN __ashldi3
|
DEFUN __ashldi3
|
||||||
push r16
|
mov __tmp_reg__, r16
|
||||||
0: cpi r16, 8
|
0: cpi r16, 8
|
||||||
brlo 2f
|
brlo 2f
|
||||||
mov r25, r24
|
mov r25, r24
|
||||||
|
@ -3182,13 +3189,13 @@ DEFUN __ashldi3
|
||||||
rol r25
|
rol r25
|
||||||
2: dec r16
|
2: dec r16
|
||||||
brpl 1b
|
brpl 1b
|
||||||
pop r16
|
mov r16, __tmp_reg__
|
||||||
ret
|
ret
|
||||||
ENDF __ashldi3
|
ENDF __ashldi3
|
||||||
#endif /* defined (L_ashldi3) */
|
#endif /* defined (L_ashldi3) */
|
||||||
|
|
||||||
#if defined (L_rotldi3)
|
#if defined (L_rotldi3)
|
||||||
;; Shift left
|
;; Rotate left
|
||||||
;; r25:r18 = rotl64 (r25:r18, r17:r16)
|
;; r25:r18 = rotl64 (r25:r18, r17:r16)
|
||||||
DEFUN __rotldi3
|
DEFUN __rotldi3
|
||||||
push r16
|
push r16
|
||||||
|
|
Loading…
Reference in New Issue