[Mesa-dev] [PATCH v3 02/63] mesa/util: add MESA_ARCH_{X86, X86_64} macros

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jun 9 13:35:00 UTC 2017


Copied from Gallium util. Will be used by the 64-bit hash table
wrapper for bindless handles.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
 src/util/macros.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/util/macros.h b/src/util/macros.h
index a10f1de814..f576495d31 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -257,4 +257,13 @@ do {                       \
 #define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
 #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
 
+/** Processor architecture. */
+#if defined(__i386__) /* gcc */ || defined(_M_IX86) /* msvc */ || defined(_X86_) || defined(__386__) || defined(i386) || defined(__i386) /* Sun cc */
+#define MESA_ARCH_X86
+#endif
+
+#if defined(__x86_64__) /* gcc */ || defined(_M_X64) /* msvc */ || defined(_M_AMD64) /* msvc */ || defined(__x86_64) /* Sun cc */
+#define MESA_ARCH_X86_64
+#endif
+
 #endif /* UTIL_MACROS_H */
-- 
2.13.1



More information about the mesa-dev mailing list