[PATCH v3] soft-fp: Add the lack of implementation for 128 bit self-contained.

Zong Li zongbox@gmail.com
Fri Jul 27 01:02:00 GMT 2018


Richard Henderson <rth@twiddle.net> 於 2018年7月27日 週五 上午12:59寫道:
>
> On 07/26/2018 06:16 AM, Zong Li wrote:
> > +#define _FP_FRAC_CLZ_8(R, X)                    \
> > +  do                                            \
> > +    {                                           \
> > +      if (X##_f[7])                             \
> > +        __FP_CLZ ((R), X##_f[7]);               \
> > +      else if (X##_f[6])                        \
> > +        {                                       \
> > +          __FP_CLZ ((R), X##_f[6]);             \
> > +          (R) += _FP_W_TYPE_SIZE;               \
> > +        }                                       \
> > +      else if (X##_f[5])                        \
> ...
>
> Perhaps better as
>
> #define _FP_FRAC_CLZ_8(R, X)                   \
>   do                                           \
>     {                                          \
>       int fs8_i;                               \
>       for (fs8_i = 7; fs8_i > 0; fs8_i--)      \
>         if (X##_f[fs8_i])                      \
>           break;                               \
>       __FP_CLZ ((R), X##_f[fs8_i]);            \
>       (R) += _FP_W_TYPE_SIZE * (7 - fs8_i);    \
>     }                                          \
>   while (0)
>
>
Yes, I use for loop at one time before I summit this patch version.
But I have a little bit
worry about the performance in this macro, because it will get more branch and
instructions by looping opposite to ADD and SUB macro change to use loop.



More information about the Libc-alpha mailing list