GP2X Arm Optimized Blitter And Alpha Blend


Fueler

Still Fresh
Joined
Jun 11, 2007
Messages
53
I am looking for an ARM optimized (assembly is desired) 32-bit pixel Blit and 32-bit ARGB alpha blend blit.
 
For how large an area? If it's for a large'ish area, have you tried using the hardware blitter?
 
Squidge said:
For how large an area? If it's for a large'ish area, have you tried using the hardware blitter?
Sorry, more details. I need software only solution.

Blit Operation
1. Blit from 32-bit pixel format surface (ARGB/RGB32) to another 32-bit pixel format surface where pitch != width.
2. Staight memcpy where pitch == width

Alpha Blend Operation
1. ARGB to ARGB up to 640x480, where pitch != width
2. ARGB to ARGB where both source and destination configuration match and pitch == width
 
Last edited by a moderator:
Based on a bit of experience, you can probably do this with C code and get pretty close to optimal if you make your loops count backwards ,write your comparisons intelligently, and you link in the ARM-optimized memcpy from netbsd (I believe you can find this in the mame4all source code).

You could probably get a 5% performance boost by loading and storing multiple registers at a time. This would require assembly since gcc doesn't use ldm/stm outside the activation record construction/destruction that I've seen..

If you made a requirement of the caller that all widths would be multiples of 2 or 4, you could unroll an inner loop and perhaps gain another few percent max,I'd guess.

I don't recall seeing an arm-optimized alpha blend routing during my brief searchings for other types of blits. What you can do is create a C function as close as possible to what you want, and compile it in GCC but with the switch that leaves you with the GAS source. That can then be looked at for ideas, inspiration, or can just be patched up by hand and turned into something better.
 
Back
Top