Commit Graph

4644 Commits

Author SHA1 Message Date
Ryan C. Gordon
a4ede00263 Fixed compiler warnings on Haiku. 2011-09-18 03:52:08 +00:00
Ryan C. Gordon
ef9602f026 Implemented x86 and x86-64 spinlock inline asm.
Favor it over Mac OS X API for Intel systems (but not GCC atomic intrinsics).

This might get us a little further on Cygwin builds, too.
2011-09-18 03:19:41 -04:00
Ryan C. Gordon
62cdeb1783 Use an actual #error instead of a bogus symbol if there's no spinlock support. 2011-09-18 02:55:45 -04:00
Ryan C. Gordon
b5688aca8a Patched to compile on some platforms. 2011-09-18 02:09:20 -04:00
Andreas Schiffler
52ef3c93ec Add tests for SDL_RectEquals and empty rectangle cases 2011-09-17 22:37:31 -07:00
Andreas Schiffler
a76b8e0292 Add special cases for empty rectangles in SDL_Rect functions 2011-09-17 22:35:57 -07:00
Andreas Schiffler
0a29e84930 Fix SDL_RectEquals define 2011-09-17 22:35:10 -07:00
Andreas Schiffler
77acc926f7 Add test cases for SDL_RectEmpty 2011-09-16 08:26:20 -07:00
Andreas Schiffler
acb9d90a85 Add NULL handling in SDL_RectEmpty and SDL_RectEquals 2011-09-16 08:25:49 -07:00
Ryan C. Gordon
a01b9d69d6 Removed some FIXMEs (Nathan's changes were, in fact, correct). 2011-09-15 23:55:36 -04:00
Ryan C. Gordon
fe04e23133 Merged Nathan Heisey's Haiku work into the main SDL 1.3 branch.
This was a Google Summer of Code 2011 project, sponsored by the Haiku project.

We thank Nathan and the other Haiku developers for their support!
2011-09-15 23:51:07 -04:00
Andreas Schiffler
fdf9d2c853 Added tests for SDL_UnionRect to testrect suite 2011-09-15 08:21:54 -07:00
Markus Kauppila
d2b6d20dab Cleans up the logger output a bit. Removes fuzzer invocation count
from the log if the fuzzer isn't used.
2011-09-10 19:27:39 +03:00
Ryan C. Gordon
b84e7104b1 Clean up the win32 compiler warnings for SDL threads, in the 1.3 branch. 2011-09-12 13:36:38 -04:00
Andreas Schiffler
fefed71ec5 Added tests for SDL_EnclosePoints. 2011-09-12 09:00:34 -07:00
Andreas Schiffler
d8556266a2 Fix regression introducted by added parameter check in SDL_EnclosePoints. Add special case to speedup when no result was requested. 2011-09-12 09:00:01 -07:00
Ryan C. Gordon
079d39970c More work on cleaning out compiler warnings. 2011-09-11 04:02:40 -04:00
Ryan C. Gordon
6de89cdd37 Fixed Win64 builds with MingW. 2011-09-11 03:35:46 -04:00
Ryan C. Gordon
54294f986d Some MMX fixes from Patrick Baggett.
Original email...

Date: Sat, 10 Sep 2011 13:01:20 -0500
From: Patrick Baggett
To: SDL Development List <sdl@lists.libsdl.org>
Subject: Re: [SDL] SDL_memcpyMMX uses SSE instructions

In SDL_blit_copy.c, the function SDL_memcpyMMX() actually use SSE
instructions.

It is called in this context:

#ifdef __MMX__
    if (SDL_HasMMX() &&
        !((uintptr_t) src & 7) && !(srcskip & 7) &&
        !((uintptr_t) dst & 7) && !(dstskip & 7)) {
        while (h--) {
            SDL_memcpyMMX(dst, src, w);
            src += srcskip;
            dst += dstskip;
        }
        _mm_empty();
        return;
    }
#endif

This implies that the minimum CPU features are just MMX. There is a
separate SDL_memcpySSE() function.


The SDL_memcpyMMX() function does:

#ifdef __SSE__
        _mm_prefetch(src, _MM_HINT_NTA);
#endif

...which tests at compile time if SSE intrinsics are available, not at run
time. It generates the PREFETCHNTA instruction. It also uses _mm_stream_pi()
intrinsic, which generates the MOVNTQ instruction.

If you replace the "MMX" code with:

__m64* d64 = (__m64*)dst;
__m64* s64 = (__m64*)src;
 for(i= len / 64; i--;) {
   d64[0] = s64[0];
   d64[1] = s64[1];
   d64[2] = s64[2];
   d64[3] = s64[3];
   d64[4] = s64[4];
   d64[5] = s64[5];
   d64[6] = s64[6];
   d64[7] = s64[7];
   d64 += 8;
   s64 += 8;
 }

Then MSVC generates the correct movq instructions. GCC (4.5.0) seems to
think that using 2x movl is still better, but then again, GCC isn't actually
that good at optimizing intrinsics as I've found. At least the code won't
crash on my P2 though. :)

Also, there is no requirement for MMX to be aligned to the 8th byte. I
think the author assumed that SSE's 16 byte alignment requirement must
retroactively mean that MMX requires 8 byte alignment. Attached is the full
patch.

Patrick
2011-09-11 01:54:54 -04:00
Ryan C. Gordon
9a4e598f42 Removed sail.bmp reference from Xcode project.
Fixes Buildbot.
2011-09-09 10:45:48 -04:00
Ryan C. Gordon
7adf4f848a Fixed a compiler warning. 2011-09-09 04:48:45 -04:00
Ryan C. Gordon
b865b3d4b6 Fixed a compiler warning on Visual Studio. 2011-09-09 04:17:47 -04:00
Ryan C. Gordon
e612bfc336 Added a newline to the end of a file to quiet old versions of GCC. 2011-09-09 02:43:04 -04:00
Ryan C. Gordon
82df1959c1 Removed legacy Mac OS X dlcompat code.
It was only needed for Mac OS X 10.0 through 10.2, so it seems silly to keep
 it around for SDL 1.3.

I'll leave it in the 1.2 branch for now, though.
2011-09-09 00:34:48 -04:00
Andreas Schiffler
9440bdc21b Merge changes 2011-09-07 21:47:10 -07:00
Ryan C. Gordon
4efdd10e16 Fixed compiler warning on 32-bit Mac OS X. 2011-09-07 10:54:14 -04:00
Andreas Schiffler
8e3c6688a7 Refactored IntersectRectAndLine tests and increased coverage 2011-09-06 23:51:46 -07:00
Andreas Schiffler
576988acf2 Update SDL_REVISION 2011-09-04 20:45:38 -07:00
Andreas Schiffler
a5f6fa789f Added tests for SDL_HasIntersection; added negative parameter tests; refactored existing test code 2011-09-04 20:37:01 -07:00
Andreas Schiffler
15eed4cdc2 Added input parameter validation to some SDL_rect functions 2011-09-04 20:34:48 -07:00
Andreas Schiffler
cd72032cea Added tests to testrect suite. Simple logger improvements. Fixed int-range fuzzer. 2011-09-04 14:57:10 -07:00
Ryan C. Gordon
9b301501da Fixed a compiler warning on Mac OS X.
Thanks to Mattias Holm for the patch!
2011-09-02 14:00:57 -04:00
Ryan C. Gordon
8ad5dc2b68 Fixed a NSLog() format string.
Thanks to Mattias Holm for the patch!
2011-09-02 14:00:10 -04:00
Ryan C. Gordon
e0fe768768 Fixed another Apple typedef in SDL_opengl.h 2011-09-02 13:54:45 -04:00
Ryan C. Gordon
95221a071a Patched to compile. 2011-09-01 14:02:12 -04:00
Ryan C. Gordon
d3c8a17a2d Called method on wrong object in Android exception handler.
Fixes Bugzilla #1297.

Thanks to jon @ rafkind for the patch!
2011-09-01 04:42:09 -04:00
Ryan C. Gordon
03425cf382 Removed unused variable. 2011-09-01 04:34:05 -04:00
Ryan C. Gordon
439009a9d5 Clean up any opened joysticks during SDL_JoystickQuit().
Otherwise, these leak memory and maybe operating system handles.
2011-09-01 04:25:15 -04:00
Ryan C. Gordon
fefd678dfd Backed out SDL_config.h overwrite that got committed by accident. 2011-08-30 17:11:51 -04:00
Ryan C. Gordon
370cdc709c Automated merge with https://bitbucket.org/Markusk/sdl-gsoc 2011-08-29 13:17:07 -04:00
Ryan C. Gordon
56e1918d11 Fixed missing audio on iOS. 2011-08-29 00:27:43 -04:00
Markus Kauppila
6937f4af84 Fixed an error in doxygen markup. 2011-08-28 22:27:26 +03:00
Markus Kauppila
bad61ed9af Fixed a typo. 2011-08-28 22:24:00 +03:00
Markus Kauppila
79a82d3174 Updated TODO. 2011-08-28 22:22:37 +03:00
Markus Kauppila
1abbc9b839 Minor cleaning. 2011-08-28 22:18:56 +03:00
Markus Kauppila
b688d51602 Added elementary fuzzer-randgen invocation count. 2011-08-28 22:06:56 +03:00
Markus Kauppila
99952d2853 Added TODO. 2011-08-28 21:06:00 +03:00
Markus Kauppila
8cf1257081 Test cases executed in their own process can now bail out if
assertion fails.

Note: Bailing out doesn't work with --in-proc option.
2011-08-28 21:00:38 +03:00
Markus Kauppila
681d72d5f1 Option --show-tests prints test description. 2011-08-28 20:27:25 +03:00
Markus Kauppila
bfd6031522 Fixed timestamp issue. 2011-08-28 20:08:36 +03:00