This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 2/2] soft-fp: Add inplementation for 128 bit self-contained
- From: Zong Li <zongbox at gmail dot com>
- To: joseph at codesourcery dot com
- Cc: Palmer Dabbelt <palmer at dabbelt dot com>, jimw at sifive dot com, kito at andestech dot com, greentime at andestech dot com, Zong Li <zong at andestech dot com>, libc-alpha at sourceware dot org
- Date: Thu, 1 Nov 2018 09:51:56 +0800
- Subject: Re: [PATCH v2 2/2] soft-fp: Add inplementation for 128 bit self-contained
- References: <cover.1540990635.git.zongbox@gmail.com> <adcb081d2f3d071b870a3f4fa653b2f6967a9d21.1540990635.git.zongbox@gmail.com> <alpine.DEB.2.21.1810311647120.31548@digraph.polyomino.org.uk>
Joseph Myers <joseph@codesourcery.com> 於 2018年11月1日 週四 上午12:51寫道:
>
> On Wed, 31 Oct 2018, Zong Li wrote:
>
> > + R##_f[_FP_FRAC_ADD_8_i] \
> > + = X##_f[_FP_FRAC_ADD_8_i] \
> > + + Y##_f[_FP_FRAC_ADD_8_i] \
> > + + _FP_FRAC_ADD_8_c; \
>
> For these sorts of expressions broken over multiple lines, please see the
> GNU Coding Standards:
>
> Insert extra parentheses so that Emacs will indent the code properly.
> For example, the following indentation looks nice if you do it by hand,
>
> @example
> v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
> + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;
> @end example
>
> @noindent
> but Emacs would alter it. Adding a set of parentheses produces
> something that looks equally nice, and which Emacs will preserve:
>
> @example
> v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
> + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);
> @end example
>
> So, you should have parentheses around the RHS of '=' here to ensure it
> stays properly indented across future edits (rather than the '+' ending up
> in the same column as '=', which is what would happen without those
> parentheses).
>
> > + _FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i] \
> > + = X##_f[_FP_FRAC_SUB_8_i] \
> > + - Y##_f[_FP_FRAC_SUB_8_i] \
> > + - _FP_FRAC_SUB_8_c; \
>
> Likewise here.
>
> > + _FP_FRAC_SUB_8_c \
> > + = (_FP_FRAC_SUB_8_c \
> > + ? _FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i] \
> > + >= X##_f[_FP_FRAC_SUB_8_i] \
> > + : _FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i] \
> > + > X##_f[_FP_FRAC_SUB_8_i]); \
>
> Likewise for the '>=' and '>' expressions as operands of ?:.
> > + for (_FP_FRAC_SUB_8_i = 0; _FP_FRAC_SUB_8_i < 8; ++_FP_FRAC_SUB_8_i) \
> > + { \
> > + R##_f[_FP_FRAC_SUB_8_i] = _FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i]; \
> > + } \
>
> When there is only a single statement in a block, we don't generally use {
> } around that block.
>
Thanks for the corrections, I would fix them in next version.