This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, AVR]: PR49313, fix PR29524
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: Denis Chertykov <chertykov at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "Eric B. Weddington" <eric dot weddington at atmel dot com>, Anatoly Sokolov <aesok at post dot ru>
- Date: Thu, 16 Jun 2011 11:37:20 +0200
- Subject: Re: [Patch, AVR]: PR49313, fix PR29524
- References: <4DF87FAD.4090104@gjlay.de> <BANLkTimwLi6RXin6LM7F1Ave1umvatrtQw@mail.gmail.com>
Denis Chertykov schrieb:
> 2011/6/15 Georg-Johann Lay <avr@gjlay.de>:
>> This is a patch that implements some libgcc functions in assembler.
>> The functions are used only very seldom but if, they lead to an
>> unpleasant waste of resource. For example, some SF functions
>> eventually lead to __clz_tab being dragged in (PR29524).
>>
>> This patch avoids that by straight forward assembler implementation of
>> functions that are easy to implement.
>>
>> Tested without regression. Moreover, I tested functions in some
>> self-written code against the old C-implementation. HI/QI functions
>> tested for all possible inputs.
>>
>
> Approved for AVR.
> May be you need another approval for longlong.h
>
> Denis.
Committed original Version from
http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01200.html
together with the following corrigendum:
--- config/avr/libgcc.S (Revision 175097)
+++ config/avr/libgcc.S (Arbeitskopie)
@@ -1241,7 +1241,7 @@ ENDF __bswapdi2
;; r25:r18 = ashr64 (r25:r18, r17:r16)
DEFUN __ashrdi3
push r16
- andi r16, 31
+ andi r16, 63
breq 2f
1: asr r25
ror r24
@@ -1263,7 +1263,7 @@ ENDF __ashrdi3
;; r25:r18 = lshr64 (r25:r18, r17:r16)
DEFUN __lshrdi3
push r16
- andi r16, 31
+ andi r16, 63
breq 2f
1: lsr r25
ror r24
@@ -1285,7 +1285,7 @@ ENDF __lshrdi3
;; r25:r18 = ashl64 (r25:r18, r17:r16)
DEFUN __ashldi3
push r16
- andi r16, 31
+ andi r16, 63
breq 2f
1: lsl r18
rol r19
Johann