delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/26/00:16:38

From: ignatov AT deol DOT ru (Vladimir Ignatov)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: _lrotl replacement
Date: Sun, 26 Jul 1998 02:15:05 GMT
Organization: Data Express Online
Lines: 43
Message-ID: <35ba8f68.1442551@news.deol.ru>
References: <35b9deda DOT 40014807 AT news DOT deol DOT ru> <35BA6D01 DOT 3293CF2C AT cartsys DOT com>
NNTP-Posting-Host: cat2511-1-6.users.deol.ru
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sat, 25 Jul 1998 16:40:49 -0700, Nate Eldredge <nate AT cartsys DOT com>
wrote:

>Assuming it does something similar to what it did in Turbo C:
>
>/* Non-portable version */
>
>inline unsigned long _lrotl(unsigned long n, int c)
>{
>   asm("roll %b2, %0"
>       : "=g" (n)
>       : "0" (n), "ci" (c));
>   return n;
>}

Wow! Thanks, thats look good.  Meanwhile i write own version which is
look like:

    inline int _lrotl
        (
        int iValue,
        int iRotate
        )
    {
        asm
        (
        "rol %%cl, %0 \n"
        : "=r" (iValue)
        : "c" (iRotate), "0" (iValue)
        );

        return  iValue;
    }

So my questions is:

>   asm("roll %b2, %0"
a) That is  %b2  mean?

>       : "0" (n), "ci" (c));
b)  That is  "ci"  mean?

	Vladimir

- Raw text -


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