[5/5] Extend generic k_rem_pio2 implementation using generics.
diff mbox

Message ID 52858566502889b94bf1d4127aaa027cc51a40fb.1472599898.git.murphyp@linux.vnet.ibm.com
State New
Headers show

Commit Message

Paul E. Murphy Aug. 30, 2016, 11:39 p.m. UTC
This is actually just an internal stub.  It is already
implemented where needed.  This ensures there is always
an empty stub for each type/format when it is not needed.

	* math/Makefile: (gen-libm-calls): Add k_rem_pio2.
	(libm-calls): Remove above.

	* math/k_rem_pio2l.c: Refactor into ...
	* math/k_rem_pio2_template.c: New file.
---
 math/Makefile              |  5 +++--
 math/k_rem_pio2_template.c |  2 ++
 math/k_rem_pio2l.c         | 15 ---------------
 3 files changed, 5 insertions(+), 17 deletions(-)
 create mode 100644 math/k_rem_pio2_template.c
 delete mode 100644 math/k_rem_pio2l.c

Comments

Andreas Schwab Aug. 31, 2016, 7:40 a.m. UTC | #1
On Aug 31 2016, "Paul E. Murphy" <murphyp@linux.vnet.ibm.com> wrote:

> diff --git a/math/k_rem_pio2_template.c b/math/k_rem_pio2_template.c
> new file mode 100644
> index 0000000..4bb79f6
> --- /dev/null
> +++ b/math/k_rem_pio2_template.c
> @@ -0,0 +1,2 @@
> +/* This function is not necessary for all formats/types.  If necessary, override this

Overlong line.

Andreas.
Joseph Myers Aug. 31, 2016, 4:41 p.m. UTC | #2
On Tue, 30 Aug 2016, Paul E. Murphy wrote:

> This is actually just an internal stub.  It is already
> implemented where needed.  This ensures there is always
> an empty stub for each type/format when it is not needed.

I think it would be better to list this in type-double-routines and 
type-float-routines (and remove all the k_rem_pio2l source files, not just 
the math/ one).  That is, as a function present only for float and double, 
just list it as such.

Patch
diff mbox

diff --git a/math/Makefile b/math/Makefile
index c0d7ff0..0eb904f 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -49,14 +49,15 @@  gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF		  \
 	         s_cacoshF s_ccosF s_ccoshF s_casinF s_csinF s_casinhF	  \
 		 k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \
 		 s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF	  \
-		 s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF
+		 s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF    \
+		 k_rem_pio2F
 
 libm-calls =								  \
 	e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
 	e_hypotF e_j0F e_j1F e_jnF e_lgammaF_r e_logF e_log10F e_powF	  \
 	e_rem_pio2F e_remainderF e_scalbF e_sinhF e_sqrtF e_gammaF_r	  \
 	e_ilogbF							  \
-	k_cosF k_rem_pio2F k_sinF k_tanF s_asinhF s_atanF s_cbrtF	  \
+	k_cosF k_sinF k_tanF s_asinhF s_atanF s_cbrtF			  \
 	s_ceilF s_cosF s_erfF s_expm1F s_fabsF				  \
 	s_floorF s_log1pF w_log1pF s_logbF				  \
 	s_nextafterF s_nexttowardF s_rintF s_scalblnF w_scalblnF	  \
diff --git a/math/k_rem_pio2_template.c b/math/k_rem_pio2_template.c
new file mode 100644
index 0000000..4bb79f6
--- /dev/null
+++ b/math/k_rem_pio2_template.c
@@ -0,0 +1,2 @@ 
+/* This function is not necessary for all formats/types.  If necessary, override this
+   in the format/type specific directory.  */
diff --git a/math/k_rem_pio2l.c b/math/k_rem_pio2l.c
deleted file mode 100644
index 01bf158..0000000
--- a/math/k_rem_pio2l.c
+++ /dev/null
@@ -1,15 +0,0 @@ 
-#include <math.h>
-#include <math_private.h>
-#include <stdio.h>
-#include <errno.h>
-
-int
-__kernel_rem_pio2l (long double *x, long double *y, int e0, int nx, int prec,
-		    const int *ipio2)
-{
-  fputs ("__kernel_rem_pio2l not implemented\n", stderr);
-  __set_errno (ENOSYS);
-  return 0.0;
-}
-
-stub_warning (__kernel_rem_pio2l)