summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-05-30 14:38:16 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-31 17:55:37 +0200
commit398c8513b172d4605a27dfa6125045b55e7cb29e (patch)
treeb5997e08351873452745f8b20f22558d66710e40 /src/gui/painting
parent5cbdba588a14e05fd282b5850a3e7b66fd9b2b65 (diff)
Overhaul the qsimd_p.h: rename macros and update conditionals
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>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qdrawhelper.cpp26
-rw-r--r--src/gui/painting/qdrawhelper_avx.cpp2
-rw-r--r--src/gui/painting/qdrawhelper_iwmmxt.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_mips_dsp.cpp14
-rw-r--r--src/gui/painting/qdrawhelper_mips_dsp_p.h8
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_neon_p.h4
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_sse_p.h4
-rw-r--r--src/gui/painting/qdrawhelper_ssse3.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_x86_p.h10
-rw-r--r--src/gui/painting/qdrawingprimitive_sse2_p.h4
12 files changed, 44 insertions, 44 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 23a1853314..8888883e51 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -56,7 +56,7 @@
#include <private/qpainter_p.h>
#include <private/qdrawhelper_x86_p.h>
#include <private/qdrawhelper_neon_p.h>
-#ifdef QT_HAVE_MIPS_DSP
+#ifdef QT_COMPILER_SUPPORTS_MIPS_DSP
#include <private/qdrawhelper_mips_dsp_p.h>
#endif
#include <private/qmath_p.h>
@@ -555,7 +555,7 @@ static const uint *QT_FASTCALL fetchUntransformedRGB16(uint *buffer, const Opera
int length)
{
const quint16 *scanLine = (const quint16 *)data->texture.scanLine(y) + x;
-#ifdef QT_HAVE_MIPS_DSPR2
+#ifdef QT_COMPILER_SUPPORTS_MIPS_DSPR2
qConvertRgb16To32_asm_mips_dspr2(buffer, scanLine, length);
#else
for (int i = 0; i < length; ++i)
@@ -5805,7 +5805,7 @@ void qInitDrawhelperAsm()
const uint features = qDetectCPUFeatures();
if (false) {
-#ifdef QT_HAVE_AVX
+#ifdef QT_COMPILER_SUPPORTS_AVX
} else if (features & AVX) {
qt_memfill32 = qt_memfill32_avx;
qt_memfill16 = qt_memfill16_avx;
@@ -5823,7 +5823,7 @@ void qInitDrawhelperAsm()
qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_avx;
qScaleFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_avx;
#endif
-#ifdef QT_HAVE_SSE2
+#ifdef QT_COMPILER_SUPPORTS_SSE2
} else if (features & SSE2) {
qt_memfill32 = qt_memfill32_sse2;
qt_memfill16 = qt_memfill16_sse2;
@@ -5843,7 +5843,7 @@ void qInitDrawhelperAsm()
#endif
}
-#ifdef QT_HAVE_SSE2
+#ifdef QT_COMPILER_SUPPORTS_SSE2
if (features & SSE2) {
extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
@@ -5865,7 +5865,7 @@ void qInitDrawhelperAsm()
qt_fetch_radial_gradient = qt_fetch_radial_gradient_sse2;
}
-#ifdef QT_HAVE_SSSE3
+#ifdef QT_COMPILER_SUPPORTS_SSSE3
if (features & SSSE3) {
extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
@@ -5877,7 +5877,7 @@ void qInitDrawhelperAsm()
}
#endif // SSSE3
-#ifdef QT_HAVE_AVX
+#ifdef QT_COMPILER_SUPPORTS_AVX
if (features & AVX) {
extern void qt_blend_rgb32_on_rgb32_avx(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
@@ -5902,13 +5902,13 @@ void qInitDrawhelperAsm()
#endif // SSE2
-#ifdef QT_HAVE_SSE2
+#ifdef QT_COMPILER_SUPPORTS_SSE2
if (features & SSE2) {
functionForModeAsm = qt_functionForMode_SSE2;
functionForModeSolidAsm = qt_functionForModeSolid_SSE2;
}
#endif
-#ifdef QT_HAVE_AVX
+#ifdef QT_COMPILER_SUPPORTS_AVX
if (features & AVX) {
extern void QT_FASTCALL comp_func_SourceOver_avx(uint *destPixels,
const uint *srcPixels,
@@ -5925,7 +5925,7 @@ void qInitDrawhelperAsm()
}
#endif // SSE2
-#ifdef QT_HAVE_IWMMXT
+#ifdef QT_COMPILER_SUPPORTS_IWMMXT
if (features & IWMMXT) {
functionForModeAsm = qt_functionForMode_IWMMXT;
functionForModeSolidAsm = qt_functionForModeSolid_IWMMXT;
@@ -5933,7 +5933,7 @@ void qInitDrawhelperAsm()
}
#endif // IWMMXT
-#if defined(QT_HAVE_NEON)
+#if defined(QT_COMPILER_SUPPORTS_NEON)
if (features & NEON) {
qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
@@ -5968,7 +5968,7 @@ void qInitDrawhelperAsm()
}
#endif
-#if defined(QT_HAVE_MIPS_DSP)
+#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP)
functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_asm_mips_dsp;
functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_mips_dsp;
@@ -5983,7 +5983,7 @@ void qInitDrawhelperAsm()
destStoreProc[QImage::Format_ARGB32] = qt_destStoreARGB32_mips_dsp;
-#endif // QT_HAVE_MIPS_DSP
+#endif // QT_COMPILER_SUPPORTS_MIPS_DSP
if (functionForModeSolidAsm) {
const int destinationMode = QPainter::CompositionMode_Destination;
functionForModeSolidAsm[destinationMode] = functionForModeSolid_C[destinationMode];
diff --git a/src/gui/painting/qdrawhelper_avx.cpp b/src/gui/painting/qdrawhelper_avx.cpp
index 28ba5f8aa3..ab1ee94784 100644
--- a/src/gui/painting/qdrawhelper_avx.cpp
+++ b/src/gui/painting/qdrawhelper_avx.cpp
@@ -41,7 +41,7 @@
#include <private/qsimd_p.h>
-#ifdef QT_HAVE_AVX
+#ifdef QT_COMPILER_SUPPORTS_AVX
#define QDRAWHELPER_AVX
#ifndef __AVX__
diff --git a/src/gui/painting/qdrawhelper_iwmmxt.cpp b/src/gui/painting/qdrawhelper_iwmmxt.cpp
index 83764b41f2..0c70a3f8ef 100644
--- a/src/gui/painting/qdrawhelper_iwmmxt.cpp
+++ b/src/gui/painting/qdrawhelper_iwmmxt.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#ifdef QT_HAVE_IWMMXT
+#ifdef QT_COMPILER_SUPPORTS_IWMMXT
#include <mmintrin.h>
#if defined(Q_OS_WINCE)
@@ -143,6 +143,6 @@ void qt_blend_color_argb_iwmmxt(int count, const QSpan *spans, void *userData)
(CompositionFunctionSolid*)qt_functionForModeSolid_IWMMXT);
}
-#endif // QT_HAVE_IWMMXT
+#endif // QT_COMPILER_SUPPORTS_IWMMXT
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_mips_dsp.cpp b/src/gui/painting/qdrawhelper_mips_dsp.cpp
index 9b104eb5c9..b33329c090 100644
--- a/src/gui/painting/qdrawhelper_mips_dsp.cpp
+++ b/src/gui/painting/qdrawhelper_mips_dsp.cpp
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
-#if defined(QT_HAVE_MIPS_DSP)
+#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP)
extern "C" uint INTERPOLATE_PIXEL_255_asm_mips_dsp(uint x, uint a, uint y, uint b);
@@ -55,13 +55,13 @@ extern "C" uint * destfetchARGB32_asm_mips_dsp(uint *buffer, const uint *data, i
extern "C" uint * qt_destStoreARGB32_asm_mips_dsp(uint *buffer, const uint *data, int length);
-#if defined(QT_HAVE_MIPS_DSPR2)
+#if defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
extern "C" uint INTERPOLATE_PIXEL_255_asm_mips_dspr2(uint x, uint a, uint y, uint b);
extern "C" uint BYTE_MUL_asm_mips_dspr2(uint x, uint a);
-#endif // QT_HAVE_MIPS_DSPR2
+#endif // QT_COMPILER_SUPPORTS_MIPS_DSPR2
void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
@@ -85,7 +85,7 @@ void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl,
if (s >= 0xff000000)
dst[x] = s;
else if (s != 0)
-#if !defined(QT_HAVE_MIPS_DSPR2)
+#if !defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
dst[x] = s + BYTE_MUL_asm_mips_dsp(dst[x], qAlpha(~s));
#else
dst[x] = s + BYTE_MUL_asm_mips_dspr2(dst[x], qAlpha(~s));
@@ -98,7 +98,7 @@ void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl,
const_alpha = (const_alpha * 255) >> 8;
for (int y=0; y<h; ++y) {
for (int x=0; x<w; ++x) {
-#if !defined(QT_HAVE_MIPS_DSPR2)
+#if !defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
uint s = BYTE_MUL_asm_mips_dsp(src[x], const_alpha);
dst[x] = s + BYTE_MUL_asm_mips_dsp(dst[x], qAlpha(~s));
#else
@@ -146,7 +146,7 @@ void comp_func_Source_mips_dsp(uint *dest, const uint *src, int length, uint con
} else {
int ialpha = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
-#if !defined(QT_HAVE_MIPS_DSPR2)
+#if !defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
dest[i] = INTERPOLATE_PIXEL_255_asm_mips_dsp(src[i], const_alpha, dest[i], ialpha);
#else
dest[i] = INTERPOLATE_PIXEL_255_asm_mips_dspr2(src[i], const_alpha, dest[i], ialpha);
@@ -171,6 +171,6 @@ void QT_FASTCALL qt_destStoreARGB32_mips_dsp(QRasterBuffer *rasterBuffer, int x,
qt_destStoreARGB32_asm_mips_dsp(data, buffer, length);
}
-#endif // QT_HAVE_MIPS_DSP
+#endif // QT_COMPILER_SUPPORTS_MIPS_DSP
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_mips_dsp_p.h b/src/gui/painting/qdrawhelper_mips_dsp_p.h
index 55affca5d4..1a1e151cb5 100644
--- a/src/gui/painting/qdrawhelper_mips_dsp_p.h
+++ b/src/gui/painting/qdrawhelper_mips_dsp_p.h
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
-#if defined(QT_HAVE_MIPS_DSP)
+#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP)
extern "C" void qt_memfill32_asm_mips_dsp(quint32 *dest, quint32 value, int count);
@@ -71,13 +71,13 @@ uint * QT_FASTCALL qt_destFetchARGB32_mips_dsp(uint *buffer,
void QT_FASTCALL qt_destStoreARGB32_mips_dsp(QRasterBuffer *rasterBuffer, int x, int y,
const uint *buffer, int length);
-#ifdef QT_HAVE_MIPS_DSPR2
+#ifdef QT_COMPILER_SUPPORTS_MIPS_DSPR2
extern "C" void qConvertRgb16To32_asm_mips_dspr2(quint32 *dest, const quint16 *src, int length);
-#endif // QT_HAVE_MIPS_DSPR2
+#endif // QT_COMPILER_SUPPORTS_MIPS_DSPR2
-#endif // QT_HAVE_MIPS_DSP
+#endif // QT_COMPILER_SUPPORTS_MIPS_DSP
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 895b44dc17..d99645bbf6 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -43,7 +43,7 @@
#include <private/qblendfunctions_p.h>
#include <private/qmath_p.h>
-#ifdef QT_HAVE_NEON
+#ifdef QT_COMPILER_SUPPORTS_NEON
#include <private/qdrawhelper_neon_p.h>
#include <private/qpaintengine_raster_p.h>
@@ -997,5 +997,5 @@ const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Opera
QT_END_NAMESPACE
-#endif // QT_HAVE_NEON
+#endif // QT_COMPILER_SUPPORTS_NEON
diff --git a/src/gui/painting/qdrawhelper_neon_p.h b/src/gui/painting/qdrawhelper_neon_p.h
index d62c73196f..54e889d847 100644
--- a/src/gui/painting/qdrawhelper_neon_p.h
+++ b/src/gui/painting/qdrawhelper_neon_p.h
@@ -57,7 +57,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_HAVE_NEON
+#ifdef QT_COMPILER_SUPPORTS_NEON
void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
@@ -139,7 +139,7 @@ void QT_FASTCALL qt_destStoreRGB16_neon(QRasterBuffer *rasterBuffer,
void QT_FASTCALL comp_func_solid_SourceOver_neon(uint *destPixels, int length, uint color, uint const_alpha);
void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uint const_alpha);
-#endif // QT_HAVE_NEON
+#endif // QT_COMPILER_SUPPORTS_NEON
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index e44116570d..ff3c7c0380 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -41,7 +41,7 @@
#include <private/qdrawhelper_x86_p.h>
-#ifdef QT_HAVE_SSE2
+#ifdef QT_COMPILER_SUPPORTS_SSE2
#include <private/qdrawingprimitive_sse2_p.h>
#include <private/qpaintengine_raster_p.h>
@@ -663,4 +663,4 @@ void qt_scale_image_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
QT_END_NAMESPACE
-#endif // QT_HAVE_SSE2
+#endif // QT_COMPILER_SUPPORTS_SSE2
diff --git a/src/gui/painting/qdrawhelper_sse_p.h b/src/gui/painting/qdrawhelper_sse_p.h
index 494ee70fcb..0f7bf7c7f8 100644
--- a/src/gui/painting/qdrawhelper_sse_p.h
+++ b/src/gui/painting/qdrawhelper_sse_p.h
@@ -55,7 +55,7 @@
#include <private/qdrawhelper_mmx_p.h>
-#ifdef QT_HAVE_SSE
+#ifdef QT_COMPILER_SUPPORTS_SSE
#ifdef QT_LINUXBASE
// this is an evil hack - the posix_memalign declaration in LSB
@@ -178,5 +178,5 @@ inline void qt_bitmapblit16_sse_template(QRasterBuffer *rasterBuffer,
QT_END_NAMESPACE
-#endif // QT_HAVE_SSE
+#endif // QT_COMPILER_SUPPORTS_SSE
#endif // QDRAWHELPER_SSE_P_H
diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp
index bc88e397da..57b99c22a0 100644
--- a/src/gui/painting/qdrawhelper_ssse3.cpp
+++ b/src/gui/painting/qdrawhelper_ssse3.cpp
@@ -41,7 +41,7 @@
#include <private/qdrawhelper_x86_p.h>
-#ifdef QT_HAVE_SSSE3
+#ifdef QT_COMPILER_SUPPORTS_SSSE3
#include <private/qdrawingprimitive_sse2_p.h>
@@ -180,4 +180,4 @@ void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
QT_END_NAMESPACE
-#endif // QT_HAVE_SSSE3
+#endif // QT_COMPILER_SUPPORTS_SSSE3
diff --git a/src/gui/painting/qdrawhelper_x86_p.h b/src/gui/painting/qdrawhelper_x86_p.h
index eb434e5fda..d368e6fef0 100644
--- a/src/gui/painting/qdrawhelper_x86_p.h
+++ b/src/gui/painting/qdrawhelper_x86_p.h
@@ -57,7 +57,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_HAVE_SSE2
+#ifdef QT_COMPILER_SUPPORTS_SSE2
void qt_memfill32_sse2(quint32 *dest, quint32 value, int count);
void qt_memfill16_sse2(quint16 *dest, quint16 value, int count);
void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y,
@@ -77,9 +77,9 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
extern CompositionFunction qt_functionForMode_SSE2[];
extern CompositionFunctionSolid qt_functionForModeSolid_SSE2[];
-#endif // QT_HAVE_SSE2
+#endif // QT_COMPILER_SUPPORTS_SSE2
-#ifdef QT_HAVE_AVX
+#ifdef QT_COMPILER_SUPPORTS_AVX
void qt_memfill32_avx(quint32 *dest, quint32 value, int count);
void qt_memfill16_avx(quint16 *dest, quint16 value, int count);
void qt_bitmapblit32_avx(QRasterBuffer *rasterBuffer, int x, int y,
@@ -96,9 +96,9 @@ void qt_blend_rgb32_on_rgb32_avx(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
int w, int h,
int const_alpha);
-#endif // QT_HAVE_AVX
+#endif // QT_COMPILER_SUPPORTS_AVX
-#ifdef QT_HAVE_IWMMXT
+#ifdef QT_COMPILER_SUPPORTS_IWMMXT
void qt_blend_color_argb_iwmmxt(int count, const QSpan *spans, void *userData);
extern CompositionFunction qt_functionForMode_IWMMXT[];
diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 25d025eb39..28d0b9115a 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -44,7 +44,7 @@
#include <private/qsimd_p.h>
-#ifdef QT_HAVE_SSE2
+#ifdef QT_COMPILER_SUPPORTS_SSE2
//
// W A R N I N G
@@ -242,6 +242,6 @@ QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
-#endif // QT_HAVE_SSE2
+#endif // QT_COMPILER_SUPPORTS_SSE2
#endif // QDRAWINGPRIMITIVE_SSE2_P_H