util: detect LoongArch architecture

Only 64-bit is considered now because 32-bit LoongArch Linux support
doesn't exist in upstream yet.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30197>
This commit is contained in:
Icenowy Zheng
2024-07-06 00:06:45 +08:00
committed by Marge Bot
parent fd83fc4bfb
commit 08425d9aaf

View File

@@ -112,6 +112,14 @@
#endif
#endif
#if defined(__loongarch__)
#ifdef __loongarch_lp64
#define DETECT_ARCH_LOONGARCH64 1
#else
#error "detect_arch: unknown target loongarch base ABI type"
#endif
#endif
#ifndef DETECT_ARCH_X86
#define DETECT_ARCH_X86 0
#endif
@@ -168,4 +176,8 @@
#define DETECT_ARCH_RISCV64 0
#endif
#ifndef DETECT_ARCH_LOONGARCH64
#define DETECT_ARCH_LOONGARCH64 0
#endif
#endif /* UTIL_DETECT_ARCH_H_ */