Statically assert that the __mips_dsp code is only active on 32-bit

I was told this is 32-bit-only code in Qt 5, where it didn't really
matter, because only QStringView could handle > INT_MAX character
strings. Put up a big stop sign now in Qt 6 to enforce that this
information is correct, incl. notes for when it turns out it isn't.

Task-number: QTBUG-59150
Task-number: QTBUG-103531
Change-Id: I4620a43e2e67776cc67531fa993a7bb8e01cffed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 753079b7074b06d237a0ae7a58281c28df134fc0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2022-07-20 22:33:23 +02:00 committed by Qt Cherry-pick Bot
parent 4c08f71a11
commit 0102ab6cd3

View File

@ -816,6 +816,8 @@ Q_CORE_EXPORT void qt_from_latin1(char16_t *dst, const char *str, size_t size) n
# endif
#endif
#if defined(__mips_dsp)
static_assert(sizeof(qsizetype) == sizeof(int),
"oops, the assembler implementation needs to be called in a loop");
if (size > 20)
qt_fromlatin1_mips_asm_unroll8(dst, str, size);
else
@ -971,6 +973,8 @@ static void qt_to_latin1_internal(uchar *dst, const char16_t *src, qsizetype len
}
#endif
#if defined(__mips_dsp)
static_assert(sizeof(qsizetype) == sizeof(int),
"oops, the assembler implementation needs to be called in a loop");
qt_toLatin1_mips_dsp_asm(dst, src, length);
#else
while (length--) {