summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsimd_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Make the inline CPU detection functions also staticThiago Macieira2013-03-261-2/+2
| | | | | | | | | | | | Since qCpuHasFeature() checks the static qCompilerCpuFeatures variable and that variable's value might change depending on the compiler flags, it's best to ensure that the function is not subject to link-time merging. That would be bad if it happened when qCpuHasFeature() was used from a file with higher CPU compiler settings than the default, as it would incorrectly conclude that certain features are always available. Change-Id: I8bacde056fb89869ec1d306a163742e72522315e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-141-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * Allow x86intrin.h with ICC 13.1Thiago Macieira2013-02-061-1/+1
| | | | | | | | | | | | | | | | The Intel C++ Composer XE 2013 Update 2 (a.k.a. ICC 13.1) has fixed the bug of the undefined intrinsics. Change-Id: If837a0800725d55fed7eff39b9d52c359dabb073 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Let ICC 13 build Qt again if the system compiler is GCC 4.7.Thiago Macieira2013-02-011-1/+2
| | | | | | | | | | | | | | | | | | | | GCC 4.7 has new builtins in x86intrin.h that ICC 13 does not (yet) understand, causing compilation errors. /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include/adxintrin.h(36): error: identifier "__builtin_ia32_addcarryx_u32" is undefined Change-Id: I1845ccc3bf3ac15aef063bc3f998c5839fa51866 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
|/ | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Make the CPU detection much more efficient in user codeThiago Macieira2012-07-021-3/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | First, check that the option in question hasn't been already enabled by the compiler, via compiler switches. If it has been, then we don't need to verify anything, and we can assume that it's safe to use such instructions. For example, on an x86-64 build, qCpuHasFeature(SSE2) is always a constant true. If the compile-time check fails, then we proceed to try and detect the processor features at runtime. But instead of insisting on a call to qDetectCPUFeatures, allow the code using the detection to read from a variable and simply test it for values. Only if the variable isn't initialised should it make a function call. The Q_ASSUME allows this code to be very efficient even with multiple uses of qCpuHasFeature. Change the uninitialised value from -1 to 0 so that simpler instructions can be used to check for non-initialisation. The qDetectCPUFeatures function is renamed to qDetectCpuFeatures to match the Qt coding style and also to catch uses this code that need to be adapted. Change-Id: I24ca5a6ad21075e2e249e1a4f8f5057b8f68ce7c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for the x86intrin.h header on GCC systems.Thiago Macieira2012-06-091-0/+6
| | | | | | | | | | | | This header can be included at any time on x86 systems and is present since the GCC versiosn that also support AVX. It contains intrinsics for instructions that have been present in x86 CPUs since the dawn of time. Change-Id: I9adb066c2c0b56ce8fd5ed7366716038f1254502 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix the confusion caused by the QT_ALWAYS_HAVE_xxx macrosThiago Macieira2012-05-311-1/+25
| | | | | | | | | | | | | | | | | | | | The QT_ALWAYS_HAVE_xxx macros are gone: they were hard to use and not defined properly. It indicated that the compiler was producing code that required that particular instruction set, so we could use it in our code unconditionally. Instead, let's use the GCC-style __SSE2__ and __ARM_NEON__. MSVC does not generate the __SSE2__ macro, so let's do it for the compiler. Also, define __AVX__ and the macros for the technologies leading to it when we manage to detect an /arch:AVX build (currently not possible, see note in the header). ICC and MSVC allow one to use the intrinsics anywhere, but for Qt all uses of the intrinsics are either in specially-built files, protected by runtime checks, or they are unconditional (qstring.cpp). So we only use the intrinsics when the compiler was instructed to generate code for that instruction set anyway. Change-Id: If8382f30422cee0e5831d051b003acf036824abf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Overhaul the qsimd_p.h: rename macros and update conditionalsThiago Macieira2012-05-311-14/+35
| | | | | | | | | | | | | | | The QT_HAVE_xxx macros are replaced with QT_COMPILER_SUPPORTS_xxx. They indicate that the compiler supports those intrinsics, but not necessarily that they can be used right now. ICC and MSVC allow one to use the intrinsics anywhere, but for Qt all uses of the intrinsics are either in specially-built files, protected by runtime checks, or they are unconditional (qstring.cpp). So we only use the intrinsics when the compiler was instructed to generate code for that instruction set anyway. Change-Id: Ie58eebbc0518ad1d5420a85174fd84153bb9abaa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add detection code for AVX2, HLE, RTM and AES to qsimd.cppThiago Macieira2012-04-251-1/+4
| | | | | | | | | | | | | | | AES is currently not enabled, since we don't use it for anything. The code is here with the proper detection should we want to in the future. RTM and HLE (Transactional Memory Extensions) I'll use soon in the locking code. Also rename a few variables to make it easier to read later on. Change-Id: I800c66d7e1ba86ec037692928d94f53ea5d5868f Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Merge master into api_changesKent Hansen2012-03-271-16/+0
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qisenum.h src/dbus/qdbusconnection_p.h src/widgets/kernel/qwidget.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: I85102515d5fec835832cc20ffdc5c1ba578bd01d
| * Remove support for Mac OS X compilers without the -Xarch flagThiago Macieira2012-03-241-16/+0
| | | | | | | | | | | | | | | | | | | | This was necessary in order to support Universal builds when this flag wasn't present. This flag can be considered present in all builds now. What's more, Apple doesn't support PowerPC builds anymore anyway, so we won't either. Change-Id: I79c45a450ddf7d58cd4b7da03d6bbf7d3feb0d9a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* | Remove detection for MMX support and related technologyThiago Macieira2012-03-231-19/+8
|/ | | | | | | | | | | | This also removes the check for SSE, but the check for SSE2 and further technologies is kept. If SSE2 is present, then SSE is too. We don't have any code that uses the original SSE instructions only. Remove the CMOV detection, since we don't use that anywhere and we're not likely to ever use them.. Change-Id: I3faf2c555ad1c007c52a54644138902f716c1fe1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix compilation with MinGW-w64Jonathan Liu2012-02-081-0/+4
| | | | | | | | | | | | | | | Fix compilation with MinGW-w64 with the following changes: - Include intrin.h to fix __cpuid not declared error - Include intrin.h before *mmintrin.h headers to avoid extern linkable mismatch - Use quintptr instead of unsigned long to handle LLP64 - Do not declare winuser.h structs already provided with MinGW-w64 - Work around IID_IShellItem being declared but not defined with MinGW-w64 - Remove incorrect use of SUCCEEDED macro on pointer Change-Id: Ia21f8e3a1d225cf501e646eacd968bfc744ce0a2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Windows: Fix inclusion of <windows.h>Friedemann Kleint2012-02-011-3/+0
| | | | | | | | | | | | | - Always use <qt_windows.h> as the last file to be included. - Remove it from some headers, use Qt::HANDLE instead of HANDLE. - Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE. - Add NOMINMAX to qt_windows.h to avoid problems with the min/max macros. - Remove <windows.h> from qplatformdefs.h (VS2005) Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+172
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12