This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3] soft-fp: Add the lack of implementation for 128 bit self-contained.
- From: Zong Li <zongbox at gmail dot com>
- To: rth at twiddle dot net
- Cc: Zong Li <zong at andestech dot com>, joseph at codesourcery dot com, Palmer Dabbelt <palmer at dabbelt dot com>, darius at bluespec dot com, Andrew Waterman <andrew at sifive dot com>, dj at redhat dot com, libc-alpha at sourceware dot org, Richard Henderson <rth7680 at gmail dot com>
- Date: Fri, 27 Jul 2018 09:02:30 +0800
- Subject: Re: [PATCH v3] soft-fp: Add the lack of implementation for 128 bit self-contained.
- References: <1532610973-22705-1-git-send-email-zong@andestech.com> <11e8e5d3-841d-956e-1535-57b7308f202b@twiddle.net>
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.