Re: cleaner assembly function ...

"Scott Smith" <[email protected]> Sat, 9 Feb 2008 10:32:10 -0800
Newsgroups gmane.comp.video.mjpeg.devel
Message-ID <[email protected]>
On 2/8/08, Stefan M. Fendt <[email protected]> wrote:
> I have written a fast(? maybe it is possible to do faster...)

You might want to look at the byte swap instructions...

http://faydoc.tripod.com/cpu/bswap.htm

Then you can do 32 bits at a time.  The downside is it requires a 486.
 I'm not sure if the VIA/Cyrix clones would support the instruction...

>         "FLIP_LOOP_Y:                \n\t"
>         "                            \n\t"
>         "mov    byte ptr dl,[esi]    \n\t" /* copy data ...          */
>         "mov    byte ptr [edi],dl    \n\t"
>         "                            \n\t"
>         "dec    esi                  \n\t"
>         "inc    edi                  \n\t"
>         "                            \n\t"
>         "loop   FLIP_LOOP_Y          \n\t"

Also you probably should tell GCC which registers you're using.
Otherwise it might put width in ebx and height in eax.  In fact, you
can probably just tell it to put width in eax, and then you don't have
to worry about loading it.
-- 
        Scott

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/