Re: fast bit rotation

new topic     » goto parent     » topic index » view thread      » older message » newer message

Rolf wrote:

> I programmed 'true euphorian' rotation functions rotl(objekt x) and
> rotr(object x), see include file ROTATION.E and test file ROTATION.EXW
> of attached zip file. To run it under DOS, rename *.EXW to *.EX.
>
> On my AMD K6-2, 400MHz I found (under NT 4.0) with ROTATION.EXW
> 1.91 micro seconds for rotr() and
> 1.63 micro seconds for rotl() per call.

You can even gain speed by omitting 'pusha' and 'popa'. smile

I like the idea of wrapping the ASM functions by 'true euphorian'
functions, especially in order to be able to apply them to any Euphoria
object.

However, the main disadvantage of Tommy's routines IMHO is the point,
that they use a fixed count of '1' for any rotation. A versatile library
routine IMHO should allow the user to specify the count as parameter, so
that it would look somehow like:
   function rotate_left(value, count)

Regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  This message has been ROT-13 encrypted
 \ /  against HTML in       |  twice for higher security.
  X   e-mail and news,      |
 / \  and unneeded MIME     |  http://home.arcor.de/luethje/prog/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu