util: detect RISC-V architecture

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26018>
This commit is contained in:
Yukari Chiba
2024-06-25 13:44:40 +08:00
committed by Dave Airlie
parent 60488d6213
commit 465510a211
+23
View File
@@ -101,6 +101,17 @@
#define DETECT_ARCH_HPPA 1
#endif
#if defined(__riscv)
#define DETECT_ARCH_RISCV 1
#if __riscv_xlen == 64
#define DETECT_ARCH_RISCV64 1
#elif __riscv_xlen == 32
#define DETECT_ARCH_RISCV32 1
#else
#error "detect_arch: unknown target riscv xlen"
#endif
#endif
#ifndef DETECT_ARCH_X86
#define DETECT_ARCH_X86 0
#endif
@@ -145,4 +156,16 @@
#define DETECT_ARCH_HPPA 0
#endif
#ifndef DETECT_ARCH_RISCV
#define DETECT_ARCH_RISCV 0
#endif
#ifndef DETECT_ARCH_RISCV32
#define DETECT_ARCH_RISCV32 0
#endif
#ifndef DETECT_ARCH_RISCV64
#define DETECT_ARCH_RISCV64 0
#endif
#endif /* UTIL_DETECT_ARCH_H_ */