public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sunil Pandey <skpgkp2@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: GNU C Library <libc-alpha@sourceware.org>, andrey.kolesov@intel.com
Subject: Re: [PATCH 05/42] x86-64: Add vector asin/asinf implementation to libmvec
Date: Wed, 8 Dec 2021 17:08:31 -0800	[thread overview]
Message-ID: <CAMAf5_fb6ASJzOL+=TiKFvtV177AHSXDzzFpLmhmdZfVEObtDg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2111242236310.1698965@digraph.polyomino.org.uk>

On Wed, Nov 24, 2021 at 2:52 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Wed, 24 Nov 2021, Sunil K Pandey via Libc-alpha wrote:
>
> > Implement vectorized asin/asinf containing SSE, AVX, AVX2 and
> > AVX512 versions for libmvec as per vector ABI.  It also contains
> > accuracy and ABI tests for vector asin/asinf with regenerated ulps.
>
> Here are some general comments that probably also apply to other patches
> in the series; you'll need to review all the other patches in the series
> for such issues.
>
> >  sysdeps/x86/fpu/bits/math-vector.h            |    4 +
>
> I'd expect corresponding changes to
> sysdeps/x86/fpu/finclude/math-vector-fortran.h so the functions can be
> used from Fortran code.

Function added in sysdeps/x86/fpu/finclude/math-vector-fortran.h  in v2 patch.

>
>
> > +        cmpltpd   128+__svml_dasin_data_internal(%rip), %xmm0
> > +        cvtps2pd  %xmm1, %xmm2
> > +        movups    256+__svml_dasin_data_internal(%rip), %xmm6
>
> Please see my comments from the review of the original libmvec addition
> regarding how to make the code and the tables of data it uses more
> readable
> <https://sourceware.org/legacy-ml/libc-alpha/2014-10/msg00324.html>.
>
> We don't want hardcoded offsets into data tables, such as 128 or 256 here,
> in the function implementations, and we want the data tables to have
> meaningful names or comments on each part of the table saying what the
> semantics are.  That might mean defining lots of separate smaller tables,
> each with an appropriate name and comment describing its semantics, rather
> than just the one __svml_dasin_data_internal.  Or, if it's desirable in
> some cases to load the table address once and do everything else based on
> offsets from it, it might mean defining C macros (with meaningful names)
> for the various offsets, like those macros in svml_d_trig_data.h, and then
> defining the data using corresponding assembler macros to verify that the
> offsets for the data in the table actually match those in the C macros and
> cause a compile-time error if the C macros don't match the offsets.

We have a plan to address  the data table issue by adding comments and macro.
It will describe what they are. But we do not have time to finish for
2.35 and we
will fix it in 2.36.

>
> > +        .cfi_escape 0x10, 0x19, 0x0e, 0x38, 0x1c, 0x0d, 0xc0, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0x70, 0xff, 0xff, 0xff, 0x22
> > +        .cfi_escape 0x10, 0x1f, 0x0e, 0x38, 0x1c, 0x0d, 0xc0, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0xa0, 0xff, 0xff, 0xff, 0x22
> > +        .cfi_escape 0x10, 0x20, 0x0e, 0x38, 0x1c, 0x0d, 0xc0, 0xff, 0xff, 0xff, 0x1a, 0x0d, 0x90, 0xff, 0xff, 0xff, 0x22
>
> Why do you have all these .cfi_escape in the .S sources?
>

.cfi_escape is a standard way to define DW_CFA_expression and associated
 registers. For example

DW_CFA_expression: r4 (rsi) (DW_OP_lit8; DW_OP_minus; DW_OP_const4s:
-64; DW_OP_and; DW_OP_const4s: -200; DW_OP_plus)

> If something needs to be represented in unwind info, it would be better to
> do it with more reader-friendly directives rather than .cfi_escape.  If
> such reader-friendly directives require a newer binutils version than the
> current minimum, what version do they require?  We could consider updating
> that minimum.
>
> > +.LBL_1_3:
>
> I don't think this sort of label name is very friendly.  At least, I'd
> suggest that each such label should have a comment explaining what the
> code is doing at that point, to help readers follow the flow of control in
> the function.
>
> In general, it helps for long assembly sources (and these are certainly
> long) to be heavily commented to help readers follow what is happening
> where in the code.  While a comment per line of C code would be heavily
> excessive in C sources, having comments in assembly code per every few
> lines of equivalent C seems quite reasonable.  That means many more
> comments than there are in this patch at present.

We will add more comments, but we need to add comments to the data table first.
We will do it in 2.36. For 2.35, we just changed the label to sequential.

I am going to send the v2 patch today.

> --
> Joseph S. Myers
> joseph@codesourcery.com

  parent reply	other threads:[~2021-12-09  1:09 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 19:37 [PATCH 00/42] x86-64: Add vector math functions " Sunil K Pandey
2021-11-24 19:37 ` [PATCH 01/42] x86-64: Add vector acos/acosf implementation " Sunil K Pandey
     [not found]   ` <CAFUsyfKpKz3=q_4JQUGOkUkUDpDUEEr_F9RpnoxJMgmwHfTfjw@mail.gmail.com>
     [not found]     ` <CAFUsyfJqPKwjB0oWDC8Ce8AacyC4wU6JHWeeXASQe-3dGJS9Og@mail.gmail.com>
2021-12-09  2:10       ` Sunil Pandey
2021-12-09 18:34         ` Joseph Myers
2021-11-24 19:37 ` [PATCH 02/42] x86-64: Add vector acos/acosf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 03/42] x86-64: Add vector acosh/acoshf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 04/42] x86-64: Add vector acosh/acoshf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 05/42] x86-64: Add vector asin/asinf implementation to libmvec Sunil K Pandey
2021-11-24 22:51   ` Joseph Myers
2021-11-29 20:56     ` Sunil Pandey
2021-12-09  1:08     ` Sunil Pandey [this message]
2021-12-09  3:38       ` Noah Goldstein
2021-12-09 18:38         ` Joseph Myers
2021-12-15 18:54           ` [PATCH v3 0/1] Add vector math function acos/acosf " Sunil K Pandey
2021-12-15 18:54             ` [PATCH v3 1/1] x86-64: Add vector acos/acosf implementation " Sunil K Pandey
2021-12-15 19:43               ` Noah Goldstein
2021-12-15 19:57                 ` Florian Weimer
2021-12-15 20:32                   ` Noah Goldstein
2021-12-15 22:26                     ` Sunil Pandey
2021-12-16  0:12                     ` [PATCH v4 0/1] Add vector math function acos/acosf " Sunil K Pandey
2021-12-16  0:12                       ` [PATCH v4 1/1] x86-64: Add vector acos/acosf implementation " Sunil K Pandey
2021-12-16  0:56                         ` Noah Goldstein
2021-12-19 17:11                           ` Sunil Pandey
2021-12-19 17:18                           ` [PATCH v5 0/1] Add vector math function acos/acosf " Sunil K Pandey
2021-12-19 17:18                             ` [PATCH v5 1/1] x86-64: Add vector acos/acosf implementation " Sunil K Pandey
2021-12-19 18:29                               ` Noah Goldstein
2021-12-19 20:26                                 ` H.J. Lu
2021-12-19 20:42                                   ` Noah Goldstein
2021-12-20 16:08                                     ` Sunil Pandey
2021-12-20 19:20                                       ` Noah Goldstein
2021-12-20 19:36                                         ` Noah Goldstein
2021-12-20 20:30                                         ` Sunil Pandey
2021-12-21  5:40                                         ` [PATCH v6 0/1] Add vector math function acos/acosf " Sunil K Pandey
2021-12-21  5:40                                           ` [PATCH v6 1/1] x86-64: Add vector acos/acosf implementation " Sunil K Pandey
2021-12-21  6:44                                           ` [PATCH v6 0/1] Add vector math function acos/acosf " Noah Goldstein
2021-12-22  0:15                                             ` H.J. Lu
2021-12-22 16:23                                             ` [PATCH v7 " Sunil K Pandey
2021-12-22 16:23                                               ` [PATCH v7 1/1] x86-64: Add vector acos/acosf implementation " Sunil K Pandey
2021-12-22 20:51                                                 ` H.J. Lu
2021-12-16 19:14                         ` [PATCH v4 " Joseph Myers
2021-12-16 21:07                           ` Sunil Pandey
2021-12-16 19:18                       ` [PATCH v4 0/1] Add vector math function acos/acosf " Joseph Myers
2021-12-16 21:13                         ` Adhemerval Zanella
2021-12-19 20:34                           ` H.J. Lu
2021-12-20 19:10                             ` Adhemerval Zanella
2021-12-20 19:55                               ` H.J. Lu
2021-12-20 21:41                             ` Joseph Myers
2021-12-20 22:07                               ` Cornea, Marius
2021-12-20 22:19                                 ` Joseph Myers
2021-12-20 22:42                                   ` Cornea, Marius
2021-12-20 22:57                                     ` Joseph Myers
2021-12-20 23:11                                       ` Noah Goldstein
2021-12-20 23:58                                         ` H.J. Lu
2021-12-15 19:06           ` [PATCH 05/42] x86-64: Add vector asin/asinf implementation " Adhemerval Zanella
2021-11-24 19:37 ` [PATCH 06/42] x86-64: Add vector asin/asinf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 07/42] x86-64: Add vector asinh/asinhf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 08/42] x86-64: Add vector asinh/asinhf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 09/42] x86-64: Add vector atan/atanf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 10/42] x86-64: Add vector atan/atanf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 11/42] x86-64: Add vector atan2/atan2f implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 12/42] x86-64: Add vector atan2/atan2f to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 13/42] x86-64: Add vector atanh/atanhf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 14/42] x86-64: Add vector atanh/atanhf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 15/42] x86-64: Add vector cbrt/cbrtf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 16/42] x86-64: Add vector cbrt/cbrtf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 17/42] x86-64: Add vector cosh/coshf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 18/42] x86-64: Add vector cosh/coshf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 19/42] x86-64: Add vector erf/erff implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 20/42] x86-64: Add vector erf/erff to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 21/42] x86-64: Add vector erfc/erfcf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 22/42] x86-64: Add vector erfc/erfcf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 23/42] x86-64: Add vector exp10/exp10f implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 24/42] x86-64: Add vector exp10/exp10f to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 25/42] x86-64: Add vector exp2/exp2f implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 26/42] x86-64: Add vector exp2/exp2f to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 27/42] x86-64: Add vector expm1/expm1f implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 28/42] x86-64: Add vector expm1/expm1f to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 29/42] x86-64: Add vector hypot/hypotf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 30/42] x86-64: Add vector hypot/hypotf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 31/42] x86-64: Add vector log10/log10f implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 32/42] x86-64: Add vector log10/log10f to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:37 ` [PATCH 33/42] x86-64: Add vector log1p/log1pf implementation to libmvec Sunil K Pandey
2021-11-24 19:37 ` [PATCH 34/42] x86-64: Add vector log1p/log1pf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:38 ` [PATCH 35/42] x86-64: Add vector log2/log2f implementation to libmvec Sunil K Pandey
2021-11-24 19:38 ` [PATCH 36/42] x86-64: Add vector log2/log2f to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:38 ` [PATCH 37/42] x86-64: Add vector sinh/sinhf implementation to libmvec Sunil K Pandey
2021-11-24 19:38 ` [PATCH 38/42] x86-64: Add vector sinh/sinhf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:38 ` [PATCH 39/42] x86-64: Add vector tan/tanf implementation to libmvec Sunil K Pandey
2021-11-24 19:38 ` [PATCH 40/42] x86-64: Add vector tan/tanf to libmvec microbenchmark Sunil K Pandey
2021-11-24 19:38 ` [PATCH 41/42] x86-64: Add vector tanh/tanhf implementation to libmvec Sunil K Pandey
2021-11-24 19:38 ` [PATCH 42/42] x86-64: Add vector tanh/tanhf to libmvec microbenchmark Sunil K Pandey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMAf5_fb6ASJzOL+=TiKFvtV177AHSXDzzFpLmhmdZfVEObtDg@mail.gmail.com' \
    --to=skpgkp2@gmail.com \
    --cc=andrey.kolesov@intel.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).