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

Nicolai Hähnle nhaehnle at gmail.com
Fri Oct 21 08:16:12 UTC 2016


On 21.10.2016 00:20, Rob Herring wrote:
> 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.

While we haven't been particularly good at syncing things 
back-and-forth, this code is shared with closed source driver builds, 
including on Windows.

Please re-structure the patch so that it really only changes the 
behavior with Clang. (For example, that MSVC doesn't define __i386__ as 
far as I'm aware.)

Thanks,
Nicolai

>
> 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
>
>


More information about the mesa-dev mailing list