Re: [AD] ALLEGRO_USE_C vs ALLEGRO_NO_ASM

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




On 27/03/06, Siarhei Siamashka <siarhei.siamashka@xxxxxxxxxx> wrote:
Milan Mimica wrote:

>> As for ASM vs. C, assembly optimized version of clear_to_color() is
>>  faster than its C counterpart, on the other hand C-implementation
>> of RLE sprites is faster than ASM.
>
> I wonder if it is possible to easily exclude ASM in some functions
> and leave it in the others.

It's probably possible, though it is not so easy. One of the reasons of
ABI incompatibility is a nonstandard calling convention (correct me if I
am wrong).

I'm pretty sure it's possible to write  a 'pure' assembly function that uses the  C calling convention.

If we benchmark the code, figure out which functions really
work good, they could be converted into gcc inline assembly blocks in
*.c sources. So calling conventions will remain compatible with pure
C-version of the library, but the functions which can get performance
improvement from assembly will work faster.

I thought that the only functions with a variable (sometimes C and sometimes asm) calling convention were the read_bank/write_bank functions in  the BITMAP vtable ( gfx.h, line 267)  - that's why they're declared as void*. Does anyone know better (and indeed, why they are in the BITMAP and not the vtable)

Pete


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