Re: [AD] Asm optimized version of _linear_draw_trans_rgba_rle_sprite24 is buggy?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Serge Semashko wrote:

I started making a fast sprites blitting mini-library with alpha
transparency support for use in ufo2000 (to support alpha transparency
and different brightness level for sprites in an efficient way):
http://lxnt.info:8888/repos/ufo2k/trunk/src/sprite.h
http://lxnt.info:8888/repos/ufo2k/trunk/src/sprite.cpp

While testing 24-bit color support with allegro 4.2.0rc2 on windows, the
program crashes. Rebuilding allegro with ALLEGRO_USE_C resolves the
problem.

I'm going to make some kind of regression testing and benchmarking
framework a bit later, so a real test program reproducing the problem
will be available too.

Done. You can download a test program here:
http://ufo2000.sourceforge.net/files/spritelib.zip

A crash can be reproduced by running "test-asm.exe 24" (test program
linked with assembly optimized version of allegro), "test-c.exe 24" runs
fine (using C-version of allegro library). All the sources are included.

Also I noticed that assembly optimized version of allegro is actually
noticeably slower, at least on Athlon CPU. The benchmarks for 16bpp mode
for both asm and c versions of allegro are listed below. Considering the
discouraging performance test results, is it worth fixing the bug in asm
version of allegro code? On what CPU is asm version actually useful?

So assembly optimized version is currently:
- slower
- buggy
- incompatible with valgrind

Are there any reasons to keep it for the future versions of allegro? The
only good thing I have noticed about it is that it produces somewhat
smaller executables. And probably it might be faster on some old
pentiums. Any happy owners of such old hardware here? Could you run a
sprites blitting performance test on it?


Athlon XP 2400+ (2.0 GHz, NForce2, DDR266)
gcc version 3.4.2 (mingw-special)
optimization flags: -O2 -fomit-frame-pointer

"test-c.exe 16"
---
explosion sprites per second (spritelib)      = 3575.3
explosion sprites per second (allegro rle)    = 2112.4
explosion sprites per second (allegro bitmap) = 2119.1
---
normal fire sprites per second (spritelib)    = 160000.0
normal fire sprites per second (allegro rle)  = 187125.7
---
lit fire sprites per second (spritelib)       = 146756.7
lit fire sprites per second (allegro rle)     = 100300.9
---
alpha fire sprites per second (spritelib)     = 77303.6
alpha fire sprites per second (allegro rle)   = 49691.9

"test-asm.exe 16"
---
explosion sprites per second (spritelib)      = 3575.3
explosion sprites per second (allegro rle)    = 1441.3
explosion sprites per second (allegro bitmap) = 1624.4
---
normal fire sprites per second (spritelib)    = 159235.7
normal fire sprites per second (allegro rle)  = 172057.8
---
lit fire sprites per second (spritelib)       = 148148.1
lit fire sprites per second (allegro rle)     = 79402.9
---
alpha fire sprites per second (spritelib)     = 77291.7
alpha fire sprites per second (allegro rle)   = 36363.6





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/