[9/9] Remove the error handling wrapper from pow

Message ID d1045eb0-4a16-5cd6-0a26-988660d46659@arm.com
State New
Headers show
Series
  • Untitled series #52867
Related show

Commit Message

Szabolcs Nagy June 29, 2018, 12:56 p.m.
Introduce new pow symbol version that doesn't do SVID compatible error
handling.  The standard errno and fp exception based error handling is
inline in the new code and does not have significant overhead (only
affects uncommon special case code paths).

The w_pow.c wrapper is disabled for sysdeps/ieee754/dbl-64 by using an
empty w_pow.c and enabled on targets using their own pow implementation
or had ifunc dispatch on glibc internal __ieee754_pow symbol.

The __pow_finite symbol is just an alias to pow now.  For backward
compatibility the old pow symbol versions still use a wrapper with
SVID error handling around the new code.

The ia64 asm is chaned so the compat and new symbol versions map to the
same address.

On x86_64 #include <math.h> was added before macro definitions that
may affect that header.

2018-06-29  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* math/Versions (GLIBC_2.28): Add pow.
	* math/w_pow_compat.c (__pow_compat): Change to versioned compat
	symbol.
	* math/w_pow.c: New file.
	* sysdeps/i386/fpu/w_pow.c: New file.
	* sysdeps/ia64/fpu/e_pow.S: Add versioned symbols.
	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Rename to __pow
	and add necessary aliases.
	* sysdeps/ieee754/dbl-64/w_pow.c: New file.
	* sysdeps/m68k/m680x0/fpu/w_pow.c: New file.
	* sysdeps/mach/hurd/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c (__ieee754_pow): Rename to
	__pow.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c (__ieee754_pow): Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_pow.c (__ieee754_pow): Likewise.
	* sysdeps/x86_64/fpu/multiarch/w_pow.c: New file.
---
  math/Versions                                                |  2 +-
  math/w_pow.c                                                 |  8 ++++++++
  math/w_pow_compat.c                                          |  6 +++---
  sysdeps/i386/fpu/w_pow.c                                     |  1 +
  sysdeps/ia64/fpu/e_pow.S                                     |  6 ++++++
  sysdeps/ieee754/dbl-64/e_pow.c                               | 11 ++++++++---
  sysdeps/ieee754/dbl-64/w_pow.c                               |  1 +
  sysdeps/m68k/m680x0/fpu/w_pow.c                              |  1 +
  sysdeps/mach/hurd/i386/libm.abilist                          |  1 +
  sysdeps/unix/sysv/linux/aarch64/libm.abilist                 |  1 +
  sysdeps/unix/sysv/linux/alpha/libm.abilist                   |  1 +
  sysdeps/unix/sysv/linux/arm/libm.abilist                     |  1 +
  sysdeps/unix/sysv/linux/hppa/libm.abilist                    |  1 +
  sysdeps/unix/sysv/linux/i386/libm.abilist                    |  1 +
  sysdeps/unix/sysv/linux/ia64/libm.abilist                    |  1 +
  sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist           |  1 +
  sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist             |  1 +
  sysdeps/unix/sysv/linux/microblaze/libm.abilist              |  1 +
  sysdeps/unix/sysv/linux/mips/mips32/libm.abilist             |  1 +
  sysdeps/unix/sysv/linux/mips/mips64/libm.abilist             |  1 +
  sysdeps/unix/sysv/linux/nios2/libm.abilist                   |  1 +
  sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist   |  1 +
  sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist |  1 +
  sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist       |  1 +
  sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist              |  1 +
  sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist            |  1 +
  sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist            |  1 +
  sysdeps/unix/sysv/linux/sh/libm.abilist                      |  1 +
  sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist           |  1 +
  sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist           |  1 +
  sysdeps/unix/sysv/linux/x86_64/64/libm.abilist               |  1 +
  sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist              |  1 +
  sysdeps/x86_64/fpu/multiarch/e_pow-fma.c                     |  3 +--
  sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c                    |  3 +--
  sysdeps/x86_64/fpu/multiarch/e_pow.c                         |  4 +++-
  sysdeps/x86_64/fpu/multiarch/w_pow.c                         |  1 +
  36 files changed, 59 insertions(+), 12 deletions(-)
  create mode 100644 math/w_pow.c
  create mode 100644 sysdeps/i386/fpu/w_pow.c
  create mode 100644 sysdeps/ieee754/dbl-64/w_pow.c
  create mode 100644 sysdeps/m68k/m680x0/fpu/w_pow.c
  create mode 100644 sysdeps/x86_64/fpu/multiarch/w_pow.c

Patch

diff --git a/math/Versions b/math/Versions
index 986dd3cee4..3cd83c6ded 100644
--- a/math/Versions
+++ b/math/Versions
@@ -575,6 +575,6 @@  libm {
     f32xsubf64x; f32xsubf128; f64subf64x; f64subf128;
     f64xsubf128;
     # No SVID compatible error handling.
-    exp; exp2; log; log2;
+    exp; exp2; log; log2; pow;
   }
 }
diff --git a/math/w_pow.c b/math/w_pow.c
new file mode 100644
index 0000000000..61faa2ed3f
--- /dev/null
+++ b/math/w_pow.c
@@ -0,0 +1,8 @@ 
+#include <math-type-macros-double.h>
+#undef __USE_WRAPPER_TEMPLATE
+#define __USE_WRAPPER_TEMPLATE 1
+#undef declare_mgen_alias
+#define declare_mgen_alias(a, b)
+#include <w_pow_template.c>
+versioned_symbol (libm, __pow, pow, GLIBC_2_28);
+libm_alias_double_other (__pow, pow)
diff --git a/math/w_pow_compat.c b/math/w_pow_compat.c
index 815c67963b..ca2011f4c6 100644
--- a/math/w_pow_compat.c
+++ b/math/w_pow_compat.c
@@ -22,10 +22,10 @@ 
 #include <libm-alias-double.h>
 
 
-#if LIBM_SVID_COMPAT
+#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_28)
 /* wrapper pow */
 double
-__pow (double x, double y)
+__pow_compat (double x, double y)
 {
   double z = __ieee754_pow (x, y);
   if (__glibc_unlikely (!isfinite (z)))
@@ -60,5 +60,5 @@  __pow (double x, double y)
 
   return z;
 }
-libm_alias_double (__pow, pow)
+compat_symbol (libm, __pow_compat, pow, GLIBC_2_0);
 #endif
diff --git a/sysdeps/i386/fpu/w_pow.c b/sysdeps/i386/fpu/w_pow.c
new file mode 100644
index 0000000000..b50c1988de
--- /dev/null
+++ b/sysdeps/i386/fpu/w_pow.c
@@ -0,0 +1 @@ 
+#include <sysdeps/../math/w_pow.c>
diff --git a/sysdeps/ia64/fpu/e_pow.S b/sysdeps/ia64/fpu/e_pow.S
index 3b402f3f14..db209da24e 100644
--- a/sysdeps/ia64/fpu/e_pow.S
+++ b/sysdeps/ia64/fpu/e_pow.S
@@ -2235,6 +2235,12 @@  POW_OVER_UNDER_ERROR:
 
 GLOBAL_LIBM_END(pow)
 libm_alias_double_other (pow, pow)
+#ifdef SHARED
+.symver pow,pow@@GLIBC_2.28
+.weak __pow_compat
+.set __pow_compat,__pow
+.symver __pow_compat,pow@GLIBC_2.0
+#endif
 
 
 LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 1d7ecd2fc1..892c8855a3 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -20,6 +20,8 @@ 
 #include <stdint.h>
 #include <math-barriers.h>
 #include <math-narrow-eval.h>
+#include <shlib-compat.h>
+#include <libm-alias-double.h>
 #include "math_config.h"
 
 /*
@@ -282,7 +284,7 @@  zeroinfnan (uint64_t i)
 
 double
 SECTION
-__ieee754_pow (double x, double y)
+__pow (double x, double y)
 {
   uint32_t sign_bias = 0;
   uint64_t ix, iy;
@@ -381,6 +383,9 @@  __ieee754_pow (double x, double y)
 #endif
   return exp_inline (ehi, elo, sign_bias);
 }
-#ifndef __ieee754_pow
-strong_alias (__ieee754_pow, __pow_finite)
+#ifndef __pow
+strong_alias (__pow, __ieee754_pow)
+strong_alias (__pow, __pow_finite)
+versioned_symbol (libm, __pow, pow, GLIBC_2_28);
+libm_alias_double_other (__pow, pow)
 #endif
diff --git a/sysdeps/ieee754/dbl-64/w_pow.c b/sysdeps/ieee754/dbl-64/w_pow.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/w_pow.c
@@ -0,0 +1 @@ 
+/* Not needed.  */
diff --git a/sysdeps/m68k/m680x0/fpu/w_pow.c b/sysdeps/m68k/m680x0/fpu/w_pow.c
new file mode 100644
index 0000000000..b50c1988de
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_pow.c
@@ -0,0 +1 @@ 
+#include <sysdeps/../math/w_pow.c>
diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386/libm.abilist
index 49b8298cae..f64efcf832 100644
--- a/sysdeps/mach/hurd/i386/libm.abilist
+++ b/sysdeps/mach/hurd/i386/libm.abilist
@@ -1072,3 +1072,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libm.abilist b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
index 5822c73a25..d44416e6d1 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
@@ -1036,3 +1036,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/alpha/libm.abilist b/sysdeps/unix/sysv/linux/alpha/libm.abilist
index 99fd72df34..6627df2fdb 100644
--- a/sysdeps/unix/sysv/linux/alpha/libm.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libm.abilist
@@ -1047,6 +1047,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.3.4 __c1_cabsf F
 GLIBC_2.3.4 __c1_cacosf F
 GLIBC_2.3.4 __c1_cacoshf F
diff --git a/sysdeps/unix/sysv/linux/arm/libm.abilist b/sysdeps/unix/sysv/linux/arm/libm.abilist
index f25337fe76..2c4a87e29f 100644
--- a/sysdeps/unix/sysv/linux/arm/libm.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libm.abilist
@@ -457,6 +457,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 _LIB_VERSION D 0x4
 GLIBC_2.4 __clog10 F
 GLIBC_2.4 __clog10f F
diff --git a/sysdeps/unix/sysv/linux/hppa/libm.abilist b/sysdeps/unix/sysv/linux/hppa/libm.abilist
index cee07ba66c..cd2ab5d6b5 100644
--- a/sysdeps/unix/sysv/linux/hppa/libm.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libm.abilist
@@ -768,4 +768,5 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist
index 98f19cb137..397754a76c 100644
--- a/sysdeps/unix/sysv/linux/i386/libm.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libm.abilist
@@ -1079,3 +1079,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/ia64/libm.abilist b/sysdeps/unix/sysv/linux/ia64/libm.abilist
index b32cff741b..2e6a56e93a 100644
--- a/sysdeps/unix/sysv/linux/ia64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libm.abilist
@@ -1009,3 +1009,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
index f25337fe76..2c4a87e29f 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
@@ -457,6 +457,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 _LIB_VERSION D 0x4
 GLIBC_2.4 __clog10 F
 GLIBC_2.4 __clog10f F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
index 9a04d77ec0..bc3923d037 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
@@ -808,3 +808,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libm.abilist b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
index 519eaa6df9..8d6ab715f3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libm.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
@@ -769,3 +769,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
index 4050a919d5..0bf2708cc3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
@@ -768,4 +768,5 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
index 61c60c4e11..41fc36a4cf 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
@@ -1036,3 +1036,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/nios2/libm.abilist b/sysdeps/unix/sysv/linux/nios2/libm.abilist
index bc52c8f7ee..d1e51e54b5 100644
--- a/sysdeps/unix/sysv/linux/nios2/libm.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libm.abilist
@@ -769,3 +769,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
index 66f87147e2..a981a16d97 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
@@ -814,6 +814,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
 GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
index 324b4e68dc..bdb4c81fa5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
@@ -813,6 +813,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
 GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
index 39ff08b018..ee4f9530b9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
@@ -492,6 +492,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.3 _LIB_VERSION D 0x4
 GLIBC_2.3 __clog10 F
 GLIBC_2.3 __clog10f F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist
index 1c8404c8de..b5706d4b8b 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist
@@ -1023,3 +1023,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
index ba4d1a1959..0faa0190c6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
@@ -1037,6 +1037,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
 GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
index 3649e5321a..8e48dee271 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
@@ -1037,6 +1037,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
 GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/sh/libm.abilist b/sysdeps/unix/sysv/linux/sh/libm.abilist
index 5e42e06e1d..372d58c03b 100644
--- a/sysdeps/unix/sysv/linux/sh/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libm.abilist
@@ -768,4 +768,5 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
index 795f7a70de..68b768d05f 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
@@ -1044,6 +1044,7 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
 GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
index e3cd41f16e..9dc43cb5a6 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
@@ -1036,3 +1036,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
index 6d9a61107c..1700ba655e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
@@ -1070,3 +1070,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
index ca609340df..4d246c982e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
@@ -1070,3 +1070,4 @@  GLIBC_2.28 fsub F
 GLIBC_2.28 fsubl F
 GLIBC_2.28 log F
 GLIBC_2.28 log2 F
+GLIBC_2.28 pow F
diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow-fma.c b/sysdeps/x86_64/fpu/multiarch/e_pow-fma.c
index 73c1e7fb89..a6b38785f7 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_pow-fma.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_pow-fma.c
@@ -1,5 +1,4 @@ 
-#define __ieee754_pow __ieee754_pow_fma
-#define __exp1 __exp1_fma
+#define __pow __ieee754_pow_fma
 #define SECTION __attribute__ ((section (".text.fma")))
 
 #include <sysdeps/ieee754/dbl-64/e_pow.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
index 8971b655ca..b417c3567c 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
@@ -1,5 +1,4 @@ 
-#define __ieee754_pow __ieee754_pow_fma4
-#define __exp1 __exp1_fma4
+#define __pow __ieee754_pow_fma4
 #define SECTION __attribute__ ((section (".text.fma4")))
 
 #include <sysdeps/ieee754/dbl-64/e_pow.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow.c b/sysdeps/x86_64/fpu/multiarch/e_pow.c
index 084073c936..207ffcd2f1 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_pow.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_pow.c
@@ -16,6 +16,8 @@ 
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <math.h>
+
 extern double __redirect_ieee754_pow (double, double);
 
 #define SYMBOL_NAME ieee754_pow
@@ -25,5 +27,5 @@  libc_ifunc_redirected (__redirect_ieee754_pow,
 		       __ieee754_pow, IFUNC_SELECTOR ());
 strong_alias (__ieee754_pow, __pow_finite)
 
-#define __ieee754_pow __ieee754_pow_sse2
+#define __pow __ieee754_pow_sse2
 #include <sysdeps/ieee754/dbl-64/e_pow.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/w_pow.c b/sysdeps/x86_64/fpu/multiarch/w_pow.c
new file mode 100644
index 0000000000..b50c1988de
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/w_pow.c
@@ -0,0 +1 @@ 
+#include <sysdeps/../math/w_pow.c>