[SDL] [patch] x86 asm blitters, gcc/MSVC/mmx

Alex Volkov avcp-sdlmail at usa.net
Thu Sep 22 12:34:30 PDT 2005


New version of MMX patch:
	http://www.bpvn.com/patches/SDL/mmx-alpha-blit2.zip

- Overall speed improvements for the current GCC inline mmx	asm code
(more speed than previous patch for 15/16bpp blenders; a couple
previous mistaken optimizations reverted)

- Bugfix for BlitRGBtoRGBSurfaceAlphaMMX() setting the alpha component
on the destination surfaces (to opaque-alpha) even when the surface
has none

- BlitRGBtoRGBSurfaceAlphaMMX and BlitRGBtoRGBPixelAlphaMMX (and all
variants) can now also handle formats other than (A)RGB8888. Formats
like RGBA8888 and some quite exotic ones are allowed -- like 
RAGB8888, or actually anything having channels aligned on 8bit
boundary and full 8bit alpha (for per-pixel alpha blending).
The performance cost of this change is virtually 0 for per-surface
alpha blending (no extra ops inside the loop) and a single non-MMX
op inside the loop for per-pixel blending. In testing, the per-pixel
alpha blending takes a ~2% performance hit, but it still runs much
faster than the current code in CVS. If necessary, a separate function
with this functionality can be made.

- MSVC mmx intrinsics version of the same GCC asm code.
You will need to define USE_ASMBLIT to build these blitters (or use
the SDL.dsp from the previous patch).
This code requires Processor Pack for VC6.

Please let me know if you find anything broken. General comments are welcome
too!
Alex.






More information about the SDL mailing list