delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/26/08:21:30

From: david DOT stegbauer AT cz DOT opel DOT com
X-Lotus-FromDomain: GMCZECHIA AT EDSHUBEUROPE
Sender: david DOT stegbauer AT cz DOT opel DOT com
To: djgpp AT delorie DOT com
Message-ID: <41256740.00467923.00@derumg01.cyberlink.eds.com>
Date: Fri, 26 Mar 1999 14:03:03 +0100
Subject: Re: Inline assembly - rotate left
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com


Nate Eldredge <nate AT cartsys DOT com>
and Michael Bukin <M DOT A DOT Bukin AT inp DOT nsk DOT su>

gave me some hints to improve, so there is better version:

#ifdef __DJGPP__
    #define roll(val,cnt) asm volatile (\
        "roll %%cl, %1" \
            :"=r" (val) \
            :"0"(val), "c"(cnt))
#endif /*__DJGPP__*/

Unfortunately statement-as-expression extension of gcc is
unusable for me, because this macro has to be used with
Borland C++ with the same syntax as with djgpp (but another
definition, of course)

Thanks for your improvements, roll macro is used in inner loop
of MD5 hashing and any speedup is very good.
By the way, isn't a pity that gcc nor libc doesn't offer
rotating, is it?

David


- Raw text -


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