[SDL] [patch] x86 asm blitters, win32/MSVC?

Alex Volkov avcp-sdlmail at usa.net
Thu Sep 15 02:55:33 PDT 2005


Roberto Prieto wrote:
> I'm quite interested on MMX patch for VisualC, maybe it will
> be added to SDL CVS..

Here are the patches as promised:
	http://www.bpvn.com/patches/SDL/mmx-alpha-blit-pack1.zip

Inside you will find:

SDL_blit_A.mmx-speed.patch.txt --
	Speed improvements and a bugfix for the current GCC inline mmx
	asm code:
	- Changed some ops and removed some resulting useless ones.
	- Added some instruction parallelism (some gain)
	The resulting speed on my Xeon improved upto 35% depending on
	the function (measured in fps).
	- Fixed a bug where BlitRGBtoRGBSurfaceAlphaMMX() was 
	setting the alpha component on the destination surfaces (to
	opaque-alpha) even when the surface had none.
	(The patch itself is not exactly clean because I changed all
	indentation to tabs -- it was very inconsistent and used
	tabs+spaces.)

SDL_blit_A.mmx-msvc.patch.txt --
	MSVC mmx intrinsics version of the same GCC asm code.
	MSVC compiler tries to parallelize the code and to avoid
	register stalls, but does not always do a very good job.
	Per-surface blending MSVC functions run quite a bit faster
	than their pure-asm counterparts (upto 55% faster for 16bit
	ones), but the per-pixel blending runs somewhat slower than asm.
	You will need to define USE_ASMBLIT to build these blitters,
	see SDL.dsp below.

SDL_blit_A.mmx-both.patch.txt --
	Both above patches rolled into one. Though both will apply
	independently and in tandem, this is just for convenience.

SDL.dsp --
	Updated MSVC v5/6 project file
	- Hermes nasm code compilation added
	- New build config "Release ASMBLIT" with USE_ASMBLIT defined

Regards,
Alex.






More information about the SDL mailing list