[Mesa-dev] [PATCH] amd/addrlib: limit fastcall/regparm to i386

Rob Herring robh at kernel.org
Thu Oct 20 22:20:13 UTC 2016


The use of regparm causes an error on arm/arm64 builds with clang.
fastcall is allowed, but still throws a warning. As both options only
have effect on 32-bit x86 builds, limit them to that case.

Signed-off-by: Rob Herring <robh at kernel.org>
---
 src/amd/addrlib/addrtypes.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/amd/addrlib/addrtypes.h b/src/amd/addrlib/addrtypes.h
index 4c68ac544b88..183b5a751c3a 100644
--- a/src/amd/addrlib/addrtypes.h
+++ b/src/amd/addrlib/addrtypes.h
@@ -87,10 +87,14 @@ typedef int            INT;
 #endif
 
 #ifndef ADDR_FASTCALL
-    #if defined(__GNUC__)
-        #define ADDR_FASTCALL __attribute__((regparm(0)))
+    #if defined(__i386__)
+	#if defined(__GNUC__)
+            #define ADDR_FASTCALL __attribute__((regparm(0)))
+        #else
+            #define ADDR_FASTCALL __fastcall
+        #endif
     #else
-        #define ADDR_FASTCALL __fastcall
+	#define ADDR_FASTCALL
     #endif
 #endif
 
-- 
2.10.1



More information about the mesa-dev mailing list