Skip to content

Instantly share code, notes, and snippets.

@torarnv torarnv/gist:6582663
Last active Dec 23, 2015

Embed
What would you like to do?
/Users/torarne/dev/qt/5.x/qtbase/src/gui/image/qimage_neon.cpp:78:17: error: vector register expected
"vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t"
^
<inline asm>:1:15: note: instantiated into assembly here
vld3.8 { d0, d1, d2 }, [x1] !
^
/Users/torarne/dev/qt/5.x/qtbase/src/gui/image/qimage_neon.cpp:78:57: error: unrecognized instruction mnemonic
"vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t"
^
<inline asm>:2:2: note: instantiated into assembly here
vswp d0, d2
^
/Users/torarne/dev/qt/5.x/qtbase/src/gui/image/qimage_neon.cpp:79:31: error: vector register expected
"vswp d0, d2\n\t"
^
<inline asm>:3:15: note: instantiated into assembly here
vst4.8 { d0, d1, d2, d3 }, [x8,:64] !
^
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len)
{
if (!len)
return;
const quint32 *const end = dst + len;
// align dst on 64 bits
const int offsetToAlignOn8Bytes = (reinterpret_cast<quintptr>(dst) >> 2) & 0x1;
for (int i = 0; i < offsetToAlignOn8Bytes; ++i) {
*dst++ = qRgb(src[0], src[1], src[2]);
src += 3;
}
if ((len - offsetToAlignOn8Bytes) >= 8) {
const quint32 *const simdEnd = end - 7;
register uint8x8_t fullVector asm ("d3") = vdup_n_u8(0xff);
do {
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
asm volatile (
"vld3.8 { d4, d5, d6 }, [%[SRC]] !\n\t"
"vst4.8 { d3, d4, d5, d6 }, [%[DST],:64] !\n\t"
: [DST]"+r" (dst), [SRC]"+r" (src)
: "w"(fullVector)
: "memory", "d4", "d5", "d6"
);
#else
asm volatile (
"vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t"
"vswp d0, d2\n\t"
"vst4.8 { d0, d1, d2, d3 }, [%[DST],:64] !\n\t"
: [DST]"+r" (dst), [SRC]"+r" (src)
: "w"(fullVector)
: "memory", "d0", "d1", "d2"
);
#endif
} while (dst < simdEnd);
}
while (dst != end) {
*dst++ = qRgb(src[0], src[1], src[2]);
src += 3;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.