summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_mips_dsp.cpp
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/qdrawhelper_mips_dsp.cpp
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/qdrawhelper_mips_dsp.cpp')
-rw-r--r--src/gui/painting/qdrawhelper_mips_dsp.cpp14
1 files changed, 7 insertions, 7 deletions
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