summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-07-20 22:33:23 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-05 17:29:26 +0000
commit2395c99fd97e1b36abaed8309e784f4655e616aa (patch)
tree9e4708f94146a44b690f28a600e000b83cde9843
parent2fb75052fbc57955fdb41761e9f37e828c94fc94 (diff)
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>
-rw-r--r--src/corelib/text/qstring.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 16baad102f..9005f3267a 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -828,6 +828,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
@@ -983,6 +985,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--) {