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>
This commit is contained in:
parent
5cbdba588a
commit
398c8513b1
@ -177,11 +177,14 @@ mac {
|
||||
}
|
||||
|
||||
#SIMD defines:
|
||||
sse2:DEFINES += QT_HAVE_SSE2
|
||||
sse3:DEFINES += QT_HAVE_SSE3
|
||||
ssse3:DEFINES += QT_HAVE_SSSE3
|
||||
sse4_1:DEFINES += QT_HAVE_SSE4_1
|
||||
sse4_2:DEFINES += QT_HAVE_SSE4_2
|
||||
avx:DEFINES += QT_HAVE_AVX
|
||||
avx2:DEFINES += QT_HAVE_AVX2
|
||||
iwmmxt:DEFINES += QT_HAVE_IWMMXT
|
||||
sse2:DEFINES += QT_COMPILER_SUPPORTS_SSE2
|
||||
sse3:DEFINES += QT_COMPILER_SUPPORTS_SSE3
|
||||
ssse3:DEFINES += QT_COMPILER_SUPPORTS_SSSE3
|
||||
sse4_1:DEFINES += QT_COMPILER_SUPPORTS_SSE4_1
|
||||
sse4_2:DEFINES += QT_COMPILER_SUPPORTS_SSE4_2
|
||||
avx:DEFINES += QT_COMPILER_SUPPORTS_AVX
|
||||
avx2:DEFINES += QT_COMPILER_SUPPORTS_AVX2
|
||||
iwmmxt:DEFINES += QT_COMPILER_SUPPORTS_IWMMXT
|
||||
neon:DEFINES += QT_COMPILER_SUPPORTS_NEON
|
||||
mips_dsp:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSP
|
||||
mips_dspr2:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSPR2
|
||||
|
@ -102,7 +102,7 @@ static inline uint detectProcessorFeatures()
|
||||
return features;
|
||||
}
|
||||
|
||||
#elif defined(Q_PROCESSOR_ARM) || defined(QT_HAVE_IWMMXT) || defined(QT_HAVE_NEON)
|
||||
#elif defined(Q_PROCESSOR_ARM) || defined(QT_COMPILER_SUPPORTS_IWMMXT) || defined(QT_COMPILER_SUPPORTS_NEON)
|
||||
static inline uint detectProcessorFeatures()
|
||||
{
|
||||
uint features = 0;
|
||||
@ -136,7 +136,7 @@ static inline uint detectProcessorFeatures()
|
||||
// fall back if /proc/self/auxv wasn't found
|
||||
#endif
|
||||
|
||||
#if defined(QT_HAVE_IWMMXT)
|
||||
#if defined(QT_COMPILER_SUPPORTS_IWMMXT)
|
||||
// runtime detection only available when running as a previlegied process
|
||||
features = IWMMXT;
|
||||
#elif defined(QT_ALWAYS_HAVE_NEON)
|
||||
|
@ -46,12 +46,37 @@
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
/*
|
||||
* qt_module_config.prf defines the QT_COMPILER_SUPPORTS_XXX macros.
|
||||
* They mean the compiler supports the necessary flags and the headers
|
||||
* for the x86 and ARM intrinsics:
|
||||
* - GCC: the -mXXX or march=YYY flag is necessary before #include
|
||||
* - Intel CC: #include can happen unconditionally
|
||||
* - MSVC: #include can happen unconditionally
|
||||
* - RVCT: ???
|
||||
*
|
||||
* We will try to include all headers possible under this configuration.
|
||||
*
|
||||
* Supported XXX are:
|
||||
* Flag | Arch | GCC | Intel CC | MSVC |
|
||||
* NEON | ARM | I & C | None | ? |
|
||||
* IWMMXT | ARM | I & C | None | I & C |
|
||||
* SSE2 | x86 | I & C | I & C | I & C |
|
||||
* SSE3 | x86 | I & C | I & C | I only |
|
||||
* SSSE3 | x86 | I & C | I & C | I only |
|
||||
* SSE4_1 | x86 | I & C | I & C | I only |
|
||||
* SSE4_2 | x86 | I & C | I & C | I only |
|
||||
* AVX | x86 | I & C | I & C | I & C |
|
||||
* AVX2 | x86 | I & C | I & C | I only |
|
||||
* I = intrinsics; C = code generation
|
||||
*/
|
||||
|
||||
#ifdef __MINGW64_VERSION_MAJOR
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
// SSE intrinsics
|
||||
#if defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC))
|
||||
#if defined(__SSE2__) || (defined(QT_COMPILER_SUPPORTS_SSE2) && defined(Q_CC_MSVC))
|
||||
#if defined(QT_LINUXBASE)
|
||||
/// this is an evil hack - the posix_memalign declaration in LSB
|
||||
/// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431
|
||||
@ -61,38 +86,34 @@ QT_BEGIN_HEADER
|
||||
#else
|
||||
# include <emmintrin.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// SSE3 intrinsics
|
||||
#if defined(QT_HAVE_SSE3) && (defined(__SSE3__) || defined(Q_CC_MSVC))
|
||||
#if defined(__SSE3__) || (defined(QT_COMPILER_SUPPORTS_SSE3) && defined(Q_CC_MSVC))
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
|
||||
// SSSE3 intrinsics
|
||||
#if defined(QT_HAVE_SSSE3) && (defined(__SSSE3__) || defined(Q_CC_MSVC))
|
||||
#if defined(__SSSE3__) || (defined(QT_COMPILER_SUPPORTS_SSSE3) && defined(Q_CC_MSVC))
|
||||
#include <tmmintrin.h>
|
||||
#endif
|
||||
|
||||
// SSE4.1 intrinsics
|
||||
#if defined(QT_HAVE_SSE4_1) && (defined(__SSE4_1__) || defined(Q_CC_MSVC))
|
||||
#if defined(__SSE4_1__) || (defined(QT_COMPILER_SUPPORTS_SSE4_1) && defined(Q_CC_MSVC))
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
// SSE4.2 intrinsics
|
||||
#if defined(QT_HAVE_SSE4_2) && (defined(__SSE4_2__) || defined(Q_CC_MSVC))
|
||||
#if defined(__SSE4_2__) || (defined(QT_COMPILER_SUPPORTS_SSE4_2) && defined(Q_CC_MSVC))
|
||||
#include <nmmintrin.h>
|
||||
#endif
|
||||
|
||||
// AVX intrinsics
|
||||
#if defined(QT_HAVE_AVX) && (defined(__AVX__) || defined(Q_CC_MSVC))
|
||||
#if defined(__AVX__) || (defined(QT_COMPILER_SUPPORTS_AVX) && defined(Q_CC_MSVC))
|
||||
// immintrin.h is the ultimate header, we don't need anything else after this
|
||||
#include <immintrin.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(QT_BOOTSTRAPPED) && (!defined(Q_CC_MSVC) || (defined(_M_X64) || _M_IX86_FP == 2))
|
||||
#define QT_ALWAYS_HAVE_SSE2
|
||||
#endif
|
||||
#endif // defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC))
|
||||
|
||||
// NEON intrinsics
|
||||
#if defined __ARM_NEON__
|
||||
#define QT_ALWAYS_HAVE_NEON
|
||||
@ -101,14 +122,14 @@ QT_BEGIN_HEADER
|
||||
|
||||
|
||||
// IWMMXT intrinsics
|
||||
#if defined(QT_HAVE_IWMMXT)
|
||||
#if defined(QT_COMPILER_SUPPORTS_IWMMXT)
|
||||
#include <mmintrin.h>
|
||||
#if defined(Q_OS_WINCE)
|
||||
# include "qplatformdefs.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(QT_HAVE_IWMMXT)
|
||||
#if defined(QT_COMPILER_SUPPORTS_IWMMXT)
|
||||
#if !defined(__IWMMXT__) && !defined(Q_OS_WINCE)
|
||||
# include <xmmintrin.h>
|
||||
#elif defined(Q_OS_WINCE_STD) && defined(_X86_)
|
||||
|
@ -39,7 +39,6 @@ include(animation/animation.pri)
|
||||
QMAKE_LIBS += $$QMAKE_LIBS_GUI
|
||||
|
||||
neon:*-g++* {
|
||||
DEFINES += QT_HAVE_NEON
|
||||
HEADERS += $$NEON_HEADERS
|
||||
|
||||
DRAWHELPER_NEON_ASM_FILES = $$NEON_ASM
|
||||
@ -115,12 +114,10 @@ win32:!contains(QT_CONFIG, directwrite) {
|
||||
}
|
||||
|
||||
mips_dsp:*-g++* {
|
||||
DEFINES += QT_HAVE_MIPS_DSP
|
||||
HEADERS += $$MIPS_DSP_HEADERS
|
||||
|
||||
DRAWHELPER_MIPS_DSP_ASM_FILES = $$MIPS_DSP_ASM
|
||||
mips_dspr2 {
|
||||
DEFINES += QT_HAVE_MIPS_DSPR2
|
||||
DRAWHELPER_MIPS_DSP_ASM_FILES += $$MIPS_DSPR2_ASM
|
||||
}
|
||||
mips_dsp_compiler.commands = $$QMAKE_CXX -c
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
#include <private/qsimd_p.h>
|
||||
|
||||
#ifdef QT_HAVE_AVX
|
||||
#ifdef QT_COMPILER_SUPPORTS_AVX
|
||||
#define QDRAWHELPER_AVX
|
||||
|
||||
#ifndef __AVX__
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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[];
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user