add support for LoongArch
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 25 Jul 2024 12:43:37 +0000 (15:43 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 25 Jul 2024 12:43:37 +0000 (15:43 +0300)
Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=bdc16f086f1664b5
Last-Update: 2024-03-09

Gbp-Pq: Name loongarch.diff

src/corelib/global/archdetect.cpp
src/corelib/global/qglobal.cpp
src/corelib/global/qprocessordetection.h

index 1d00b7f5a52c7fbc2c4f710c79602a03febeaeea..281e84df63c244f1a1751e0443b190ea593262ae 100644 (file)
 #  define ARCH_PROCESSOR "x86_64"
 #elif defined(Q_PROCESSOR_IA64)
 #  define ARCH_PROCESSOR "ia64"
+#elif defined(Q_PROCESSOR_LOONGARCH_32)
+#  define ARCH_PROCESSOR "loongarch32"
+#elif defined(Q_PROCESSOR_LOONGARCH_64)
+#  define ARCH_PROCESSOR "loongarch64"
 #elif defined(Q_PROCESSOR_MIPS_64)
 #  define ARCH_PROCESSOR "mips64"
 #elif defined(Q_PROCESSOR_MIPS)
index 5ad82c259de87cbf569a7094a2dd4c233dc25373..5cbf2054a6752fa283194ee23fb5129b2556f56e 100644 (file)
@@ -1815,6 +1815,37 @@ bool qSharedBuild() noexcept
     \sa QSysInfo::buildCpuArchitecture()
 */
 
+/*!
+    \macro Q_PROCESSOR_LOONGARCH
+    \relates <QtGlobal>
+
+    Defined if the application is compiled for LoongArch processors.
+
+    \sa QSysInfo::buildCpuArchitecture()
+*/
+
+/*!
+    \macro Q_PROCESSOR_LOONGARCH_32
+    \relates <QtGlobal>
+
+    Defined if the application is compiled for 32-bit LoongArch processors.
+    The \l Q_PROCESSOR_LOONGARCH macro is also defined when
+    Q_PROCESSOR_LOONGARCH_32 is defined.
+
+    \sa QSysInfo::buildCpuArchitecture()
+*/
+
+/*!
+    \macro Q_PROCESSOR_LOONGARCH_64
+    \relates <QtGlobal>
+
+    Defined if the application is compiled for 64-bit LoongArch processors.
+    The \l Q_PROCESSOR_LOONGARCH macro is also defined when
+    Q_PROCESSOR_LOONGARCH_64 is defined.
+
+    \sa QSysInfo::buildCpuArchitecture()
+*/
+
 /*!
     \macro Q_PROCESSOR_MIPS
     \relates <QtGlobal>
index 8d65720850336ecf562047ad82e871a9cd5d4be4..7b32b919f2a40b5e1e9fcafa5d670c3fa854c2f9 100644 (file)
 #  define Q_PROCESSOR_WORDSIZE   8
 // Q_BYTE_ORDER not defined, use endianness auto-detection
 
+/*
+    LoongArch family, known variants: 32- and 64-bit
+
+    LoongArch is little-endian.
+*/
+#elif defined(__loongarch__)
+#  define Q_PROCESSOR_LOONGARCH
+#  if __loongarch_grlen == 64
+#    define Q_PROCESSOR_LOONGARCH_64
+#  else
+#    define Q_PROCESSOR_LOONGARCH_32
+#  endif
+#  define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+
 /*
     MIPS family, known revisions: I, II, III, IV, 32, 64