summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper.cpp
diff options
context:
space:
mode:
authorAdrian Perez de Castro <aperez@igalia.com>2013-01-18 19:36:54 +0200
committerThiago Macieira <thiago.macieira@intel.com>2014-06-27 08:26:49 +0200
commit416c112aea592e41a66d65a21a885f31d9a566d0 (patch)
tree0375db3fc4f39e92c401aff0b6ca1c470c3cb350 /src/gui/painting/qdrawhelper.cpp
parentea6352109b6b73e72b578534fe6d1c90767a22a3 (diff)
MIPS: Support recognition of the DSP ASE at run-time
Add detection of MIPS DSPr2 at run-time in qsimd.cpp. This makes it possible to have generic Qt builds for MIPS that can enable the fast code paths for processors with the DSP ASE at run-time. Also, this makes it possible to manually disable them by setting the environment variable "QT_NO_CPU_FEATURE=dspr2". Last, but not least, functions requiring DSPr2 are not enabled when running in CPUs with version-1 DSP. Change-Id: Ia5a01d84119553c22ab83386c74a6cb8ba5fee53 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r--src/gui/painting/qdrawhelper.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index b5ccafdf9a..2b40bf37e1 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -6651,10 +6651,13 @@ void qt_memfill16(quint16 *dest, quint16 color, int count)
}
#endif
#if !defined(__SSE2__) && !defined(__ARM_NEON__)
+# ifdef QT_COMPILER_SUPPORTS_MIPS_DSP
+extern "C" void qt_memfill32_asm_mips_dsp(quint32 *, quint32, int);
+# endif
+
void qt_memfill32(quint32 *dest, quint32 color, int count)
{
# ifdef QT_COMPILER_SUPPORTS_MIPS_DSP
- extern "C" qt_memfill32_asm_mips_dsp(quint32 *, quint32, int);
qt_memfill32_asm_mips_dsp(dest, color, count);
# else
qt_memfill_template<quint32>(dest, color, count);
@@ -6776,7 +6779,13 @@ void qInitDrawhelperAsm()
qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon;
#endif
-#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP)
+#ifdef Q_PROCESSOR_MIPS_32
+ qt_memfill32 = qt_memfill32_asm_mips_dsp;
+#endif // Q_PROCESSOR_MIPS_32
+
+#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP) || defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
+ if (features & (DSP | DSPR2)) {
+ // Composition functions are all DSP r1
functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_asm_mips_dsp;
functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_mips_dsp;
functionForMode_C[QPainter::CompositionMode_DestinationOver] = comp_func_DestinationOver_mips_dsp;
@@ -6820,8 +6829,9 @@ void qInitDrawhelperAsm()
#else
qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_mips_dsp;
#endif // QT_COMPILER_SUPPORTS_MIPS_DSPR2
+ }
+#endif // QT_COMPILER_SUPPORTS_MIPS_DSP || QT_COMPILER_SUPPORTS_MIPS_DSPR2
-#endif // QT_COMPILER_SUPPORTS_MIPS_DSP
if (functionForModeSolidAsm) {
const int destinationMode = QPainter::CompositionMode_Destination;
functionForModeSolidAsm[destinationMode] = functionForModeSolid_C[destinationMode];