aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_cpu_detect.c
Commit message (Collapse)AuthorAgeFilesLines
* util,gallivm: Explicitly enable/disable fma attribute.Jose Fonseca2016-06-101-0/+1
| | | | | | | | | | As suggested by Roland Scheidegger. Use the same logic as f16c, since fma requires VEX encoding. But disable FMA on LLVM 3.3 without MCJIT. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium,utils: Fix trivial sign compare warningsJan Vesely2016-05-031-1/+1
| | | | | | | Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jakob Sinclair <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* include,gallium: Remove pre-MSVC 2013 compatibility.Jose Fonseca2016-02-111-2/+1
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: Add DragonFly supportFrançois Tigeot2016-01-311-1/+1
| | | | | Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]>
* Remove Sun CC specific code.Jose Fonseca2015-12-021-5/+5
| | | | | Reviewed-by: Matt Turner <[email protected]> Acked-by: Alan Coopersmith <[email protected]>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-4/+4
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* gallium/util: make sure cache line size is not zeroLeonid Shatz2015-01-051-1/+5
| | | | | | | | | | The "normal" detection (querying clflush size) already made sure it is non-zero, however another method did not. This lead to crashes if this value happened to be zero (apparently can happen in virtualized environments at least). This fixes https://bugs.freedesktop.org/show_bug.cgi?id=87913 Cc: "10.4" <[email protected]>
* gallium/util: fix crash with daz detection on x86Roland Scheidegger2015-01-051-1/+1
| | | | | | | | | | The code used PIPE_ALIGN_VAR for the variable used by fxsave, however this does not work if the stack isn't aligned. Hence use PIPE_ALIGN_STACK function decoration to fix the segfault which can happen if stack alignment is only 4 bytes. This fixes https://bugs.freedesktop.org/show_bug.cgi?id=87658. Cc: "10.4" <[email protected]>
* util: don't try to emit half-float intrinsics if avx isn't availableRoland Scheidegger2014-09-191-1/+1
| | | | | | | | | These instructions only have vex encodings, thus they can't be used without avx. (Technically, one can still use avx-128 if avx isn't available because the environment doesn't store the ymm registers, however I don't think llvm can.) Reviewed-by: Jose Fonseca <[email protected]>
* util: Fix unmatched parenthesis.Vinson Lee2013-09-101-1/+1
| | | | | | | | | Fixes MSVC build error introduced with commit 923d3467147dd301d94ed3e6b41295fb2bcd6f47. src\gallium\auxiliary\util\u_cpu_detect.c(286) : fatal error C1012: unmatched parenthesis : missing '(' Signed-off-by: Vinson Lee <[email protected]>
* util: don't use _fxsave() with MSVC 2010 or olderBrian Paul2013-09-101-1/+4
| | | | | | And update _MSC_VER comments in p_config.h Reviewed-by: Roland Scheidegger <[email protected]>
* util: add avx2 and xop detection to cpu detection codeRoland Scheidegger2013-08-201-0/+48
| | | | | | | | | | Going to need this soon (not going to bother with avx2 intrinsics at this time but don't want to do workarounds for true vector shifts if llvm itself can use them just fine and won't need the gazillion instruction emulation). Not really tested other than my cpu returns 0 for these features... (I have no idea if llvm actually would emit avx2/xop instructions neither...) Reviewed-by: Jose Fonseca <[email protected]>
* util: (trivial) fix asm input/output list for fxsaveRoland Scheidegger2013-08-091-1/+1
| | | | | Otherwise gcc might do very unsafe optimizations, spotted by Uros Bizjak. Hopefully this time it's finally right?
* util: (trivial) fix more compile errors in u_cpu_detect (gcc/x86 this time).Dieter Nützel2013-08-091-1/+1
| | | | Oops. Should fix https://bugs.freedesktop.org/show_bug.cgi?id=67921
* util: (trivial) fix compile error with MSVC on x86Roland Scheidegger2013-08-081-1/+1
|
* util: try much harder to set DAZ flagRoland Scheidegger2013-08-081-0/+29
| | | | | | | | | | | | | | | | | | While so far this only causes some harmless test failures, there's lots more cpus with DAZ. All 64bit capable ones can do it (particularly relevant for AMD cpus as they supported sse3 very very late) but if really necessary we can check support for that for real with some more magic. (In fact just about ANY cpu with sse2 can support DAZ, I believe the only exception are first gen P4 (Willamette) and from those only early steppings which can't do it it's almost like intel forgot to add it... - a real pity though docs say you can't just try to set it as they will throw a GPF.) While this was meant to address https://bugs.freedesktop.org/show_bug.cgi?id=67672 it does not fix it. Most likely the tests need fixing as I don't think there's any guarantee about denorm handling in the reference math library functions if the flags aren't set to standard values. Nevertheless enabling DAZ on all cpus which can do it should be the right thing to do. Reviewed-by: Jose Fonseca <[email protected]>
* gallium/util: Fix detection of AVX cpu capsAndre Heider2013-07-231-2/+25
| | | | | | | | | | | | | | | | | For AVX it's not sufficient to only rely on the cpuid flags. If the CPU supports these extensions, but the OS doesn't, issuing these insns will trigger an undefined opcode exception. In addition to the AVX cpuid bit we also need to: * test cpuid for OSXSAVE support * XGETBV to check if the OS saves/restores AVX regs on context switches See "Detecting Availability and Support" at http://software.intel.com/en-us/articles/introduction-to-intel-advanced-vector-extensions Signed-off-by: Andre Heider <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* util: (trivial) add has_popcnt fieldRoland Scheidegger2013-06-191-0/+1
| | | | | | Not used yet but there's a couple of places in llvmpipe which should use this (occlusion count is currently very inefficent if there's no cpu popcnt instruction).
* util: Use sizeof(void *) rather than 0 as the fallback cache line sizeRichard Sandiford2013-06-101-0/+5
| | | | | | | | Without this, llvmpipe ends up giving a zero size to all uncompressed textures on non-x86 systems, since align() cannot handle a 0 alignment. Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Richard Sandiford <[email protected]>
* gallivm: use f16c hw support for float->half and half->float conversionRoland Scheidegger2013-04-041-0/+1
| | | | | | | | Should be way faster of course on cpus supporting this (includes AMD Bulldozer and Jaguar cores, Intel Ivy Bridge and up (except budget models)). Passes piglit fbo-blending-formats GL_ARB_texture_float -auto on Ivy Bridge. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: Correct shift value for TSC feature detection.Maxence Le Doré2013-03-081-1/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* gallivm,llvmpipe: Use 4-wide vectors on AMD Bulldozer.José Fonseca2012-09-041-0/+5
| | | | | | 8-wide vectors is slower. Reviewed-by: Roland Scheidegger <[email protected]>
* util: Add cpuid for Solaris Studio.Vinson Lee2012-09-031-2/+2
| | | | | Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* util: add cpu detection for sse 4.2 and avxBrian Paul2011-04-071-0/+4
|
* util: simplify bit shifting in util_cpu_detect()Brian Paul2011-04-071-11/+11
|
* util: Use #ifdef instead of #if.Vinson Lee2010-08-211-1/+1
| | | | This is a typo fix of earlier commit 0f3b3751b8643352dcc242567b3696bd1505df1d.
* util: Define dump_cpu only for DEBUG builds.Vinson Lee2010-08-211-0/+2
| | | | | | | dump_cpu is used only when DEBUG is defined. Fixes the following GCC warning on builds without DEBUG defined. util/u_cpu_detect.c:76: warning: 'debug_get_option_dump_cpu' defined but not used
* util: Remove the x86 exception handlers.José Fonseca2010-08-211-55/+0
| | | | Unused now that check_os_katmai_support was removed.
* util: Remove check_os_katmai_support.Vinson Lee2010-08-161-119/+1
| | | | | | | | | | | | | | | | | check_os_katmai_support checks that the operating system running on a SSE-capable processor supports SSE. This is necessary for unpatched 2.2.x and earlier kernels. 2.4.x and later kernels support SSE. check_os_katmai_support will disable SSE capabilities for 32-bit x86 operating systems for which there is no code path. Currently, this function handles Linux, Windows, and several BSDs. Mac OS, Cygwin, and Solaris are several operating systems with no code paths. Rather than add code for the unhandled operating systems, remove this function altogether. This will fix SSE detection on all recent 32-bit x86 operating systems. This completely breaks functionality on unpatched 2.2.x and earlier kernels, although there are likely no Gallium3D users on such operating systems.
* gallium: Make printing info on debug builds default offJakob Bornecrantz2010-08-151-1/+1
| | | | | | | This commit silences the printing off most of the debug information when running debug builds. The big culprits are: the tgsi sanity checker that gets run on all shaders on debug; all the options; and finaly the cpu caps printer.
* u_cpu_detect: remove arch and little_endianLuca Barbieri2010-08-141-18/+0
| | | | | This logic duplicates the one in p_config.h, so remove it and adjust the only two places that were using it.
* gallium: remove stray semicolonsBrian Paul2010-08-061-1/+1
|
* util: Add option to not dump cpu capsJakob Bornecrantz2010-08-051-17/+22
|
* util: fix unused function warning on non-x86Brian Paul2010-07-261-0/+3
|
* util: fix CPU detection on OS Xnobled2010-07-261-6/+6
| | | | | | s/PIPE_OS_DARWIN/PIPE_OS_APPLE, since there is no PIPE_OS_DARWIN. Acked-by: Vinson Lee <[email protected]>
* gallium/util: replace //-style commentsBrian Paul2009-11-171-3/+3
|
* util: Drop return value from cpuid().José Fonseca2009-10-281-10/+6
|
* util: Fix cpuid on MSVC.José Fonseca2009-10-281-1/+5
|
* util: Set cpu endianness too.José Fonseca2009-10-221-0/+2
|
* gallium/util: fix cpu detection on ppcMarc Dietrich2009-10-211-5/+9
| | | | | | As we are compiling with -D_BSD_SOURCE, sigjmp_buf and siglongjmp should be replaced by the non-sig functions (see man 3 setjmp). Tested on linux/cell.
* util: Fix cpu detection on Windows. Cleanup.José Fonseca2009-10-141-10/+9
|
* util: Force ESI register for cpuid's ebx result.José Fonseca2009-10-091-1/+1
| | | | | | Fixes a segfault and better code. Unfortunately using an arbitrary register ("=r") causes the gcc to abort when the code is optimized saying it can't satisfy the constraint. Setting seems to do the trick.
* util: Improve the cpuid assembly.José Fonseca2009-10-051-10/+12
| | | | | | No need to save ebx on 64bit. Use just xchgl. Refer to gcc's cpuid.h header. Thanks to Uros Bizjak for pointing this out.
* util: Fix cpuid invocation for x86_64.José Fonseca2009-10-041-11/+23
|
* util: Cleanup u_cpu_detect, build. Support X86_64 and detect SSE4.1 too.José Fonseca2009-09-291-373/+368
| | | | | | | | | | I was waiting for the need to use this code to arise, and it finally came. I've tested building this on Linux and Windows, both x86 and x64_64. But it might break other platforms. Please bear with me and help me fix it. Many thanks to Dennis Smit who submitted this, and Eric Anholt whose work this was based on.
* gallium: Import Dennis Smit cpu detection code.José Fonseca2008-03-101-0/+506
It still needs a slight code massasing to integrate with the rest of gallium (namely mapping the OS_* ARCH_* defines), but I'm commiting anyway so that it is available to be used when somebody needs it.