summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qsimd_p.h
Commit message (Collapse)AuthorAgeFilesLines
* qsimd_p.h: add a hack to allow AVX to work with MinGWThiago Macieira2022-01-201-0/+23
| | | | | | | | | | | | | | | | | | | GCC is unable to emit the SEH metadata about the stack aligning that is required to execute AVX aligned instructions (VMOVDQA, VMOVAPS, etc.), so it just doesn't align the stack. That causes crashes on a 50/50 chance every time the compiler attempts to address a stack-aligned variable. In a debug-mode build, because it always loads & saves everything on the stack, the chance of a crash happening is a near certainty. So we hack around it by going behind the compiler's back and instructing the assembler to emit the unaligned counterparts of the instructions every time the compiler wished to emit the aligned one. There's no performance penalty: if the variable is actually aligned, the unaligned instruction executes in the exact same time. Change-Id: Ib42b3adc93bf4d43bd55fffd16c29cac0da18972 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qsimd.h: move the rest of the __xxx__ definitions that MSVC lacksThiago Macieira2022-01-201-27/+2
| | | | | | | | | | The Intel compiler is now based on Clang, so it always defines the macros like Clang and GCC do, so we don't need to worry about it any more. We only need to define the macros that MSVC lacks. Change-Id: Ib42b3adc93bf4d43bd55fffd16c10f0f6fef43ef Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* wasm: add simd supportLorn Potter2021-10-051-1/+4
| | | | | | | | | | | | | | | | | | Emscripten only supports SSE1, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, and 128-bit AVX instruction sets at this time. https://emscripten.org/docs/porting/simd.html Browsers might need to enable simd support in the advanced configurations about: config or chrome:flags Enable by configuring Qt with -sse2 Pick-to: 6.2 Fixes: QTBUG-63924 Change-Id: Ifeafae20e199dee0d19689802ad20fd0bd424ca7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* qsimd: Don't force RDRND on if __AVX2__Thiago Macieira2021-06-221-5/+4
| | | | | | | | | | | | Like AESNI, RDRAND is an optional extra feature that is not always enabled in all parts. Probably something to do with export restrictions, but I've only seen that in low-end parts. Drive-by removal of "AES" where it was no longer relevant. Pick-to: 6.2 Change-Id: I7246c3e7bb894e0d9521fffd168af3fc0fb638a1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix SSE4.1, RDSEED requirement for clang-cl buildsAllan Sandfeld Jensen2021-06-171-1/+5
| | | | | | | | | | | | | | A misunderstanding seems to have caused several files to be compiled with extra runtime arch options. We need to disable multi-target functions though, because it doesn't work with clang-cl headers. Task-number: QTBUG-88081 Task-number: QTBUG-88434 Pick-to: 6.2 Change-Id: Ic5829540f9007428c80f9a7bd46af35540745ccd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add runtime ARM64 AES checkAllan Sandfeld Jensen2021-05-201-17/+29
| | | | | | | | | | | | Adds runtime CPU detection for Windows and macOS, and switches feature detection of AES to runtime like for x86, So far only on ARM64, since gcc doesn't do function versioning on ARM32, but clang can, so it could be added later. Change-Id: Ibe5d60f48cdae3e366a8ecd6263534ba2b09b131 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add runtime aes/crypto check for ARMAllan Sandfeld Jensen2021-04-211-0/+5
| | | | | | | Yocto apparantly enables it hard at compile time. Change-Id: I1d4c7402eacc714859c61f469ebed85682d48b51 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* string 16<->8 bits conversion: SIMD on arm32Nick Shaforostoff2021-03-081-0/+16
| | | | | | | | this adds emulation for 2 NEON commands that armv7 lacks this increases conversion speed by around 50% in my simple tests Change-Id: I4f52d353184e9a8d88089de60e17bd5670637c0c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add a public qsimd.h headerLars Knoll2020-03-261-20/+1
| | | | | | | | This header only covers a part of what qsimd_p.h does, namely the compile time detection of simd extensions. Change-Id: I05f1d987f194a5bec335f2405cc2846fbaa88b66 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move qsimd* from corelib/tools to corelib/globalLars Knoll2020-03-261-0/+396
It's not used in tools at all and fits a lot better in global. Also fix the qsimd_x86* files to have a proper copyright header. Change-Id: Id3d8e7cfcd7769a1ca9f3d8cf6d357a31a99ba40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>