From mint-bounce@lists.fishpool.fi Wed Dec 9 17:55:36 2009 X-SourceIP: 77.249.76.7 Message-ID: <4B202A60.2000402@chello.nl> Date: Wed, 09 Dec 2009 23:53:20 +0100 From: Henk Robbers User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "mint@lists.fishpool.fi" Subject: Re: [MiNT] XaAES sources for FreeMiNT 1.16.3 References: <11a6f2b10911270646s6ceab50i915d71aeb27f6be9@mail.gmail.com> <11a6f2b10911281336q6ad74b7au657ac40469b28d8@mail.gmail.com> <11a6f2b10912081349x51b88c71p278c085ff9b77f2e@mail.gmail.com> <11a6f2b10912082333g5ede94a6t862ff00a111c970a@mail.gmail.com> <4B1FA77C.4090605@freesbee.fr> <4B1FB009.60609@freesbee.fr> <4B1FD990.2070000@freesbee.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: h.robbers@chello.nl Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Helmut Karlowski wrote: > Am 09.12.2009, 18:08 Uhr, schrieb Vincent Rivière > : > >> Andreas Schwab wrote: >> >>> unsigned int rotate (unsigned int a, int n) >>> { >>> return (a << n) | (a >> (sizeof (a) * 8 - n)); >>> } >> >> >> Correct ! >> >> $ m68k-atari-mint-gcc -S a.c -o - -O2 -fomit-frame-pointer >> #NO_APP >> .text >> .even >> .globl _rotate >> _rotate: >> move.l 4(%sp),%d0 >> move.l 8(%sp),%d1 >> rol.l %d1,%d0 >> rts > > > Wow! This is surprising, what does AHCC do on this? I won't post the > pure-c code here ... > Dont expect anything better :-) AHCC is just a simple guy. However, if a rotate function was really important for a application, I would give you a binary operator a __rotate__ n and a macro that makes it look like a function. That will cost me an hour. I wouldnt even try to guess how man years are spent on the optimation capabilities of GCC to achieve the above result. I'll do it tomorrow, just for fun. Before lunch. -- Groeten; Regards. Henk Robbers. http://members.chello.nl/h.robbers Interactive disassembler: TT-Digger; http://digger.atari.org A Home Cooked C compiler: AHCC; http://ahcc.atari.org