summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_sse2.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use Q_DECL_VECTORCALL in a few more placesThiago Macieira2018-12-111-16/+16
| | | | | | | | | | | There were a few functions that passed vectors in parameters but did not mark as vectorcall. I've taken the opportunity to de-macroify one macro, but I'm not going to do it for the rest. Change-Id: I42a48bd64ccc41aebf84fffd1564bfc21faa2a14 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add AVX2 versions of qt_memfill32 and qt_memfill64Thiago Macieira2018-12-111-2/+4
| | | | | | | | | | The implementation is almost the same 4-way-unrolled loop, but because of the wider registers, we fill 128 bytes per loop. Unlike the SSE2 implementation, the AVX2 version uses unaligned stores and won't try to align in the prologue, matching glibc's __memset_avx2 (also unaligned). Change-Id: Iba4b5c183776497d8ee1fffd15637ccb2a7b83bc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add SSE2 qt_memfill64Thiago Macieira2018-12-111-23/+57
| | | | | | | | Implemented by merging with the qt_memfill32 implementation in a non-inlining function. Change-Id: I343f2beed55440a7ac0bfffd15636f8ba995a2bd Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move qt_memfill32-based implementation of qt_memfill16 to genericThiago Macieira2018-11-111-23/+0
| | | | | | | | | | The SSE2 implementation and the one in qdrawhelper.cpp are almost identical. And if we make it so qt_memfill16 can tail-call to qt_memfill32, there's no need for inlining, so there's no need to keep it in qdrawhelper_sse2.cpp Change-Id: I343f2beed55440a7ac0bfffd15637027771c2254 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Optimize qt_memfill16, with tail jumpThiago Macieira2018-11-111-5/+6
| | | | | | | | This simplifies code generation and permits the compiler to implement a tail-jump optimization. Change-Id: I343f2beed55440a7ac0bfffd15636f640116313e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use qsizetype for qt_memfill functionsThiago Macieira2018-11-111-2/+2
| | | | | | | Just in case the image is larger than 2 GB (512 megapixels). Change-Id: I343f2beed55440a7ac0bfffd15636cbc68dfa13d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use regular SSE2 stores instead of non-temporal ones in qt_memfill32Thiago Macieira2018-11-081-8/+8
| | | | | | | | | | There's no good reason to use non-temporal stores. Images may be 100x bigger than strings, but they're not so big that the non-temporal stores make sense. Patch-By: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Iba4b5c183776497d8ee1fffd156380ec9103ef1a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Avoid of bounds memory reads when scaling and mirroring imagesAllan Sandfeld Jensen2018-03-221-0/+10
| | | | | | | | | The bounds check we had wasn't complete for mirroring cases. Task-number: QTBUG-65387 Change-Id: I5333912621c1223f83b4f1b95f2b16d12b520bd2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Allow QImage with more than 2GByte of image dataAllan Sandfeld Jensen2017-07-081-2/+2
| | | | | | | | | | | | Changes internal data-size and pointer calculations to qssize_t. Adds new sizeInBytes() accessor to read byte size, and marks the old one deprecated. Task-number: QTBUG-50912 Change-Id: Idf0c2010542b0ec1c9abef8afd02d6db07f43e6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Annotate more implicit fallthroughsAllan Sandfeld Jensen2017-03-271-12/+12
| | | | | | | Reduces our number of gcc 7 warnings Change-Id: I792d658cbc11cad15cf45da3a36fc93fcdcc67ea Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix blending of RGB32 on RGB32 with partial opacityAllan Sandfeld Jensen2016-12-031-7/+4
| | | | | | | | | | | | | The alpha channel of an RGB32 image was not properly ignored when doing blending with partial opacity. Now the alpha value is properly ignored, which is both more correct and faster. This also makes SSE2 and AVX2 implementations match NEON which was already doing the right thing (though had dead code for doing it wrong). Change-Id: I4613b8d70ed8c2e36ced10baaa7a4a55bd36a940 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Avoid auto-vectorization of epilogues of manual vectorizationAllan Sandfeld Jensen2016-10-111-7/+6
| | | | | | | | | | Defines a structure that tells the compiler in no uncertain terms the maximum number of times a loop can be run. The reduces the size of qdrawhelper_avx2.o from 22kbytes to 11kbytes. Change-Id: Ie3d6281b04b4be3332497c15f3dfe9f185e20507 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
| | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Move composition out of qdrawhelper.cAllan Sandfeld Jensen2015-04-161-84/+0
| | | | | | | | | Also changes the way the SSE2 composition modes are inserted into the table, so it is handled like all the other tables and doesn't require duplicating most of the table. Change-Id: I8de383caece0367bc7466d7a1b145aa820c3bd6a Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Implement radial and conical gradients for rgb64 renderingAllan Sandfeld Jensen2015-04-151-1/+1
| | | | | | | | | | Adds the last two missing source types to rgb64 rendering. Conical and radial gradients. At the same time linear gradients are moved to a template form to increase code sharing. Change-Id: I30fdd0837b0da03e3447683856ebbe4d7f48df6c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Solid and gradients in high color accuracyAllan Sandfeld Jensen2015-04-101-5/+12
| | | | | | | | | | | | | This patch updates the internal color precisions of solids and gradients to 16bit per color. This makes it possible to render at higher precision on non-premultiplied ARGB32, the RGB30 formats and any other hi-color formats if more are added. [ChangeLog][QtGui][Painting] Internal precision of solids and gradients is now up to 16bit per color. Change-Id: Ieae5468bd6de1f56adfa4cb9fa966faf2ed824fd Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QtGui: Fix const correctness in old style castsThiago Macieira2015-03-121-4/+4
| | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946844bc31eb8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Remove support for some very old compilersAllan Sandfeld Jensen2015-02-151-11/+0
| | | | | | | Remove code supporting gcc 4.0 and earlier, and MSVC 2005 and earlier. Change-Id: I3304e11bb38c101f113c124e8e533c5578badf34 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Use the new warning enabling/disabling macros in qtbaseThiago Macieira2014-12-031-3/+1
| | | | | | Change-Id: I91ff06644e8047c2ca483f9768b46c1372eb6171 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Avoid out of bounds memory reads when scaling imagesLars Knoll2014-03-281-3/+11
| | | | | | | | | | | | | | | | The calculation of the width/height required for the scaling algorithm was prone to floating point rounding issues, where the lower value got rounded down, the higher one rounded up. This could lead to a situation where we iterated over one more line/pixel in the line than we have in the source image. Correct this by passing the dimension of the source image into the function and bounds checking the values before iterating. Task-number: QTBUG-35927 Change-Id: If44b2235a479224660d508a0504fec40d724763a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-03-171-0/+7
|\ | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp src/gui/painting/qdrawhelper_avx.cpp src/gui/painting/qdrawhelper_x86_p.h Change-Id: I09352d05119f6fd000319074a2705b38361b2c90
| * Fix drawCachedGlyphs on RGBA8888Allan Sandfeld Jensen2014-02-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | drawCachedGlyphs draws with the wrong color on RGBA8888. The issue is that the draw routines bitmapblit_quint32 and alphamapblit_quint32 while safe to use on rgba formats, needs to have the input color converted. This patch adds small wrapper functions for bitmapblit and alphamapblit that converts the formats. Two tests are extended to ensure we have test coverage. Change-Id: I5f99f3795eba46a69d4df5b167e6099024e9a060 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Optimize qt_memfill32 a littleThiago Macieira2014-02-121-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmarking shows it took up to 3.5% of Qt Creator's initialization cost. Optimize by modifying only one variable per loop: instead of updating n and dst128, we only update one variable at a time. Removing the Duff's Device also improves the code, since the compiler won't try to update dst128 four times per loop, only once. The moving of the epilogue close to the prologue was just to make the code a little cleaner. Change-Id: I5b74e27d520ca821f380aef0533c244805f003b7 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Make qt_memfill{16,32} unconditionalThiago Macieira2014-01-161-4/+4
|/ | | | | | | | | | | | | These two functions used to cause a runtime detection of the CPU features in order to improve their performance. Since the last two commits, there's no runtime detection of either SSE2 or Neon support, so there's no point in attempting runtime detection. Task-number: QTBUG-30440 Change-Id: I54fe92787c983003c2cc867ee636daec30063033 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* Fixed GCC 3.4 build with sse2 enabled.Samuel Rødal2012-10-191-1/+2
| | | | | | | | With minimal effort we can keep the GCC 3.4 build working. Task-number: QTBUG-19803 Change-Id: I31611a27b97d5ac426ea857d8f1b656dc6f5377a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement the missing raster operations that were in Qt 3Andy Shaw2012-09-271-2/+12
| | | | | | | | | Although not widely used, the raster operations from Qt 3 were useful and some of them were already implemented, this brings the rest of them back for those who need them. Change-Id: Id538611eaaba9be3d39bf2dd33b6c532f5d4aba8 Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Overhaul the qsimd_p.h: rename macros and update conditionalsThiago Macieira2012-05-311-2/+2
| | | | | | | | | | | | | | | 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 AVX support for the painting and image code.Thiago Macieira2012-05-221-0/+5
| | | | | | | | There are no new routines, this is just the old SSE2 and SSSE3 code compiled in AVX mode, meaning the instructions use the VEX prefix. Change-Id: I79a8bfaf6b30a050618db899f5a3bbc220449f0b Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove the old code using MMX registers.Thiago Macieira2012-03-281-2/+2
| | | | | | | | | | | | | | | | | | | There are only 8 MMX registers, each 64-bit wide, and they alias the x87 registers. The access to the MMX register cannot use the new VEX-prefix instructions either. All of the functions being replaced are either present in the qdrawhelper_sse2.cpp and qdrawhelper_ssse3.cpp files, or the plain C++ function in qdrawhelper.cpp is vectorised when compiled with -ftree-vectorize (enabled in -O3), if SSE2 support is enabled. All x86-64 processors have SSE2, so this is a net improvement for 64-bit builds. For 32-bit builds, without further support this will cause the code to use non-vector or x87 instructions, which aren't the best. The solution will come in another commit. Change-Id: I4a22d8a2516b79172867510202d0fd627db54807 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed jagged lines when drawing scaled image with raster engine.Kim Motoyoshi Kalland2012-02-071-2/+3
| | | | | | | Task-number: QTBUG-24055 Change-Id: I97a0bf3711e1b4423e2c76ec907c9e2a57522ff9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Removed image format specific template functions in raster engine.Kim Motoyoshi Kalland2012-02-071-1/+1
| | | | | | | | Simplified the raster engine by treating image formats in a more generic way and removed some unused code. Change-Id: Ib3979a1a6e3e6f17c5002248545779ec36fff7c9 Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* 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>
* Improve drawing scaled image with raster using SSE2Olivier Goffart2011-10-241-0/+116
| | | | | | | | | | | | | | That codepath is taken in qml when an Image specify with and hight and is not smooth, and the image contains alpha contents The changes in qdrawingprimitive_sse2_p.h just put some code from the BLEND_SOURCE_OVER_ARGB32_SSE2 macro into a sub macro to allow its reuse The code that is not SSE2 in qt_scale_image_argb32_on_argb32_sse2 comes from the qt_scale_image_argb32_on_argb32 in qblendfunctions.cpp Change-Id: I071a040af4514fb21777dead9f7c5baf16071d59 Reviewed-by: Samuel Rødal <samuel.rodal@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
* Fixes warnings about unused variablesOlivier Goffart2011-05-101-4/+0
| | | | | Reviewed-by: Samuel (cherry picked from commit ddd253e14318af45e5c56df736028b88257068c4)
* Another attempt at fixing the MSVC2005 build.Samuel Rødal2011-05-101-1/+6
| | | | | | | | Apparently direct casting is illegal there too, even though they don't have the cast operators. Reviewed-by: Kim (cherry picked from commit 45c60ceac3d5a401543d7d56a44d1f9227464431)
* Compile fix in qdrawhelper_sse2.cpp for MSVC 2005.Samuel Rødal2011-05-101-0/+5
| | | | (cherry picked from commit 7f921ea08c296e7451a44a1dae15350ae183ea20)
* Compile fix in qdrawhelper_sse2.cpp.Samuel Rødal2011-05-101-1/+1
| | | | (cherry picked from commit 7cc4ffce36c24596630ca83cd6418869d6383670)
* Added support for six-parameter radial gradients.Samuel Rødal2011-05-101-0/+2
| | | | | | | | | The extended radial gradients conform to the radial gradient specification in HTML 5 canvas. Task-number: QTBUG-14075 Reviewed-by: Andreas Kling (cherry picked from commit da55c1ea92474e989e5582b02815936bbf584405)
* Improved gradient table generation performance for two-stop gradients.Samuel Rødal2011-05-101-72/+28
| | | | | | | | | Two stops is a fairly common case so we gain quite a bit by special casing it. Improves performance by 10 % in parcycle benchmark, and by 90 % in a synthetic benchmark. Reviewed-by: Andreas Kling (cherry picked from commit 5b74a70ac630073582be56f8a0539624a1080185)
* Optimized radial gradient fetch using SSE 2.Samuel Rødal2011-05-101-0/+84
| | | | | | | | On an i7 this improves performance by 22 % in parcycle, 107 % in default svgviewer example, and 283 % in a synthetic radial gradient benchmark. Reviewed-by: Andreas Kling (cherry picked from commit 26bd3dccdee8c6a8f1cf9d254a2a6be7d403aa8d)
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+496
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