mcst-linux-kernel/patches-2024.06.26/qt5-5.15.2/0003-e2k_lcc_arch_specific....

381 lines
17 KiB
Diff

diff -Naur old/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h new/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h
--- old/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h 2021-04-20 18:50:46.201185456 +0300
+++ new/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h 2021-04-20 19:50:22.041421034 +0300
@@ -102,7 +102,7 @@
defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \
defined(__riscv) || \
defined(__or1k__) || defined(__arc__) || \
- defined(__EMSCRIPTEN__)
+ defined(__EMSCRIPTEN__) || defined(__e2k__)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(__mc68000__) || \
defined(__pnacl__) || defined(__native_client__)
diff -Naur old/qtbase/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h new/qtbase/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h
--- old/qtbase/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h 2021-04-20 18:50:46.485191168 +0300
+++ new/qtbase/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h 2021-04-20 19:48:54.891657121 +0300
@@ -349,7 +349,7 @@
ppc_cache_flush((from), (to))
#define SLJIT_CACHE_FLUSH_OWN_IMPL 1
-#elif (defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+#elif (defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) && !defined(__LCC__)
#define SLJIT_CACHE_FLUSH(from, to) \
__builtin___clear_cache((char*)(from), (char*)(to))
diff -Naur old/qtbase/src/corelib/global/archdetect.cpp new/qtbase/src/corelib/global/archdetect.cpp
--- old/qtbase/src/corelib/global/archdetect.cpp 2021-04-20 18:50:38.389028360 +0300
+++ new/qtbase/src/corelib/global/archdetect.cpp 2021-04-20 19:48:54.651652264 +0300
@@ -83,6 +83,8 @@
# define ARCH_PROCESSOR "sparcv9"
#elif defined(Q_PROCESSOR_SPARC)
# define ARCH_PROCESSOR "sparc"
+#elif defined(Q_PROCESSOR_E2K)
+# define ARCH_PROCESSOR "e2k"
#else
# define ARCH_PROCESSOR "unknown"
#endif
diff -Naur old/qtbase/src/corelib/global/qcompilerdetection.h new/qtbase/src/corelib/global/qcompilerdetection.h
--- old/qtbase/src/corelib/global/qcompilerdetection.h 2021-04-20 18:50:38.225025062 +0300
+++ new/qtbase/src/corelib/global/qcompilerdetection.h 2021-04-20 20:02:32.796252800 +0300
@@ -69,6 +69,7 @@
GHS - Green Hills Optimizing C++ Compilers
RVCT - ARM Realview Compiler Suite
CLANG - C++ front-end for the LLVM compiler
+ LCC - Elbrus C Compiler
Should be sorted most to least authoritative.
@@ -143,6 +144,9 @@
# if defined(__MINGW32__)
# define Q_CC_MINGW
# endif
+# if defined(__LCC__)
+# define Q_CC_LCC (__LCC__)
+# endif
# if defined(__INTEL_COMPILER)
/* Intel C++ also masquerades as GCC */
# define Q_CC_INTEL (__INTEL_COMPILER)
@@ -231,7 +235,11 @@
# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
# define Q_NORETURN __attribute__((__noreturn__))
# define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
-# define Q_DECL_PURE_FUNCTION __attribute__((pure))
+# if defined(Q_CC_LCC)
+# define Q_DECL_PURE_FUNCTION
+# else
+# define Q_DECL_PURE_FUNCTION __attribute__((pure))
+# endif
# define Q_DECL_CONST_FUNCTION __attribute__((const))
# define Q_DECL_COLD_FUNCTION __attribute__((cold))
# if !defined(QT_MOC_CPP)
@@ -1270,6 +1278,17 @@
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1478 1786)
+#elif defined(Q_CC_LCC)
+# define QT_WARNING_PUSH
+# define QT_WARNING_POP
+# define QT_WARNING_DISABLE_INTEL(number)
+# define QT_WARNING_DISABLE_MSVC(number)
+# define QT_WARNING_DISABLE_LCC(number) QT_DO_PRAGMA(diag_suppress number)
+# define QT_WARNING_DISABLE_CLANG(text)
+# define QT_WARNING_DISABLE_GCC(text)
+# define QT_WARNING_DISABLE_ASIGN_WHERE_COMPARE_MEANT QT_WARNING_DISABLE_LCC(187)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_LCC(1444)
+# define QT_WARNING_DISABLE_VIRT_DECL_HIDDEN QT_WARNING_DISABLE_LCC(997)
#elif defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
# undef QT_DO_PRAGMA /* not needed */
# define QT_WARNING_PUSH __pragma(warning(push))
@@ -1343,13 +1362,17 @@
} while (false)
#if defined(__cplusplus)
-#if __has_cpp_attribute(clang::fallthrough)
+# if defined(__clang__)
+# if __has_cpp_attribute(clang::fallthrough)
# define Q_FALLTHROUGH() [[clang::fallthrough]]
-#elif __has_cpp_attribute(gnu::fallthrough)
+# endif
+# elif defined(__GNUC__) && !defined(__LCC__)
+# if __has_cpp_attribute(gnu::fallthrough)
# define Q_FALLTHROUGH() [[gnu::fallthrough]]
-#elif __has_cpp_attribute(fallthrough)
+# endif
+# elif __has_cpp_attribute(fallthrough)
# define Q_FALLTHROUGH() [[fallthrough]]
-#endif
+# endif
#endif
#ifndef Q_FALLTHROUGH
# if (defined(Q_CC_GNU) && Q_CC_GNU >= 700) && !defined(Q_CC_INTEL)
@@ -1363,7 +1386,7 @@
/*
Sanitize compiler feature availability
*/
-#if !defined(Q_PROCESSOR_X86)
+#if !defined(Q_PROCESSOR_X86) && !defined(Q_PROCESSOR_E2K)
# undef QT_COMPILER_SUPPORTS_SSE2
# undef QT_COMPILER_SUPPORTS_SSE3
# undef QT_COMPILER_SUPPORTS_SSSE3
diff -Naur old/qtbase/src/corelib/global/qlogging.cpp new/qtbase/src/corelib/global/qlogging.cpp
--- old/qtbase/src/corelib/global/qlogging.cpp 2021-04-20 18:50:38.409028762 +0300
+++ new/qtbase/src/corelib/global/qlogging.cpp 2021-04-20 20:04:55.747177619 +0300
@@ -1277,7 +1277,7 @@
// make sure the function has "Message" in the name so the function is removed
#if ((defined(Q_CC_GNU) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) || __has_attribute(optimize)) \
- && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
+ && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG) && !defined(Q_CC_LCC)
// force skipping the frame pointer, to save the backtrace() function some work
__attribute__((optimize("omit-frame-pointer")))
#endif
diff -Naur old/qtbase/src/corelib/global/qprocessordetection.h new/qtbase/src/corelib/global/qprocessordetection.h
--- old/qtbase/src/corelib/global/qprocessordetection.h 2021-04-20 18:50:38.401028601 +0300
+++ new/qtbase/src/corelib/global/qprocessordetection.h 2021-04-20 19:48:54.671652668 +0300
@@ -176,6 +176,17 @@
// # define Q_BYTE_ORDER Q_LITTLE_ENDIAN
/*
+ E2K family, no variants
+
+ E2K is little-endian
+*/
+
+#elif defined(__e2k__)
+# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+# define Q_PROCESSOR_E2K
+# define Q_PROCESSOR_WORDSIZE 8
+
+/*
X86 family, known variants: 32- and 64-bit
X86 is little-endian.
diff -Naur old/qtbase/src/corelib/global/qversiontagging.cpp new/qtbase/src/corelib/global/qversiontagging.cpp
--- old/qtbase/src/corelib/global/qversiontagging.cpp 2021-04-20 18:50:38.281026188 +0300
+++ new/qtbase/src/corelib/global/qversiontagging.cpp 2021-04-20 19:48:54.915657607 +0300
@@ -42,7 +42,7 @@
#define SYM QT_MANGLE_NAMESPACE(qt_version_tag)
//#define SSYM QT_STRINGIFY(SYM)
-#if defined(Q_CC_GNU) && defined(Q_OF_ELF) && !defined(Q_OS_ANDROID)
+#if defined(Q_CC_GNU) && defined(Q_OF_ELF) && !defined(Q_OS_ANDROID) && !defined(Q_CC_LCC)
# define make_versioned_symbol2(sym, m, n, separator) \
Q_CORE_EXPORT extern const char sym ## _ ## m ## _ ## n = 0; \
asm(".symver " QT_STRINGIFY(sym) "_" QT_STRINGIFY(m) "_" QT_STRINGIFY(n) ", " \
diff -Naur old/qtbase/src/corelib/global/qversiontagging.h new/qtbase/src/corelib/global/qversiontagging.h
--- old/qtbase/src/corelib/global/qversiontagging.h 2021-04-20 18:50:38.441029405 +0300
+++ new/qtbase/src/corelib/global/qversiontagging.h 2021-04-20 19:48:54.915657607 +0300
@@ -60,6 +60,12 @@
* There will only be one copy of the section in the output library or application.
*/
+#if defined(Q_CC_LCC)
+# ifndef QT_NO_VERSION_TAGGING
+# define QT_NO_VERSION_TAGGING
+# endif
+#endif
+
#if defined(QT_BUILD_CORE_LIB) || defined(QT_BOOTSTRAPPED) || defined(QT_NO_VERSION_TAGGING) || defined(QT_STATIC)
// don't make tags in QtCore, bootstrapped systems or if the user asked not to
#elif defined(Q_CC_GNU) && !defined(Q_OS_ANDROID)
diff -Naur old/qtbase/src/corelib/tools/qsimd.cpp new/qtbase/src/corelib/tools/qsimd.cpp
--- old/qtbase/src/corelib/tools/qsimd.cpp 2021-04-20 18:50:39.357047826 +0300
+++ new/qtbase/src/corelib/tools/qsimd.cpp 2021-04-20 19:48:54.743654125 +0300
@@ -125,6 +125,18 @@
{
return 0;
}
+#elif defined(Q_PROCESSOR_E2K)
+static inline quint64 detectProcessorFeatures()
+{
+ return (Q_UINT64_C(1) << CpuFeatureSSE2) |
+ (Q_UINT64_C(1) << CpuFeatureSSE3) |
+ (Q_UINT64_C(1) << CpuFeatureSSSE3) |
+ (Q_UINT64_C(1) << CpuFeatureSSE4_1) |
+ (Q_UINT64_C(1) << CpuFeatureSSE4_2) |
+ (Q_UINT64_C(1) << CpuFeatureAVX) |
+ (Q_UINT64_C(1) << CpuFeatureF16C) |
+ (Q_UINT64_C(1) << CpuFeatureAVX2);
+}
#elif defined(Q_PROCESSOR_ARM)
static inline quint64 detectProcessorFeatures()
{
diff -Naur old/qtbase/src/corelib/tools/qsimd_p.h new/qtbase/src/corelib/tools/qsimd_p.h
--- old/qtbase/src/corelib/tools/qsimd_p.h 2021-04-20 18:50:39.361047906 +0300
+++ new/qtbase/src/corelib/tools/qsimd_p.h 2021-04-20 19:48:54.751654287 +0300
@@ -177,7 +177,7 @@
# define QT_FUNCTION_TARGET(x)
#endif
-#ifdef Q_PROCESSOR_X86
+#if defined(Q_PROCESSOR_X86) || defined(Q_PROCESSOR_E2K)
/* -- x86 intrinsic support -- */
# if defined(Q_CC_MSVC) && (defined(_M_X64) || _M_IX86_FP >= 2)
@@ -308,7 +308,7 @@
QT_BEGIN_NAMESPACE
-#ifndef Q_PROCESSOR_X86
+#if !defined(Q_PROCESSOR_X86) && !defined(Q_PROCESSOR_E2K)
enum CPUFeatures {
#if defined(Q_PROCESSOR_ARM)
CpuFeatureNEON = 2,
diff -Naur old/qtbase/src/opengl/qgl_p.h new/qtbase/src/opengl/qgl_p.h
--- old/qtbase/src/opengl/qgl_p.h 2021-04-20 18:50:35.068961596 +0300
+++ new/qtbase/src/opengl/qgl_p.h 2021-04-20 19:48:54.959658498 +0300
@@ -68,6 +68,10 @@
QT_BEGIN_NAMESPACE
+#ifdef Q_CC_LCC
+QT_WARNING_DISABLE_VIRT_DECL_HIDDEN
+#endif
+
class QGLContext;
class QGLOverlayWidget;
class QPixmap;
diff -Naur old/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp new/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
--- old/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp 2021-04-20 18:50:09.024437854 +0300
+++ new/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp 2021-04-20 19:48:55.043660198 +0300
@@ -626,7 +626,7 @@
#endif
}
-template <typename Int, bool enabled = sizeof(Int) <= sizeof(void*)> struct MulOverflowDispatch;
+template <typename Int, bool enabled = sizeof(Int) < sizeof(void*)> struct MulOverflowDispatch;
template <typename Int> struct MulOverflowDispatch<Int, true>
{
void operator()() { mulOverflow_template<Int>(); }
diff -Naur old/qtbase/tests/auto/other/compiler/tst_compiler.cpp new/qtbase/tests/auto/other/compiler/tst_compiler.cpp
--- old/qtbase/tests/auto/other/compiler/tst_compiler.cpp 2021-04-20 18:50:16.444587070 +0300
+++ new/qtbase/tests/auto/other/compiler/tst_compiler.cpp 2021-04-20 19:48:55.103661413 +0300
@@ -704,7 +704,7 @@
#else
// Attributes in function parameters and using clauses cause MSVC 2015 to crash
// https://connect.microsoft.com/VisualStudio/feedback/details/2011594
-# if (!defined(Q_CC_MSVC) || _MSC_FULL_VER >= 190023811) && !defined(Q_CC_INTEL)
+# if (!defined(Q_CC_MSVC) || _MSC_FULL_VER >= 190023811) && !defined(Q_CC_INTEL) && !defined(Q_CC_LCC)
void f([[ ]] int);
[[ ]] using namespace QtPrivate;
[[ ]] try {
diff -Naur old/qtbase/tests/auto/tools/moc/tst_moc.cpp new/qtbase/tests/auto/tools/moc/tst_moc.cpp
--- old/qtbase/tests/auto/tools/moc/tst_moc.cpp 2021-04-20 18:50:07.684410907 +0300
+++ new/qtbase/tests/auto/tools/moc/tst_moc.cpp 2021-04-20 19:48:55.171662789 +0300
@@ -44,7 +44,7 @@
#include "pure-virtual-signals.h"
#include "qinvokable.h"
// msvc and friends crap out on it
-#if !defined(Q_CC_GNU) || defined(Q_OS_WIN)
+#if !defined(Q_CC_GNU) || defined(Q_OS_WIN) || defined(Q_CC_LCC)
#define SKIP_NEWLINE_TEST
#endif
#if !defined(SKIP_NEWLINE_TEST)
diff -Naur old/qtquickcontrols/src/controls/Private/qquicktreemodeladaptor.cpp new/qtquickcontrols/src/controls/Private/qquicktreemodeladaptor.cpp
--- old/qtquickcontrols/src/controls/Private/qquicktreemodeladaptor.cpp 2021-04-20 18:38:57.014921567 +0300
+++ new/qtquickcontrols/src/controls/Private/qquicktreemodeladaptor.cpp 2021-04-20 19:48:54.835655988 +0300
@@ -275,6 +275,10 @@
return m_items.at(row).index;
}
+#ifdef Q_CC_LCC
+QT_WARNING_DISABLE_ASIGN_WHERE_COMPARE_MEANT
+#endif
+
QItemSelection QQuickTreeModelAdaptor1::selectionForRowRange(const QModelIndex &fromIndex, const QModelIndex &toIndex) const
{
int from = itemIndex(fromIndex);
diff -Naur old/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h new/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
--- old/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2021-04-20 18:40:52.985254472 +0300
+++ new/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2021-04-20 19:48:54.795655178 +0300
@@ -397,6 +397,12 @@
#endif
#endif /* __mips__ */
+/* CPU(E2K) - e2k Elbrus ABI LITTLE endian */
+#if defined(__e2k__)
+#define WTF_COMPILER_LCC 1
+#define WTF_CPU_E2K 1
+#endif
+
/* CPU(RISCV64) - RISC-V 64-bit */
#if defined(__riscv) && __riscv_xlen == 64
#define WTF_CPU_RISCV64 1
@@ -958,7 +964,7 @@
#endif
#if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
-#if (CPU(X86_64) && !CPU(X32) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(MIPS64) || CPU(AARCH64) || CPU(RISCV64)
+#if (CPU(X86_64) && !CPU(X32) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(MIPS64) || CPU(AARCH64) || CPU(RISCV64) || CPU(E2K)
#define WTF_USE_JSVALUE64 1
#elif CPU(ARM) || CPU(PPC64) || CPU(RISCV32)
#define WTF_USE_JSVALUE32 1
@@ -1043,7 +1049,7 @@
#define JSC_HOST_CALL
#endif
-#if COMPILER(GCC) && !ENABLE(JIT)
+#if COMPILER(GCC) && !ENABLE(JIT) && !COMPILER(LCC)
#define HAVE_COMPUTED_GOTO 1
#endif
diff -Naur old/qtbase/src/gui/painting/qdrawhelper.cpp new/qtbase/src/gui/painting/qdrawhelper.cpp
--- old/qtbase/src/gui/painting/qdrawhelper.cpp 2021-04-20 18:50:46.577193018 +0300
+++ new/qtbase/src/gui/painting/qdrawhelper.cpp 2021-04-30 16:59:34.558924858 +0300
@@ -6642,7 +6642,7 @@
}
#endif
-#if defined(QT_COMPILER_SUPPORTS_SSSE3) && defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
+#if defined(QT_COMPILER_SUPPORTS_SSSE3) && defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG) && !defined(Q_CC_LCC)
__attribute__((optimize("no-tree-vectorize")))
#endif
void qt_memfill24(quint24 *dest, quint24 color, qsizetype count)
--- old/qtbase/tests/auto/corelib/global/qlogging/tst_qlogging.cpp 2021-04-20 18:50:09.056438498 +0300
+++ new/qtbase/tests/auto/corelib/global/qlogging/tst_qlogging.cpp 2021-05-19 15:34:03.560562714 +0300
@@ -798,10 +798,13 @@
<< "[MyClass::myFunction|MyClass::mySlot1|?helper?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34");
#endif
+#if !(defined(Q_CC_LCC) && defined(QT_NO_DEBUG))
+ // calls from closure when opt-mode >= O1 on LCC
QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>()
<< "[MyClass::myFunction\nMyClass::mySlot1] from_a_function 34"
<< "[T::T\n");
#endif
+#endif
}
--- old/qtbase/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp 2021-04-20 18:50:14.688551757 +0300
+++ new/qtbase/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp 2021-05-19 16:52:15.337541730 +0300
@@ -1184,6 +1184,9 @@
QDateTime birthTime, writeTime, metadataChangeTime, readTime;
// --- Create file and write to it
+#if (defined(Q_CC_LCC) && defined(QT_NO_DEBUG))
+ QSKIP("Calls optimized out.");
+#else
beforeBirth = QDateTime::currentDateTime().addMSecs(-fsClockSkew);
{
QFile file(fileName);
@@ -1204,6 +1207,7 @@
QVERIFY2(writeTime > beforeWrite, datePairString(writeTime, beforeWrite));
QCOMPARE(fileInfo.birthTime(), birthTime); // mustn't have changed
}
+#endif
// --- Change the file's metadata
QTest::qSleep(sleepTime);
--- old/qtbase/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro 2021-04-20 18:50:08.812433591 +0300
+++ new/qtbase/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro 2021-05-20 14:23:32.987089017 +0300
@@ -15,3 +15,8 @@
include(externaltests.pri)
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+# Increase timeout for lcc
+checkenv.name = QTEST_FUNCTION_TIMEOUT
+checkenv.value = 1000000
+QT_TOOL_ENV += checkenv