www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/09/16:47:02

Date: Wed, 10 Sep 1997 08:47:53 +1100
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: [Q] ASM
In-reply-to: <341589F5@relay.probe.co.uk>
To: "Hargreaves, Shawn" <shawnh AT probe DOT co DOT uk>, djgpp AT delorie DOT com
Message-id: <199709092052.IAA12964@teleng1.tait.co.nz gatekeeper.tait.co.nz>
Organization: Tait Electronics Limited
MIME-version: 1.0
Comments: Authenticated sender is <billc AT blackmagic DOT tait DOT co DOT nz>

On  9 Sep 97 at 10:37, Hargreaves, Shawn wrote:
> I'm in awe of whoever wrote the code to perform that particular type
> of optimisation: it's easy enough to do by hand for a specific case,
> but making the compiler do it for any arbitrary expression can't
> have been easy :-)

There's also:

unsigned rotate_left_by_5(unsigned y)
{
   return (y<<5)|(y>>(32-5));
}

this will go to (-O2 -fomit-frame-pointer):

_rotate_left:
  movl 4(%esp),%eax
  roll $5,%eax
  ret

Personaly, I find that one more impressive.
Bill
--
Leave others their otherness.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019