We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 128 - The nasm blitters should be rewritten in gcc syntax
Summary: The nasm blitters should be rewritten in gcc syntax
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 All
: P2 normal
Assignee: marchesin
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 21:35 UTC by marchesin
Modified: 2007-02-15 05:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marchesin 2006-01-31 21:35:55 UTC
The nasm blitters currently found under SDL12/src/hermes have numerous issues :
- the code is not PIC clean, which could result in crashes (and I think this one is the culprit for the crashes when using -O3)
- that code requires nasm (so it won't work on QNX or Mac OS X86)
- that code doesn't work on x86_64
- it adds a dependency on an external tool

The last 3 issues could be solved by doing a gcc rewrite, the first one could be done along the way by carefully saving/restoring ebx.
Comment 1 Alex Volkov 2006-03-15 18:17:15 UTC
The first Hermes issue (PIC) has been resolved a little while back. Hermes nasm code now loads MMX constants via stack and so does not have any static memory variables anymore.
Comment 2 Kamil Kamiński 2006-05-26 12:55:20 UTC
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.1.0/../../../../x86_64-unknown-linux-gnu/bin/ld: build/.libs/SDL_blit_A.o: relocation R_X86_64_PC32 against `BlitRGBtoRGBPixelAlphaMMX3DNOW' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.1.0/../../../../x86_64-unknown-linux-gnu/bin/ld: final link failed: Bad value

Is there any chance to make this working? (compiled with -fPIC)
Comment 3 marchesin 2006-05-26 18:51:25 UTC
I think that's a gcc bug. It can probably be worked around by changing :
inline static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)
into 
static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)

Oh btw, this has nothing to do with that bug.
Comment 4 Sam Lantinga 2006-09-23 19:15:33 UTC
BlitRGBtoRGBPixelAlphaMMX3DNOW() is not inline anymore in subversion.
Comment 5 Ryan C. Gordon 2007-02-03 03:27:34 UTC
Fwiw, the latest nasm builds can generate Intel Mach-O object files for Mac OS X.

I'd be inclined to say getting nasm to target QNX would be a better effort than converting all the Hermes code to GCC format.

If the PIC issues are resolved, I'd be inclined to flag this bug as WONTFIX.

--ryan.

Comment 6 Ryan C. Gordon 2007-02-15 05:55:05 UTC
Hearing nothing, I'm closing this bug as WONTFIX. Having converted more than my share of assembly between GCC and nasm, I can imagine that we'll spend many years debugging it for little gain.

If an x86 platform can't use nasm, it will have to use the C fallbacks. That's how it goes. This would be a massive undertaking, and something that definitely should NOT happen in the 1.2 branch if nothing else.

--ryan.