public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 00/18] Use GCC builtins for some math functions if desired.
@ 2019-12-09 12:46 Stefan Liebler
  2019-12-09 12:47 ` [PATCH v2 01/18] Always use wordsize-64 version of s_nearbyint.c Stefan Liebler
                   ` (18 more replies)
  0 siblings, 19 replies; 33+ messages in thread
From: Stefan Liebler @ 2019-12-09 12:46 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stefan Liebler

Hi,

this patch-series moves the nearbyint, rint, floor, ceil, trunc and round implementation from sysdeps/ieee754/dbl-64/wordsize-64 to sysdeps/ieee754/dbl-64/ as proposed by Adhemerval:
ttps://www.sourceware.org/ml/libc-alpha/2019-11/msg00085.html

It also introduces the math-use-builtins.h header with __USE_<SYMBOL>_BUILTIN macros which allows to just use GCC __builtin_<SYMBOL> instead of the current common-code implementation.  There is a float, double, long double and _Float128 version of this macro for each <SYMBOL>.

The generic math-use-builtins.h header is defining all those macros to 0 in order to use the current common-code implenetation.  If an architecture wants to use the builtins, an architecture specific math-use-builtins.h needs to be created (e.g. done for s390) where those macros are defined to 1.

Changes compared to first version (see https://www.sourceware.org/ml/libc-alpha/2019-12/msg00029.html) due to review from:
Joseph Myers:
* The copysign builtins are now used unconditionally for float, double and long double.  For _Float128 the macro is defined to 1 if build with GCC >= 7.

Adhemerval Zanella:
* Some static array definitions like TWO52 in s_nearbyint.c are moved inside the !USE_NEARBYINT_BUILTIN within the function.
* The s390 math-use-builtins.h header is now replicating the USE_XYZ* macros for !HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT instead of just including the generic header file.
* The changes regarding code style in the "Use GCC builtins for xyz functions if desired" patches are splitted out into the new patches "Adjust s_XYZ.c regarding code style."

Bye,
Stefan

Stefan Liebler (18):
  Always use wordsize-64 version of s_nearbyint.c.
  Always use wordsize-64 version of s_rint.c.
  Always use wordsize-64 version of s_floor.c.
  Always use wordsize-64 version of s_ceil.c.
  Always use wordsize-64 version of s_trunc.c.
  Always use wordsize-64 version of s_round.c.
  Use GCC builtins for nearbyint functions if desired.
  Use GCC builtins for rint functions if desired.
  Use GCC builtins for floor functions if desired.
  Use GCC builtins for ceil functions if desired.
  Use GCC builtins for trunc functions if desired.
  Use GCC builtins for round functions if desired.
  Use GCC builtins for copysign functions if desired.
  Adjust s_nearbyintf.c and s_nearbyintl.c regarding code style.
  Adjust s_rintf.c and s_rintl.c regarding code style.
  Adjust s_floorf.c and s_floorl.c regarding code style.
  Adjust s_ceilf.c and s_ceill.c regarding code style.
  Adjust s_copysignl.c regarding code style.

 sysdeps/generic/math-use-builtins.h           |  63 ++++++++++
 sysdeps/ieee754/dbl-64/s_ceil.c               |  65 ++++------
 sysdeps/ieee754/dbl-64/s_copysign.c           |   9 +-
 sysdeps/ieee754/dbl-64/s_floor.c              |  99 ++++++++--------
 sysdeps/ieee754/dbl-64/s_nearbyint.c          |  49 ++++----
 sysdeps/ieee754/dbl-64/s_rint.c               |  43 ++++---
 sysdeps/ieee754/dbl-64/s_round.c              |  45 +++----
 sysdeps/ieee754/dbl-64/s_trunc.c              |  31 ++---
 sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c   |  52 --------
 sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c  |  72 ------------
 .../ieee754/dbl-64/wordsize-64/s_nearbyint.c  |  65 ----------
 sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c   |  58 ---------
 sysdeps/ieee754/dbl-64/wordsize-64/s_round.c  |  66 -----------
 sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c  |  55 ---------
 sysdeps/ieee754/float128/float128_private.h   |  22 ++++
 sysdeps/ieee754/flt-32/s_ceilf.c              |  61 ++++++----
 sysdeps/ieee754/flt-32/s_copysignf.c          |  12 +-
 sysdeps/ieee754/flt-32/s_floorf.c             |  61 ++++++----
 sysdeps/ieee754/flt-32/s_nearbyintf.c         |  77 ++++++------
 sysdeps/ieee754/flt-32/s_rintf.c              |  61 ++++++----
 sysdeps/ieee754/flt-32/s_roundf.c             |   6 +
 sysdeps/ieee754/flt-32/s_truncf.c             |   6 +
 sysdeps/ieee754/ldbl-128/s_ceill.c            |  97 ++++++++++-----
 sysdeps/ieee754/ldbl-128/s_copysignl.c        |  23 ++--
 sysdeps/ieee754/ldbl-128/s_floorl.c           |  95 ++++++++++-----
 sysdeps/ieee754/ldbl-128/s_nearbyintl.c       |  80 +++++++------
 sysdeps/ieee754/ldbl-128/s_rintl.c            |  66 ++++++-----
 sysdeps/ieee754/ldbl-128/s_roundl.c           |   6 +
 sysdeps/ieee754/ldbl-128/s_truncl.c           |   6 +
 sysdeps/s390/fpu/math-use-builtins.h          | 111 ++++++++++++++++++
 .../sparc64/fpu/multiarch/s_ceil-generic.c    |   2 +-
 .../sparc/sparc64/fpu/multiarch/s_ceil-vis3.c |   2 +-
 .../sparc64/fpu/multiarch/s_floor-generic.c   |   2 +-
 .../sparc64/fpu/multiarch/s_floor-vis3.c      |   2 +-
 .../sparc64/fpu/multiarch/s_trunc-generic.c   |   2 +-
 .../sparc64/fpu/multiarch/s_trunc-vis3.c      |   2 +-
 sysdeps/x86_64/fpu/multiarch/s_ceil-c.c       |   2 +-
 sysdeps/x86_64/fpu/multiarch/s_floor-c.c      |   2 +-
 sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c  |   2 +-
 sysdeps/x86_64/fpu/multiarch/s_rint-c.c       |   2 +-
 sysdeps/x86_64/fpu/multiarch/s_trunc-c.c      |   2 +-
 41 files changed, 778 insertions(+), 806 deletions(-)
 create mode 100644 sysdeps/generic/math-use-builtins.h
 delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
 delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
 delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
 delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
 delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
 delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
 create mode 100644 sysdeps/s390/fpu/math-use-builtins.h

-- 
2.19.1

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2019-12-11 14:16 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 12:46 [PATCH v2 00/18] Use GCC builtins for some math functions if desired Stefan Liebler
2019-12-09 12:47 ` [PATCH v2 01/18] Always use wordsize-64 version of s_nearbyint.c Stefan Liebler
2019-12-09 12:47 ` [PATCH v2 02/18] Always use wordsize-64 version of s_rint.c Stefan Liebler
2019-12-09 12:48 ` [PATCH v2 04/18] Always use wordsize-64 version of s_ceil.c Stefan Liebler
2019-12-09 12:48 ` [PATCH v2 03/18] Always use wordsize-64 version of s_floor.c Stefan Liebler
2019-12-09 12:49 ` [PATCH v2 07/18] Use GCC builtins for nearbyint functions if desired Stefan Liebler
2019-12-10 19:16   ` Adhemerval Zanella
2019-12-09 12:49 ` [PATCH v2 06/18] Always use wordsize-64 version of s_round.c Stefan Liebler
2019-12-09 12:49 ` [PATCH v2 05/18] Always use wordsize-64 version of s_trunc.c Stefan Liebler
2019-12-09 12:50 ` [PATCH v2 10/18] Use GCC builtins for ceil functions if desired Stefan Liebler
2019-12-10 19:16   ` Adhemerval Zanella
2019-12-09 12:50 ` [PATCH v2 08/18] Use GCC builtins for rint " Stefan Liebler
2019-12-10 19:15   ` Adhemerval Zanella
2019-12-09 12:50 ` [PATCH v2 09/18] Use GCC builtins for floor " Stefan Liebler
2019-12-10 19:15   ` Adhemerval Zanella
2019-12-09 12:50 ` [PATCH v2 11/18] Use GCC builtins for trunc " Stefan Liebler
2019-12-10 19:15   ` Adhemerval Zanella
2019-12-09 12:51 ` [PATCH v2 16/18] Adjust s_floorf.c and s_floorl.c regarding code style Stefan Liebler
2019-12-10 19:16   ` Adhemerval Zanella
2019-12-09 12:51 ` [PATCH v2 14/18] Adjust s_nearbyintf.c and s_nearbyintl.c " Stefan Liebler
2019-12-10 19:16   ` Adhemerval Zanella
2019-12-09 12:51 ` [PATCH v2 12/18] Use GCC builtins for round functions if desired Stefan Liebler
2019-12-10 19:15   ` Adhemerval Zanella
2019-12-09 12:51 ` [PATCH v2 13/18] Use GCC builtins for copysign " Stefan Liebler
2019-12-10 19:16   ` Adhemerval Zanella
2019-12-09 12:51 ` [PATCH v2 15/18] Adjust s_rintf.c and s_rintl.c regarding code style Stefan Liebler
2019-12-10 19:15   ` Adhemerval Zanella
2019-12-09 12:52 ` [PATCH v2 18/18] Adjust s_copysignl.c " Stefan Liebler
2019-12-10 19:16   ` Adhemerval Zanella
2019-12-09 12:52 ` [PATCH v2 17/18] Adjust s_ceilf.c and s_ceill.c " Stefan Liebler
2019-12-10 19:15   ` Adhemerval Zanella
2019-12-10 19:18 ` [PATCH v2 00/18] Use GCC builtins for some math functions if desired Adhemerval Zanella
2019-12-11 14:16   ` Stefan Liebler

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).