summaryrefslogtreecommitdiffstats
path: root/src/gui/image
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/image
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/image')
-rw-r--r--src/gui/image/qimage.cpp8
-rw-r--r--src/gui/image/qimage_avx.cpp2
-rw-r--r--src/gui/image/qimage_neon.cpp4
-rw-r--r--src/gui/image/qimage_sse2.cpp4
-rw-r--r--src/gui/image/qimage_ssse3.cpp4
-rw-r--r--src/gui/image/qjpeghandler.cpp8
-rw-r--r--src/gui/image/qpixmap_raster.cpp4
7 files changed, 17 insertions, 17 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 2d70b28923..91af774eef 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -3272,8 +3272,8 @@ void qInitImageConversions()
const uint features = qDetectCPUFeatures();
Q_UNUSED(features);
-#ifdef QT_HAVE_SSE2
-#ifdef QT_HAVE_AVX
+#ifdef QT_COMPILER_SUPPORTS_SSE2
+#ifdef QT_COMPILER_SUPPORTS_AVX
if (features & AVX) {
extern bool convert_ARGB_to_ARGB_PM_inplace_avx(QImageData *data, Qt::ImageConversionFlags);
inplace_converter_map[QImage::Format_ARGB32][QImage::Format_ARGB32_Premultiplied] = convert_ARGB_to_ARGB_PM_inplace_avx;
@@ -3288,7 +3288,7 @@ void qInitImageConversions()
if (features & SSE2) {
extern bool convert_ARGB_to_ARGB_PM_inplace_sse2(QImageData *data, Qt::ImageConversionFlags);
inplace_converter_map[QImage::Format_ARGB32][QImage::Format_ARGB32_Premultiplied] = convert_ARGB_to_ARGB_PM_inplace_sse2;
-#ifdef QT_HAVE_SSSE3
+#ifdef QT_COMPILER_SUPPORTS_SSSE3
if (features & SSSE3) {
extern void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags);
converter_map[QImage::Format_RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_ssse3;
@@ -3299,7 +3299,7 @@ void qInitImageConversions()
}
#endif // SSE2
-#ifdef QT_HAVE_NEON
+#ifdef QT_COMPILER_SUPPORTS_NEON
if (features & NEON) {
extern void convert_RGB888_to_RGB32_neon(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags);
converter_map[QImage::Format_RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_neon;
diff --git a/src/gui/image/qimage_avx.cpp b/src/gui/image/qimage_avx.cpp
index f112a46d96..711508a1bc 100644
--- a/src/gui/image/qimage_avx.cpp
+++ b/src/gui/image/qimage_avx.cpp
@@ -41,7 +41,7 @@
#include <private/qsimd_p.h>
-#ifdef QT_HAVE_AVX
+#ifdef QT_COMPILER_SUPPORTS_AVX
#ifndef __AVX__
#error "AVX not enabled in this file, cannot proceed"
diff --git a/src/gui/image/qimage_neon.cpp b/src/gui/image/qimage_neon.cpp
index b19dfac3ec..73ee1f9533 100644
--- a/src/gui/image/qimage_neon.cpp
+++ b/src/gui/image/qimage_neon.cpp
@@ -43,7 +43,7 @@
#include <private/qimage_p.h>
#include <private/qsimd_p.h>
-#ifdef QT_HAVE_NEON
+#ifdef QT_COMPILER_SUPPORTS_NEON
QT_BEGIN_NAMESPACE
@@ -111,4 +111,4 @@ void convert_RGB888_to_RGB32_neon(QImageData *dest, const QImageData *src, Qt::I
QT_END_NAMESPACE
-#endif // QT_HAVE_NEON
+#endif // QT_COMPILER_SUPPORTS_NEON
diff --git a/src/gui/image/qimage_sse2.cpp b/src/gui/image/qimage_sse2.cpp
index 8a36bfb0d2..5d04d750b0 100644
--- a/src/gui/image/qimage_sse2.cpp
+++ b/src/gui/image/qimage_sse2.cpp
@@ -45,7 +45,7 @@
#include <private/qdrawhelper_p.h>
#include <private/qdrawingprimitive_sse2_p.h>
-#ifdef QT_HAVE_SSE2
+#ifdef QT_COMPILER_SUPPORTS_SSE2
QT_BEGIN_NAMESPACE
@@ -106,4 +106,4 @@ bool convert_ARGB_to_ARGB_PM_inplace_sse2(QImageData *data, Qt::ImageConversionF
QT_END_NAMESPACE
-#endif // QT_HAVE_SSE2
+#endif // QT_COMPILER_SUPPORTS_SSE2
diff --git a/src/gui/image/qimage_ssse3.cpp b/src/gui/image/qimage_ssse3.cpp
index 2ca80ef3bb..0fa2b4bb7b 100644
--- a/src/gui/image/qimage_ssse3.cpp
+++ b/src/gui/image/qimage_ssse3.cpp
@@ -43,7 +43,7 @@
#include <private/qimage_p.h>
#include <private/qsimd_p.h>
-#ifdef QT_HAVE_SSSE3
+#ifdef QT_COMPILER_SUPPORTS_SSSE3
QT_BEGIN_NAMESPACE
@@ -146,4 +146,4 @@ void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::
QT_END_NAMESPACE
-#endif // QT_HAVE_SSSE3
+#endif // QT_COMPILER_SUPPORTS_SSSE3
diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp
index c42977ef10..eff106a486 100644
--- a/src/gui/image/qjpeghandler.cpp
+++ b/src/gui/image/qjpeghandler.cpp
@@ -875,20 +875,20 @@ QJpegHandler::QJpegHandler()
{
const uint features = qDetectCPUFeatures();
Q_UNUSED(features);
-#if defined(QT_HAVE_NEON)
+#if defined(QT_COMPILER_SUPPORTS_NEON)
// from qimage_neon.cpp
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len);
if (features & NEON)
rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_neon;
-#endif // QT_HAVE_NEON
-#if defined(QT_HAVE_SSSE3)
+#endif // QT_COMPILER_SUPPORTS_NEON
+#if defined(QT_COMPILER_SUPPORTS_SSSE3)
// from qimage_ssse3.cpp
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len);
if (features & SSSE3)
rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_ssse3;
-#endif // QT_HAVE_SSSE3
+#endif // QT_COMPILER_SUPPORTS_SSSE3
}
QJpegHandler::~QJpegHandler()
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 27f472d842..260deb4482 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -182,7 +182,7 @@ void QRasterPlatformPixmap::fill(const QColor &color)
if (alpha != 255) {
if (!image.hasAlphaChannel()) {
QImage::Format toFormat;
-#if !(defined(QT_HAVE_NEON) || defined(QT_ALWAYS_HAVE_SSE2))
+#if !(defined(QT_COMPILER_SUPPORTS_NEON) || defined(__SSE2__))
if (image.format() == QImage::Format_RGB16)
toFormat = QImage::Format_ARGB8565_Premultiplied;
else if (image.format() == QImage::Format_RGB666)
@@ -303,7 +303,7 @@ void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageC
QImage::Format opaqueFormat = QNativeImage::systemFormat();
QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
-#if !defined(QT_HAVE_NEON) && !defined(QT_ALWAYS_HAVE_SSE2)
+#if !defined(QT_COMPILER_SUPPORTS_NEON) && !defined(__SSE2__)
switch (opaqueFormat) {
case QImage::Format_RGB16:
alphaFormat = QImage::Format_ARGB8565_Premultiplied;