qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/7] softfloat: Convert `*_default_nan' varia


From: Leon Alrae
Subject: Re: [Qemu-devel] [PATCH v2 3/7] softfloat: Convert `*_default_nan' variables into inline functions
Date: Fri, 30 Jan 2015 14:09:35 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 12/12/2014 19:34, Maciej W. Rozycki wrote:
> Mechanically replace `*_default_nan' variables with inline functions and 
> convert references accordingly.  Use `__inline__' rather than `inline' 
> so that the latter does not cause the definitions to become static as a 
> result of macro expansion, the functions are best inlined when referred 
> to from softfloat.c, but external copies must be also produced for 
> external callers.
> 
> Signed-off-by: Thomas Schwinge <address@hidden>
> Signed-off-by: Maciej W. Rozycki <address@hidden>
<snip>
> Index: qemu-git-trunk/include/fpu/softfloat.h
> ===================================================================
> --- qemu-git-trunk.orig/include/fpu/softfloat.h       2014-12-11 
> 18:15:02.000000000 +0000
> +++ qemu-git-trunk/include/fpu/softfloat.h    2014-12-11 18:18:00.918095644 
> +0000
> @@ -370,7 +370,7 @@ static inline int float16_is_any_nan(flo
>  
> /*----------------------------------------------------------------------------
>  | The pattern for a default generated half-precision NaN.
>  
> *----------------------------------------------------------------------------*/
> -extern const float16 float16_default_nan;
> +__inline__ float16 float16_default_nan(void);
>  
>  
> /*----------------------------------------------------------------------------
>  | Software IEC/IEEE single-precision conversion routines.
> @@ -482,7 +482,7 @@ static inline float32 float32_set_sign(f
>  
> /*----------------------------------------------------------------------------
>  | The pattern for a default generated single-precision NaN.
>  
> *----------------------------------------------------------------------------*/
> -extern const float32 float32_default_nan;
> +__inline__ float32 float32_default_nan(void);
>  
>  
> /*----------------------------------------------------------------------------
>  | Software IEC/IEEE double-precision conversion routines.
> @@ -594,7 +594,7 @@ static inline float64 float64_set_sign(f
>  
> /*----------------------------------------------------------------------------
>  | The pattern for a default generated double-precision NaN.
>  
> *----------------------------------------------------------------------------*/
> -extern const float64 float64_default_nan;
> +__inline__ float64 float64_default_nan(void);
>  
>  
> /*----------------------------------------------------------------------------
>  | Software IEC/IEEE extended double-precision conversion routines.
> @@ -679,7 +679,7 @@ static inline int floatx80_is_any_nan(fl
>  
> /*----------------------------------------------------------------------------
>  | The pattern for a default generated extended double-precision NaN.
>  
> *----------------------------------------------------------------------------*/
> -extern const floatx80 floatx80_default_nan;
> +__inline__ floatx80 floatx80_default_nan(void);
>  
>  
> /*----------------------------------------------------------------------------
>  | Software IEC/IEEE quadruple-precision conversion routines.
> @@ -760,6 +760,6 @@ static inline int float128_is_any_nan(fl
>  
> /*----------------------------------------------------------------------------
>  | The pattern for a default generated quadruple-precision NaN.
>  
> *----------------------------------------------------------------------------*/
> -extern const float128 float128_default_nan;
> +__inline__ float128 float128_default_nan(void);
>  

Unfortunately clang complains about it and eventually it won't link:

  CC    aarch64-softmmu/target-arm/helper-a64.o
In file included from /qemu/target-arm/helper-a64.c:20:
In file included from /qemu/target-arm/cpu.h:37:
In file included from /qemu/include/qemu-common.h:120:
In file included from /qemu/include/qemu/bswap.h:8:
/qemu/include/fpu/softfloat.h:485:20: warning: inline function
'float32_default_nan' is not defined [-Wundefined-inline]
__inline__ float32 float32_default_nan(void);
                   ^
/qemu/target-arm/helper-a64.c:345:19: note: used here
            nan = float32_default_nan();
                  ^
In file included from /qemu/target-arm/helper-a64.c:20:
In file included from /qemu/target-arm/cpu.h:37:
In file included from /qemu/include/qemu-common.h:120:
In file included from /qemu/include/qemu/bswap.h:8:
/qemu/include/fpu/softfloat.h:597:20: warning: inline function
'float64_default_nan' is not defined [-Wundefined-inline]
__inline__ float64 float64_default_nan(void);
                   ^
/qemu/target-arm/helper-a64.c:374:19: note: used here
            nan = float64_default_nan();
                  ^
2 warnings generated.
  CC    aarch64-softmmu/target-arm/gdbstub64.o
  CC    aarch64-softmmu/target-arm/crypto_helper.o
  GEN   trace/generated-helpers.c
  CC    aarch64-softmmu/trace/generated-helpers.o
  LINK  aarch64-softmmu/qemu-system-aarch64
fpu/softfloat.o: In function `commonNaNToFloat64':
/qemu/fpu/softfloat-specialize.h:796: undefined reference to
`float64_default_nan'
/qemu/fpu/softfloat-specialize.h:805: undefined reference to
`float64_default_nan'
fpu/softfloat.o: In function `commonNaNToFloatx80':
/qemu/fpu/softfloat-specialize.h:1007: undefined reference to
`floatx80_default_nan'
/qemu/fpu/softfloat-specialize.h:1014: undefined reference to
`floatx80_default_nan'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]