summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-12-09 15:28:05 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2015-12-12 07:19:04 +0000
commitd729c3459f4472874c8fb53eb2d6039fd503a7d6 (patch)
tree3356619229e2c79ff15ffd4a7ac4d89303450d76
parenta094af001795c9651b299d700a992150d1aba33a (diff)
iOS: Enable non-pixman NEON drawhelpers for both 32 and 64-bit
The pixman drawhelpers are implemented using GAS syntax, which the Clang assembler doesn't handle, nor do they work on 64-bit ARM, so we disable them selectively. They are only used for 16-bit surfaces anyways, so it not a big deal on iOS. (cherry picked from commit 49568df95450733dc4c273945e5ced218132c123) Change-Id: I70848981c794739d40a6a2d9a537307bc80d61a6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
-rw-r--r--src/3rdparty/pixman/pixman-arm-neon-asm.S4
-rw-r--r--src/gui/painting/painting.pri10
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp10
-rw-r--r--src/gui/painting/qdrawhelper_neon_asm.S4
4 files changed, 17 insertions, 11 deletions
diff --git a/src/3rdparty/pixman/pixman-arm-neon-asm.S b/src/3rdparty/pixman/pixman-arm-neon-asm.S
index eb8cc4c966..bd9371eadb 100644
--- a/src/3rdparty/pixman/pixman-arm-neon-asm.S
+++ b/src/3rdparty/pixman/pixman-arm-neon-asm.S
@@ -34,6 +34,8 @@
* - pixman_composite_over_n_8_0565_asm_neon
*/
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
+
/* Prevent the stack from becoming executable for no reason... */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
@@ -1707,3 +1709,5 @@ generate_composite_function \
0, /* dst_r_basereg */ \
0, /* src_basereg */ \
0 /* mask_basereg */
+
+#endif \ No newline at end of file
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 5b25c2fd95..1e516e4581 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -101,12 +101,10 @@ SSE4_1_SOURCES += painting/qdrawhelper_sse4.cpp \
painting/qimagescale_sse4.cpp
AVX2_SOURCES += painting/qdrawhelper_avx2.cpp
-!ios {
- CONFIG += no_clang_integrated_as
- NEON_SOURCES += painting/qdrawhelper_neon.cpp
- NEON_HEADERS += painting/qdrawhelper_neon_p.h
- !contains(QT_ARCH, "arm64"): NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
-}
+NEON_SOURCES += painting/qdrawhelper_neon.cpp
+NEON_HEADERS += painting/qdrawhelper_neon_p.h
+NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
+!ios:!contains(QT_ARCH, "arm64"): DEFINES += ENABLE_PIXMAN_DRAWHELPERS
MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 413fddcfdc..e3f5d5bac7 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -135,7 +135,7 @@ static inline uint16x8_t qvsource_over_u16(uint16x8_t src16, uint16x8_t dst16, u
return vaddq_u16(src16, qvbyte_mul_u16(dst16, alpha16, half));
}
-#if !defined(Q_PROCESSOR_ARM_64)
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
extern "C" void
pixman_composite_over_8888_0565_asm_neon (int32_t w,
int32_t h,
@@ -352,7 +352,7 @@ void qt_blend_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
void qt_blend_argb32_on_argb32_scanline_neon(uint *dest, const uint *src, int length, uint const_alpha)
{
if (const_alpha == 255) {
-#if !defined(Q_PROCESSOR_ARM_64)
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
pixman_composite_scanline_over_asm_neon(length, dest, src);
#else
qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, 256);
@@ -372,7 +372,7 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
uint16x8_t half = vdupq_n_u16(0x80);
uint16x8_t full = vdupq_n_u16(0xff);
if (const_alpha == 256) {
-#if !defined(Q_PROCESSOR_ARM_64)
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
pixman_composite_over_8888_8888_asm_neon(w, h, (uint32_t *)destPixels, dbpl / 4, (uint32_t *)srcPixels, sbpl / 4);
#else
for (int y=0; y<h; ++y) {
@@ -530,7 +530,7 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
}
}
-#if !defined(Q_PROCESSOR_ARM_64)
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer,
int x, int y, const QRgba64 &color,
const uchar *bitmap,
@@ -868,7 +868,7 @@ void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uin
}
}
-#if !defined(Q_PROCESSOR_ARM_64)
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
static const int tileSize = 32;
extern "C" void qt_rotate90_16_neon(quint16 *dst, const quint16 *src, int sstride, int dstride, int count);
diff --git a/src/gui/painting/qdrawhelper_neon_asm.S b/src/gui/painting/qdrawhelper_neon_asm.S
index 42a2084bbd..927a03f8ec 100644
--- a/src/gui/painting/qdrawhelper_neon_asm.S
+++ b/src/gui/painting/qdrawhelper_neon_asm.S
@@ -31,6 +31,8 @@
**
****************************************************************************/
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
+
/* Prevent the stack from becoming executable for no reason... */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
@@ -287,3 +289,5 @@ qt_rotate90_16_neon:
pop { r4-r11, pc }
.endfunc
+
+#endif \ No newline at end of file