SDL-1.2.9 amd64 assembly patch

Here’s yet more fixes for enabling MMX optimizations under amd64. All the
test programs that come with the SDL source run properly with it, as do the
SDL games I have installed.

There is a problem though. ./configure does not pick up that assembly is
possible under amd64; not even ./configure --enable-nasm can force it. I
had to put -DUSE_ASMBLIT in the cflags myself, and explicitly disable two
little things that didn’t easily work under amd64 with #ifdef’s.

The problem as it appears to me, is that the configure script makes no
distinction between NASM support and inline assembly support. AMD64 supports
inline assembly but not the NASM stuff. A seperate configure option like
–enable-inline-asm would be very useful.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-1.2.9-amd64.patch
Type: text/x-diff
Size: 10528 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050829/8100a884/attachment.patch

There is a problem though. ./configure does not pick up that assembly is
possible under amd64; not even ./configure --enable-nasm can force it. I
had to put -DUSE_ASMBLIT in the cflags myself, and explicitly disable two
little things that didn’t easily work under amd64 with #ifdef’s.

The problem as it appears to me, is that the configure script makes no
distinction between NASM support and inline assembly support. AMD64 supports
inline assembly but not the NASM stuff. A seperate configure option like
–enable-inline-asm would be very useful.

Ideally, it’ll just use the inline asm on supported platforms without
having to force it in the configure script (and be seperate from nasm).

Can someone take a stab at this so we can get this into CVS?

Thanks,
–ryan.

Ack. I’m going to reccomend holding off on that AMD64 ASM patch. I just
stumbled on a stability issue somewhere in the ASM blitters, specifically,
one of the special-case surface-format converters.

None of the SDL test programs puked on it, so apparently none of them need
that particular kind of conversion. I haven’t yet thought of an elegant way
to test all these conversions, but if I do, could it be included? The SDL
test programs could really use one.On September 8, 2005 01:48 am, Ryan C. Gordon wrote:

There is a problem though. ./configure does not pick up that assembly is
possible under amd64; not even ./configure --enable-nasm can force it.
I had to put -DUSE_ASMBLIT in the cflags myself, and explicitly disable
two little things that didn’t easily work under amd64 with #ifdef’s.

The problem as it appears to me, is that the configure script makes no
distinction between NASM support and inline assembly support. AMD64
supports inline assembly but not the NASM stuff. A seperate configure
option like --enable-inline-asm would be very useful.

Ideally, it’ll just use the inline asm on supported platforms without
having to force it in the configure script (and be seperate from nasm).

Can someone take a stab at this so we can get this into CVS?

Ack. I’m going to reccomend holding off on that AMD64 ASM patch. I just
stumbled on a stability issue somewhere in the ASM blitters, specifically,
one of the special-case surface-format converters.

I’m going to scratch it off my TODO list for now, then; if you or
someone else has time to fight with it, I’ll put it back in my queue.

None of the SDL test programs puked on it, so apparently none of them need
that particular kind of conversion. I haven’t yet thought of an elegant way
to test all these conversions, but if I do, could it be included? The SDL
test programs could really use one.

SDL12/test/testblitspeed.c has a million command line options so you can
force conversion between any two arbitrary formats. We could at least
write a script to call it multiple times if not automate it directly.

–ryan.