]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
m68k: Avoid include e_fmod.c on fmod/remainder implementation
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 8 Oct 2025 13:55:04 +0000 (10:55 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 30 Oct 2025 18:41:12 +0000 (15:41 -0300)
And open-code each implementation.  It simplifies SVID error handling
removal.

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
sysdeps/m68k/m680x0/fpu/e_fmodl.c
sysdeps/m68k/m680x0/fpu/e_remainder.c
sysdeps/m68k/m680x0/fpu/e_remainderf.c
sysdeps/m68k/m680x0/fpu/e_remainderl.c

index 8f1cbabda636b4b4847025fa4f1a526d7007c08c..48d4cefc6fa904bedd76c34c67afe931937364ef 100644 (file)
@@ -1,6 +1,28 @@
-#ifndef FUNC
-# define FUNC __ieee754_fmodl
-# define FUNC_FINITE __fmodl
-#endif
-#define float_type long double
-#include <e_fmod.c>
+/* Fmod function, m68k double version.
+   Copyright (C) 1996-2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <libm-alias-finite.h>
+#include "mathimpl.h"
+
+long double
+__ieee754_fmodl (long double x, long double y)
+{
+  return __m81_u(__ieee754_fmodl)(x, y);
+}
+libm_alias_finite (__ieee754_fmodl, __fmodl)
index cc1422c48b393f5625c423a7b9f0e60cf568b192..d9d383840f5eb5e39fe98071c76309e50bd106ae 100644 (file)
@@ -1,3 +1,28 @@
-#define FUNC __ieee754_remainder
-#define FUNC_FINITE __remainder
-#include <e_fmod.c>
+/* Remainder function, m68k double version.
+   Copyright (C) 1996-2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <libm-alias-finite.h>
+#include "mathimpl.h"
+
+double
+__ieee754_remainder (double x, double y)
+{
+  return __m81_u(__ieee754_remainder)(x, y);
+}
+libm_alias_finite (__ieee754_remainder, __remainder)
index beacf65636f0da931f1ef6da8d77151bc0f86ffe..2c1e4f67746c7d002598be952805e3a7fb66d788 100644 (file)
@@ -1,4 +1,29 @@
-#define FUNC __ieee754_remainderf
-#define FUNC_FINITE __remainderf
-#define float_type float
-#include <e_fmod.c>
+/* Remainder function, m68k float version.
+   Copyright (C) 1996-2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+
+#include <math.h>
+#include <libm-alias-finite.h>
+#include "mathimpl.h"
+
+float
+__ieee754_remainderf (float x, float y)
+{
+  return __m81_u(__ieee754_remainderf)(x, y);
+}
+libm_alias_finite (__ieee754_remainderf, __remainderf)
index ce3490a5ec7aad1ad9cd43aa2e76a62fe9993bb4..f2277b25b5632025e7b1e902bc8837fb0f4a6029 100644 (file)
@@ -1,3 +1,29 @@
-#define FUNC __ieee754_remainderl
-#define FUNC_FINITE __remainderl
-#include <e_fmodl.c>
+/* Remainder function, m68k long double version.
+   Copyright (C) 1996-2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+
+#include <math.h>
+#include <libm-alias-finite.h>
+#include "mathimpl.h"
+
+long double
+__ieee754_remainderl (long double x, long double y)
+{
+  return __m81_u(__ieee754_remainderl)(x, y);
+}
+libm_alias_finite (__ieee754_remainderl, __remainderl)