qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] include/fpu/softfloat-macros: Get rid of old SO


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] include/fpu/softfloat-macros: Get rid of old SOFTFLOAT_GNUC_PREREQ code
Date: Thu, 27 Sep 2018 08:28:39 +0100

On 27 September 2018 at 08:16, Thomas Huth <address@hidden> wrote:
> Our minimum required compiler for compiling QEMU is GCC 4.1 these days,
> so we can drop the support for compilers which do not provide the
> __builtin_clz*() functions yet.
>  static inline int8_t countLeadingZeros32(uint32_t a)
>  {
> -#if SOFTFLOAT_GNUC_PREREQ(3, 4)
>      if (a) {
>          return __builtin_clz(a);
>      } else {
>          return 32;
>      }

This can just be written
       return clz32(a);

>  static inline int8_t countLeadingZeros64(uint64_t a)
>  {
> -#if SOFTFLOAT_GNUC_PREREQ(3, 4)
>      if (a) {
>          return __builtin_clzll(a);
>      } else {
>          return 64;
>      }

and this as
       return clz64(a);

using QEMU's versions of these functions from host-utils.h.

Now we've decided we really "own" our copy of softfloat, we
might as well just replace all the countLeadingZeros32() and
countLeadingZeros64() calls with clz32() and clz64(), for
consistency with the rest of the codebase.

thanks
-- PMM



reply via email to

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