Commit graph

103 commits

Author SHA1 Message Date
Ryan C. Gordon
fbfce09170 cpuinfo: Added some internal SIMD-aligned allocation functions.
Fixes Bugzilla #4150 (sort of).

--HG--
extra : rebase_source : af4df4fe459ce28889fb225717c418e6c1ef9ae4
extra : histedit_source : aafd7e609c08ea908255e205d23e3efdc88837a1
2018-05-21 11:34:57 -04:00
Sam Lantinga
346af016a5 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
852e3a33bf Fixed typo in comment 2017-11-11 17:21:47 -08:00
Sam Lantinga
fd5eb6d1f0 SDL_cpuinfo.c: add os/2 support to SDL_GetCPUCount() and SDL_GetSystemRAM(). 2017-08-21 13:00:40 -07:00
Ryan C. Gordon
24ac42f8d9 cpuinfo: Add SDL_HasNEON() support for ARM-based QNX.
--HG--
extra : rebase_source : 74fc0cc3f24a3cea51d5217d226f4c3d4de5c9d1
2017-08-16 21:31:03 -04:00
Sam Lantinga
68951fdb4b Fixed compile error with gcc -std=c99 2017-03-06 21:25:06 -08:00
Ryan C. Gordon
82d0a04881 Fix some more compiler warnings on armcc. 2017-03-03 16:38:17 -05:00
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Ryan C. Gordon
72556748d9 cpuinfo: fix SDL_HasNEON() on older iOS devices, fixed C++ comment.
--HG--
extra : amend_source : 375b96c7b73f2d4edf398c534d663ed90c99e56f
2016-11-21 20:35:59 -05:00
Ryan C. Gordon
8daa33191f cpuinfo: patched to compile for getauxval() path. 2016-11-17 17:03:43 -05:00
Ryan C. Gordon
f2d88cb57a cpuinfo: more patching for Android. Legacy platform targets are a pain. 2016-11-17 16:10:32 -05:00
Ryan C. Gordon
3068b91064 cpuinfo: Patched to compile on Android, Linux.
--HG--
extra : amend_source : 538168f1015cfbedb64059b6e4c580405b52e5ca
2016-11-17 16:04:00 -05:00
Ryan C. Gordon
e643f6ed66 cpuinfo: patched to compile.
Nothing quite like experimentation via Buildbot!  :/
2016-11-17 16:01:59 -05:00
Ryan C. Gordon
10560ea11e cpuinfo: more work on SDL_HasNEON(). 2016-11-17 15:57:58 -05:00
Ryan C. Gordon
d21e46ca20 cpuinfo: silence compiler warnings on non-Intel CPU architectures. 2016-11-17 01:41:56 -05:00
Ryan C. Gordon
14b0588845 cpuinfo: disable NEON detection on Android for now.
Will fix this properly soon.
2016-11-17 01:34:18 -05:00
Ryan C. Gordon
80f426217c cpuinfo: more robust ARM preprocessor checks. 2016-11-17 01:26:56 -05:00
Ryan C. Gordon
79c41b1692 cpuinfo: first attempt at SDL_HasNEON() implementation. 2016-11-17 01:15:16 -05:00
Ryan C. Gordon
84a36758a4 cpuinfo: Removed code duplication, cached CPUID details.
--HG--
extra : rebase_source : 5d1b55a41fac0bacc9dc6f121477244ff11a87b6
2016-11-16 22:49:04 -05:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Ryan C. Gordon
8b682f0b6c NetBSD: fixed issues with cpuinfo and pthread_setname_np (thanks, Thomas!).
Fixes Bugzilla #3176.
2015-12-29 02:32:47 -05:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
0bdc0eedb8 Cleaned up some compiler warnings. 2014-12-26 23:16:54 -05:00
Ryan C. Gordon
de88474dda Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.

This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)

--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00
David Ludwig
587dd65dec WinRT build fix for ARM platforms
The _xgetbv intrinsic was being used in ARM builds of SDL/WinRT, which was
leading to linker errors.  This commit limits _xgetbv use to the platforms on
which it is available, x86 and x64.
2014-08-10 22:21:21 -04:00
Sam Lantinga
e69eb33a5e Fixed Visual Studio 2010 build 2014-07-11 22:15:34 -07:00
Sam Lantinga
95e3af47d0 Fixed build for arm platforms 2014-07-11 22:14:14 -07:00
Sam Lantinga
4d8562f23f Fixed bug in AVX detection and added AVX2 detection 2014-07-11 22:02:50 -07:00
Ryan C. Gordon
db491f9a33 Static analysis fix: Value stored to '[bcd]' is never read. 2014-03-19 16:55:38 -04:00
Sam Lantinga
3b9df91fd6 Fixed bug 2404 - CPU detection not working with MSVC on x64
Tiemo Jung

All CPU detection functions SDL_Has* will return false, even if it is supported by the CPU, if SDL is compiled with MSVC and the target is x64.

The reason for this is that 'CPU_haveCPUID' will return 0 and macro 'cpuid' in SDL_cpuinfo.c is the fallback implementation, which sets all params to zero.

It is safe to assume that cpuid is supported on a CPU that runs windows x64, so CPU_haveCPUID can just return 1, and the empty macro can be replaced with a small wrap around the __cpuid intrinsic.
2014-02-22 19:10:45 -08:00
Sam Lantinga
1dfdcf3ef4 Fixed bug 2335 - Fails to build on Debian GNU/kFreeBSD
Felix Geyer

Starting from version 2.0.1 libsdl fails to build on Debian GNU/kFreeBSD in SDL_cpuinfo.c.

GNU/kFreeBSD defines __FreeBSD_kernel__ but not __FreeBSD__.
The #ifdef __FreeBSD__ check should be extended for __FreeBSD_kernel__, see the attached patch.

Build log:
libtool: compile:  gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -DUSING_GENERATED_CONFIG_H -Iinclude -I/«BUILDDIR»/libsdl2-2.0.1+dfsg1/include -mmmx -m3dnow -msse -msse2 -fvisibility=hidden -D_REENTRANT -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-kfreebsd-gnu/dbus-1.0/include -DHAVE_USBHID_H -DUSBHID_NEW -D_REENTRANT -Wall -c /«BUILDDIR»/libsdl2-2.0.1+dfsg1/src/cpuinfo/SDL_cpuinfo.c  -fPIC -DPIC -o build/.libs/SDL_cpuinfo.o
/«BUILDDIR»/libsdl2-2.0.1+dfsg1/src/cpuinfo/SDL_cpuinfo.c: In function 'SDL_GetSystemRAM':
/«BUILDDIR»/libsdl2-2.0.1+dfsg1/src/cpuinfo/SDL_cpuinfo.c:632:35: error: 'HW_MEMSIZE' undeclared (first use in this function)
             int mib[2] = {CTL_HW, HW_MEMSIZE};
                                   ^
/«BUILDDIR»/libsdl2-2.0.1+dfsg1/src/cpuinfo/SDL_cpuinfo.c:632:35: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [build/SDL_cpuinfo.lo] Error 1
2014-02-22 18:01:18 -08:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Sam Lantinga
420a70436c Fixed bug 2376 - no SDL_HasAVX
Haneef Mubarak

AVX is the successor to SSE* and is fairly widely available. As such, it really ought to be detectable.

This functionality ought to be trivial to implement, and not having it means being forced to write an ugly workaround to check for AVX (so that normal SSE can be used if AVX is not available).

Here is an example on detecting AVX from SO (it actually shows ways to cehck for all of teh fancy instructions):

http://stackoverflow.com/questions/6121792/how-to-check-if-a-cpu-supports-the-sse3-instruction-set
2014-02-02 00:33:31 -08:00
Ryan C. Gordon
82edee6971 Make internal SDL sources include SDL_internal.h instead of SDL_config.h
The new header will include SDL_config.h, but allows for other global stuff.

--HG--
extra : rebase_source : ddf4a4c0dc2c554b98c82700798f343cd91b16e3
2013-11-24 23:56:17 -05:00
Ryan C. Gordon
c7744104c6 Initialize MEMORYSTATUSEX size before GlobalMemoryStatusEx() (thanks, Justin!).
Fixes Bugzilla #2177.
2013-10-23 19:52:14 -04:00
Sam Lantinga
44dbed38ac Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Andreas Ertelt

The problem in question is caused by changeset 7771 (http://hg.libsdl.org/SDL/rev/4434498bf4b9 / https://bugzilla.libsdl.org/show_bug.cgi?id=2121)

The redefinition of __inline__ (introduced by the addition of begin_code.h:128's "|| __STRICT_ANSI__") results in mingw's gcc throwing multiple

   warning: always_inline function might not be inlinable [-Wattributes]

as well as a whole bunch of redefinitions of mingw internals which break linking of projects including the SDL2 headers.
2013-10-20 21:56:15 -07:00
Sam Lantinga
a999af88e9 Fixed building using MinGW
Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
2013-10-17 23:02:29 -07:00
Sam Lantinga
22648bd334 Fix to unbreak SDL_GetSystemRAM() on FreeBSD
Marcus von Appen

Revision c47ae79f0de8 of the SDL hg repo introduces the new
SDL_GetSystemRAM() function, which breaks the build on FreeBSD. Find
attached a patch, which unbreaks the build and also should (for most
cases) properly implement the sysctl support it.
2013-10-17 20:49:30 -07:00
Sam Lantinga
308e51f9a2 Fixed compiling on Mac OS X, added a system RAM test 2013-10-17 11:56:33 -07:00
Sam Lantinga
73ef0c776e The _SC_PHYS_PAGES method of calculating RAM works on Linux. 2013-10-17 11:32:14 -07:00
Sam Lantinga
a04ca13c2d Added an API to get the amount of system RAM 2013-10-17 11:32:56 -07:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
f380ecb137 Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Sam Lantinga
9844cacdd7 Fixed bug 1434 - Add AltiVec detection for OpenBSD/powerpc
Brad Smith 2012-02-29 19:31:46 PST

The attached patch adds AltiVec detection for OpenBSD/powerpc. Please apply the
patch to both 2.0 and 1.2.
2012-07-18 13:06:38 -07:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Ryan C. Gordon
bc13816375 Fixed a whole slew of compiler warnings that -Wall exposed. 2011-10-13 01:08:30 -04:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
e4a0db291e Re-added the 3DNow! and AltiVec instruction support. 2011-02-22 21:44:36 -08:00
Sam Lantinga
8ecd7110d2 Fixed SSE4 detection, and split it into SSE 4.1 and 4.2 2011-02-11 23:02:35 -08:00
Sam Lantinga
e5803d148c Happy 2011! :) 2011-02-11 22:37:15 -08:00