summaryrefslogtreecommitdiff
path: root/sysdeps/m68k
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:16:25 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:16:25 +0000
commit8d59503b977070aaa4e504e8d6dcb7da3711893e (patch)
tree8272c9c2cce43afa4fe4d8d92c269a6435242661 /sysdeps/m68k
parent76a7dc16fab8853ef9230447fa98c70a3619dc6d (diff)
parentbcea9593527d90b9f9ff3817e3fbf0fbc3d01fa7 (diff)
Merge commit 'refs/top-bases/t/gsync-libc-merge' into t/gsync-libc-merge
Diffstat (limited to 'sysdeps/m68k')
-rw-r--r--sysdeps/m68k/Makefile19
-rw-r--r--sysdeps/m68k/__longjmp.c2
-rw-r--r--sysdeps/m68k/asm-syntax.h2
-rw-r--r--sysdeps/m68k/backtrace.c2
-rw-r--r--sysdeps/m68k/bits/byteswap.h88
-rw-r--r--sysdeps/m68k/bits/fenv.h (renamed from sysdeps/m68k/fpu/bits/fenv.h)68
-rw-r--r--sysdeps/m68k/bits/link.h2
-rw-r--r--sysdeps/m68k/bits/setjmp.h2
-rw-r--r--sysdeps/m68k/bsd-_setjmp.c2
-rw-r--r--sysdeps/m68k/bsd-setjmp.c2
-rw-r--r--sysdeps/m68k/coldfire/atomic-machine.h5
-rw-r--r--sysdeps/m68k/coldfire/fpu/e_sqrt.c2
-rw-r--r--sysdeps/m68k/coldfire/fpu/e_sqrtf.c2
-rw-r--r--sysdeps/m68k/coldfire/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/m68k/coldfire/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_fabs.c10
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_fabsf.c6
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_lrint.c10
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_lrintf.c6
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_rint.c10
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_rintf.c6
-rw-r--r--sysdeps/m68k/coldfire/ldbl-classify-compat.h (renamed from sysdeps/m68k/coldfire/fpu/math_private.h)6
-rw-r--r--sysdeps/m68k/coldfire/math-tests.h29
-rw-r--r--sysdeps/m68k/coldfire/nofpu/Implies1
-rw-r--r--sysdeps/m68k/coldfire/nofpu/s_fma.c1
-rw-r--r--sysdeps/m68k/coldfire/nofpu/s_fmaf.c1
-rw-r--r--sysdeps/m68k/coldfire/sysdep.h2
-rw-r--r--sysdeps/m68k/crti.S4
-rw-r--r--sysdeps/m68k/crtn.S2
-rw-r--r--sysdeps/m68k/dl-machine.h11
-rw-r--r--sysdeps/m68k/dl-tls.h5
-rw-r--r--sysdeps/m68k/dl-trampoline.S2
-rw-r--r--sysdeps/m68k/ffs.c2
-rw-r--r--sysdeps/m68k/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/m68k/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/m68k/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/m68k/fpu/fegetenv.c2
-rw-r--r--sysdeps/m68k/fpu/fegetexcept.c2
-rw-r--r--sysdeps/m68k/fpu/fegetmode.c27
-rw-r--r--sysdeps/m68k/fpu/fegetround.c2
-rw-r--r--sysdeps/m68k/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/m68k/fpu/fesetenv.c2
-rw-r--r--sysdeps/m68k/fpu/fesetexcept.c31
-rw-r--r--sysdeps/m68k/fpu/fesetmode.c32
-rw-r--r--sysdeps/m68k/fpu/fesetround.c2
-rw-r--r--sysdeps/m68k/fpu/feupdateenv.c2
-rw-r--r--sysdeps/m68k/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/m68k/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/m68k/fpu/ftestexcept.c2
-rw-r--r--sysdeps/m68k/fpu_control.h2
-rw-r--r--sysdeps/m68k/gccframe.h2
-rw-r--r--sysdeps/m68k/jmpbuf-unwind.h2
-rw-r--r--sysdeps/m68k/ldsodefs.h2
-rw-r--r--sysdeps/m68k/libc-tls.c2
-rw-r--r--sysdeps/m68k/m680x0/add_n.S2
-rw-r--r--sysdeps/m68k/m680x0/bits/flt-eval-method.h25
-rw-r--r--sysdeps/m68k/m680x0/bits/fp-logb.h24
-rw-r--r--sysdeps/m68k/m680x0/bits/huge_vall.h41
-rw-r--r--sysdeps/m68k/m680x0/bits/mathdef.h37
-rw-r--r--sysdeps/m68k/m680x0/fpu/bits/mathinline.h257
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_acos.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_atan2.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_exp2f_data.c (renamed from sysdeps/m68k/m680x0/fpu/halfulp.c)0
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_fmod.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_ilogb.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_log2f_data.c (renamed from sysdeps/m68k/m680x0/fpu/mpexp.c)0
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_logf_data.c (renamed from sysdeps/m68k/m680x0/fpu/mplog.c)0
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_pow.c6
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c (renamed from sysdeps/m68k/m680x0/fpu/slowexp.c)0
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_scalb.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/libm-test-ulps8
-rw-r--r--sysdeps/m68k/m680x0/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/m68k/m680x0/fpu/math-barriers.h37
-rw-r--r--sysdeps/m68k/m680x0/fpu/math_errf.c (renamed from sysdeps/m68k/m680x0/fpu/slowpow.c)0
-rw-r--r--sysdeps/m68k/m680x0/fpu/math_private.h20
-rw-r--r--sysdeps/m68k/m680x0/fpu/mathimpl.h38
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atan.c36
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atan_template.c (renamed from sysdeps/m68k/m680x0/m68020/bits/string.h)16
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atanf.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atanl.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccosh_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_ccosh.c)22
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccoshf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccoshl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ceil.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ceil_template.c (renamed from sysdeps/m68k/nptl/pthread_spin_lock.c)16
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ceilf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ceill.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexp_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_cexp.c)19
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexpf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexpl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cos.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cos_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cosf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cosl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csin_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_csin.c)22
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinh_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_csinh.c)21
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinhf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinhl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_expm1.c29
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_expm1_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_expm1f.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_expm1l.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabs.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabs_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabsf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabsl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floor.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floor_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floorf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floorl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexp.c55
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexp_template.c45
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexpf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexpl.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_isinf.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_llrint.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_llrintf.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_llrintl.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_log1p.c38
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_log1pf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_log1pl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrint.c39
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrint_template.c28
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrintf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrintl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modf.c55
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modf_template.c (renamed from sysdeps/m68k/coldfire/fpu/bits/mathinline.h)49
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modff.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modfl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyint.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyintf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyintl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nextafterl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquo.c48
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquo_template.c36
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquof.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquol.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rint.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rint_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rintf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rintl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_scalbn.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_significand.c23
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_significandf.c6
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_significandl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sin.c40
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sin_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincos.c36
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincos_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincosf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincosl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sinf.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sinl.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tan.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tan_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanh.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanh_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanhf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanhl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_trunc.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_trunc_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_truncf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_truncl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_exp2f.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_expf.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_log2f.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_logf.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_powf.c1
-rw-r--r--sysdeps/m68k/m680x0/lshift.S2
-rw-r--r--sysdeps/m68k/m680x0/m68020/addmul_1.S2
-rw-r--r--sysdeps/m68k/m680x0/m68020/atomic-machine.h19
-rw-r--r--sysdeps/m68k/m680x0/m68020/mul_1.S2
-rw-r--r--sysdeps/m68k/m680x0/m68020/string_private.h2
-rw-r--r--sysdeps/m68k/m680x0/m68020/submul_1.S2
-rw-r--r--sysdeps/m68k/m680x0/rshift.S2
-rw-r--r--sysdeps/m68k/m680x0/sub_n.S2
-rw-r--r--sysdeps/m68k/m680x0/sysdep.h2
-rw-r--r--sysdeps/m68k/memchr.S2
-rw-r--r--sysdeps/m68k/memcopy.h2
-rw-r--r--sysdeps/m68k/memusage.h2
-rw-r--r--sysdeps/m68k/nptl/Makefile2
-rw-r--r--sysdeps/m68k/nptl/bits/pthreadtypes-arch.h63
-rw-r--r--sysdeps/m68k/nptl/bits/pthreadtypes.h180
-rw-r--r--sysdeps/m68k/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/m68k/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/m68k/nptl/pthreaddef.h2
-rw-r--r--sysdeps/m68k/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/m68k/nptl/tls.h15
-rw-r--r--sysdeps/m68k/preconfigure6
-rw-r--r--sysdeps/m68k/rawmemchr.S2
-rw-r--r--sysdeps/m68k/setjmp.c2
-rw-r--r--sysdeps/m68k/sotruss-lib.c2
-rw-r--r--sysdeps/m68k/stackinfo.h2
-rw-r--r--sysdeps/m68k/start.S4
-rw-r--r--sysdeps/m68k/strchr.S2
-rw-r--r--sysdeps/m68k/strchrnul.S2
-rw-r--r--sysdeps/m68k/symbol-hacks.h21
-rw-r--r--sysdeps/m68k/sys/ucontext.h82
-rw-r--r--sysdeps/m68k/sysdep.h2
-rw-r--r--sysdeps/m68k/tls-macros.h2
-rw-r--r--sysdeps/m68k/tst-audit.h2
-rw-r--r--sysdeps/m68k/wcpcpy.c2
-rw-r--r--sysdeps/m68k/wcpcpy_chk.c2
211 files changed, 1336 insertions, 1311 deletions
diff --git a/sysdeps/m68k/Makefile b/sysdeps/m68k/Makefile
index 37a2f2de82..ac0aa0fd47 100644
--- a/sysdeps/m68k/Makefile
+++ b/sysdeps/m68k/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2016 Free Software Foundation, Inc.
+# Copyright (C) 1993-2018 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
@@ -26,15 +26,24 @@ asm-CPPFLAGS += $(m68k-syntax-flag)
pic-ccflag = -fpic
+ifeq ($(subdir),csu)
+# Make sure gcrt1.o uses the large PIC model
+CFLAGS-gmon-start.c := -fPIC
+ifeq ($(build-pie-default),yes)
+# Override default PIE
+ASFLAGS-.o += -fno-pie
+endif
+endif
+
ifeq ($(subdir),setjmp)
# Make sure setjmp.c is compiled with a frame pointer
CFLAGS-setjmp.c := -fno-omit-frame-pointer
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
endif
+
+ifeq ($(subdir),gmon)
+CFLAGS-mcount.c += -Wno-frame-address
+endif
diff --git a/sysdeps/m68k/__longjmp.c b/sysdeps/m68k/__longjmp.c
index db620f8994..9f8998e584 100644
--- a/sysdeps/m68k/__longjmp.c
+++ b/sysdeps/m68k/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 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
diff --git a/sysdeps/m68k/asm-syntax.h b/sysdeps/m68k/asm-syntax.h
index 6be0fec5ae..c347b07431 100644
--- a/sysdeps/m68k/asm-syntax.h
+++ b/sysdeps/m68k/asm-syntax.h
@@ -1,5 +1,5 @@
/* Definitions for 68k syntax variations.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in the GNU MP Library.
diff --git a/sysdeps/m68k/backtrace.c b/sysdeps/m68k/backtrace.c
index 7789d08ef6..9e13e245db 100644
--- a/sysdeps/m68k/backtrace.c
+++ b/sysdeps/m68k/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/m68k/bits/byteswap.h b/sysdeps/m68k/bits/byteswap.h
deleted file mode 100644
index ce7c4987bc..0000000000
--- a/sysdeps/m68k/bits/byteswap.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Macros to swap the order of bytes in integer values. m68k version.
- Copyright (C) 1997-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
-# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
-#endif
-
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
-
-/* Swap bytes in 16 bit value. We don't provide an assembler version
- because GCC is smart enough to generate optimal assembler output, and
- this allows for better cse. */
-#define __bswap_constant_16(x) \
- ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
-
-static __always_inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-
-/* Swap bytes in 32 bit value. */
-#define __bswap_constant_32(x) \
- ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
- (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
-
-#if !defined(__mcoldfire__)
-static __always_inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- if (__builtin_constant_p (__bsx))
- return __bswap_constant_32 (__bsx);
- __asm__ __volatile__ ("ror%.w %#8, %0;"
- "swap %0;"
- "ror%.w %#8, %0"
- : "+d" (__bsx));
- return __bsx;
-}
-#else
-static __always_inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- return __bswap_constant_32 (__bsx);
-}
-#endif
-
-#if defined __GNUC__ && __GNUC__ >= 2
-/* Swap bytes in 64 bit value. */
-# define __bswap_constant_64(x) \
- __extension__ \
- ((((x) & 0xff00000000000000ull) >> 56) \
- | (((x) & 0x00ff000000000000ull) >> 40) \
- | (((x) & 0x0000ff0000000000ull) >> 24) \
- | (((x) & 0x000000ff00000000ull) >> 8) \
- | (((x) & 0x00000000ff000000ull) << 8) \
- | (((x) & 0x0000000000ff0000ull) << 24) \
- | (((x) & 0x000000000000ff00ull) << 40) \
- | (((x) & 0x00000000000000ffull) << 56))
-
-/* Swap bytes in 64 bit value. */
-__extension__
-static __always_inline unsigned long long
-__bswap_64 (unsigned long long __bsx)
-{
- if (__builtin_constant_p (__bsx))
- return __bswap_constant_64 (__bsx);
- return (__bswap_32 (__bsx >> 32)
- | ((unsigned long long) __bswap_32 (__bsx) << 32));
-}
-#endif
-
-#endif /* _BITS_BYTESWAP_H */
diff --git a/sysdeps/m68k/fpu/bits/fenv.h b/sysdeps/m68k/bits/fenv.h
index 2228861624..7050ceff24 100644
--- a/sysdeps/m68k/fpu/bits/fenv.h
+++ b/sysdeps/m68k/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 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
@@ -20,28 +20,30 @@
#endif
+#if defined __HAVE_68881__ || defined __HAVE_FPU__ || defined __mcffpu__
+
/* Define bits representing the exception. We use the bit positions of
the appropriate bits in the FPSR Accrued Exception Byte. */
enum
{
FE_INEXACT =
-#define FE_INEXACT (1 << 3)
+# define FE_INEXACT (1 << 3)
FE_INEXACT,
FE_DIVBYZERO =
-#define FE_DIVBYZERO (1 << 4)
+# define FE_DIVBYZERO (1 << 4)
FE_DIVBYZERO,
FE_UNDERFLOW =
-#define FE_UNDERFLOW (1 << 5)
+# define FE_UNDERFLOW (1 << 5)
FE_UNDERFLOW,
FE_OVERFLOW =
-#define FE_OVERFLOW (1 << 6)
+# define FE_OVERFLOW (1 << 6)
FE_OVERFLOW,
FE_INVALID =
-#define FE_INVALID (1 << 7)
+# define FE_INVALID (1 << 7)
FE_INVALID
};
-#define FE_ALL_EXCEPT \
+# define FE_ALL_EXCEPT \
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
/* The m68k FPU supports all of the four defined rounding modes. We use
@@ -50,24 +52,44 @@ enum
enum
{
FE_TONEAREST =
-#define FE_TONEAREST 0
+# define FE_TONEAREST 0
FE_TONEAREST,
FE_TOWARDZERO =
-#define FE_TOWARDZERO (1 << 4)
+# define FE_TOWARDZERO (1 << 4)
FE_TOWARDZERO,
FE_DOWNWARD =
-#define FE_DOWNWARD (2 << 4)
+# define FE_DOWNWARD (2 << 4)
FE_DOWNWARD,
FE_UPWARD =
-#define FE_UPWARD (3 << 4)
+# define FE_UPWARD (3 << 4)
FE_UPWARD
};
+#else
+
+/* In the soft-float case, only rounding to nearest is supported, with
+ no exceptions. */
+
+# define FE_ALL_EXCEPT 0
+
+enum
+ {
+ __FE_UNDEFINED = -1,
+
+ FE_TONEAREST =
+# define FE_TONEAREST 0
+ FE_TONEAREST
+ };
+
+#endif
+
/* Type representing exception flags. */
typedef unsigned int fexcept_t;
+#if defined __HAVE_68881__ || defined __HAVE_FPU__ || defined __mcffpu__
+
/* Type representing floating-point environment. This structure
corresponds to the layout of the block written by `fmovem'. */
typedef struct
@@ -78,10 +100,32 @@ typedef struct
}
fenv_t;
+#else
+
+/* Keep ABI compatibility with the type used in the generic
+ bits/fenv.h, formerly used for no-FPU ColdFire. */
+typedef struct
+ {
+ fexcept_t __excepts;
+ }
+fenv_t;
+
+#endif
+
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1)
-#ifdef __USE_GNU
+#if defined __USE_GNU && (defined __HAVE_68881__ \
+ || defined __HAVE_FPU__ \
+ || defined __mcffpu__)
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/m68k/bits/link.h b/sysdeps/m68k/bits/link.h
index 69b8b838f9..c88ce6bd33 100644
--- a/sysdeps/m68k/bits/link.h
+++ b/sysdeps/m68k/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 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
diff --git a/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h
index 55568b5117..9a7826c5e8 100644
--- a/sysdeps/m68k/bits/setjmp.h
+++ b/sysdeps/m68k/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 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
diff --git a/sysdeps/m68k/bsd-_setjmp.c b/sysdeps/m68k/bsd-_setjmp.c
index 20f4ceaf9d..369d894059 100644
--- a/sysdeps/m68k/bsd-_setjmp.c
+++ b/sysdeps/m68k/bsd-_setjmp.c
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. m68k version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 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
diff --git a/sysdeps/m68k/bsd-setjmp.c b/sysdeps/m68k/bsd-setjmp.c
index 3f6dee8a91..53e51b7cfa 100644
--- a/sysdeps/m68k/bsd-setjmp.c
+++ b/sysdeps/m68k/bsd-setjmp.c
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. m68k version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 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
diff --git a/sysdeps/m68k/coldfire/atomic-machine.h b/sysdeps/m68k/coldfire/atomic-machine.h
index 140dd022f8..3ef9859f88 100644
--- a/sysdeps/m68k/coldfire/atomic-machine.h
+++ b/sysdeps/m68k/coldfire/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 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
@@ -53,6 +53,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
/* The only basic operation needed is compare and exchange. */
#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
({ __typeof (mem) __gmemp = (mem); \
diff --git a/sysdeps/m68k/coldfire/fpu/e_sqrt.c b/sysdeps/m68k/coldfire/fpu/e_sqrt.c
index ba59df60c0..3d51589eae 100644
--- a/sysdeps/m68k/coldfire/fpu/e_sqrt.c
+++ b/sysdeps/m68k/coldfire/fpu/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
diff --git a/sysdeps/m68k/coldfire/fpu/e_sqrtf.c b/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
index 5a48aef25c..80636da591 100644
--- a/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
+++ b/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
diff --git a/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c b/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c
index 3774890424..8474542cfe 100644
--- a/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c
+++ b/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 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
diff --git a/sysdeps/m68k/coldfire/fpu/libm-test-ulps-name b/sysdeps/m68k/coldfire/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..d0b67ea9eb
--- /dev/null
+++ b/sysdeps/m68k/coldfire/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+ColdFire
diff --git a/sysdeps/m68k/coldfire/fpu/s_fabs.c b/sysdeps/m68k/coldfire/fpu/s_fabs.c
index a20d41ef14..50e1cfe40c 100644
--- a/sysdeps/m68k/coldfire/fpu/s_fabs.c
+++ b/sysdeps/m68k/coldfire/fpu/s_fabs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
@@ -15,14 +15,12 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-double.h>
+
double
__fabs (double x)
{
asm ("fdabs.d %1,%0" : "=f" (x) : "fm" (x));
return x;
}
-weak_alias (__fabs, fabs)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fabs, __fabsl)
-weak_alias (__fabs, fabsl)
-#endif
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/m68k/coldfire/fpu/s_fabsf.c b/sysdeps/m68k/coldfire/fpu/s_fabsf.c
index 4287bebcaf..9b37d69782 100644
--- a/sysdeps/m68k/coldfire/fpu/s_fabsf.c
+++ b/sysdeps/m68k/coldfire/fpu/s_fabsf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
@@ -15,10 +15,12 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-float.h>
+
float
__fabsf (float x)
{
asm ("fsabs.s %1,%0" : "=f" (x) : "dm" (x));
return x;
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/m68k/coldfire/fpu/s_lrint.c b/sysdeps/m68k/coldfire/fpu/s_lrint.c
index e404b42194..2a0a4b8f56 100644
--- a/sysdeps/m68k/coldfire/fpu/s_lrint.c
+++ b/sysdeps/m68k/coldfire/fpu/s_lrint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
@@ -15,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-double.h>
+
long int
__lrint (double x)
{
@@ -22,8 +24,4 @@ __lrint (double x)
asm ("fmove.l %1,%0" : "=dm" (result) : "f" (x));
return result;
}
-weak_alias (__lrint, lrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/m68k/coldfire/fpu/s_lrintf.c b/sysdeps/m68k/coldfire/fpu/s_lrintf.c
index e58a48c634..66f951c9f5 100644
--- a/sysdeps/m68k/coldfire/fpu/s_lrintf.c
+++ b/sysdeps/m68k/coldfire/fpu/s_lrintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
@@ -15,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-float.h>
+
long int
__lrintf (float x)
{
@@ -22,4 +24,4 @@ __lrintf (float x)
asm ("fmove.l %1,%0" : "=dm" (result) : "f" (x));
return result;
}
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/m68k/coldfire/fpu/s_rint.c b/sysdeps/m68k/coldfire/fpu/s_rint.c
index e7047bfb4a..a5bc4ad223 100644
--- a/sysdeps/m68k/coldfire/fpu/s_rint.c
+++ b/sysdeps/m68k/coldfire/fpu/s_rint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
@@ -15,14 +15,12 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-double.h>
+
double
__rint (double x)
{
asm ("fint.d %1,%0" : "=f" (x) : "fm" (x));
return x;
}
-weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/m68k/coldfire/fpu/s_rintf.c b/sysdeps/m68k/coldfire/fpu/s_rintf.c
index 07d989332e..d68a3fda4d 100644
--- a/sysdeps/m68k/coldfire/fpu/s_rintf.c
+++ b/sysdeps/m68k/coldfire/fpu/s_rintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 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
@@ -15,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-float.h>
+
float
__rintf (float x)
{
@@ -22,4 +24,4 @@ __rintf (float x)
asm ("fint.s %1,%0" : "=f" (result) : "dm" (x));
return (float) result;
}
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/m68k/coldfire/fpu/math_private.h b/sysdeps/m68k/coldfire/ldbl-classify-compat.h
index d306a508b4..c1ec4d4ffa 100644
--- a/sysdeps/m68k/coldfire/fpu/math_private.h
+++ b/sysdeps/m68k/coldfire/ldbl-classify-compat.h
@@ -1,10 +1,8 @@
-#ifndef COLDFIRE_MATH_PRIVATE_H
-#define COLDFIRE_MATH_PRIVATE_H 1
+#ifndef COLDFIRE_LDBL_CLASSIFY_COMPAT_H
+#define COLDFIRE_LDBL_CLASSIFY_COMPAT_H 1
/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
when built without long double support. */
#define LDBL_CLASSIFY_COMPAT 1
-#include_next <math_private.h>
-
#endif
diff --git a/sysdeps/m68k/coldfire/math-tests.h b/sysdeps/m68k/coldfire/math-tests.h
new file mode 100644
index 0000000000..b05609d45d
--- /dev/null
+++ b/sysdeps/m68k/coldfire/math-tests.h
@@ -0,0 +1,29 @@
+/* Configuration for math tests. ColdFire version.
+ Copyright (C) 2018 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
+ <http://www.gnu.org/licenses/>. */
+
+/* ColdFire soft float does not support exceptions and rounding modes. */
+#ifndef __mcffpu__
+# define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_long_double(MODE) ((MODE) == FE_TONEAREST)
+# define EXCEPTION_TESTS_float 0
+# define EXCEPTION_TESTS_double 0
+# define EXCEPTION_TESTS_long_double 0
+#endif
+
+#include_next <math-tests.h>
diff --git a/sysdeps/m68k/coldfire/nofpu/Implies b/sysdeps/m68k/coldfire/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/m68k/coldfire/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/m68k/coldfire/nofpu/s_fma.c b/sysdeps/m68k/coldfire/nofpu/s_fma.c
deleted file mode 100644
index d9613fa67c..0000000000
--- a/sysdeps/m68k/coldfire/nofpu/s_fma.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmadf4.c>
diff --git a/sysdeps/m68k/coldfire/nofpu/s_fmaf.c b/sysdeps/m68k/coldfire/nofpu/s_fmaf.c
deleted file mode 100644
index aa5c9b2d91..0000000000
--- a/sysdeps/m68k/coldfire/nofpu/s_fmaf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmasf4.c>
diff --git a/sysdeps/m68k/coldfire/sysdep.h b/sysdeps/m68k/coldfire/sysdep.h
index ce2dcbf784..7eab5047ab 100644
--- a/sysdeps/m68k/coldfire/sysdep.h
+++ b/sysdeps/m68k/coldfire/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for Coldfire.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 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
diff --git a/sysdeps/m68k/crti.S b/sysdeps/m68k/crti.S
index 47f5a958a0..e5f2157cd6 100644
--- a/sysdeps/m68k/crti.S
+++ b/sysdeps/m68k/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for m68k.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
@@ -58,6 +58,7 @@
.section .init,"ax",@progbits
.align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
link.w %fp, #0
@@ -75,6 +76,7 @@ _init:
.section .fini,"ax",@progbits
.align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
link.w %fp, #0
diff --git a/sysdeps/m68k/crtn.S b/sysdeps/m68k/crtn.S
index cf16c30c59..a1dbf67e22 100644
--- a/sysdeps/m68k/crtn.S
+++ b/sysdeps/m68k/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for m68k.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h
index 41c179c3f1..8eb2295deb 100644
--- a/sysdeps/m68k/dl-machine.h
+++ b/sysdeps/m68k/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 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
@@ -51,9 +51,15 @@ static inline Elf32_Addr
elf_machine_load_address (void)
{
Elf32_Addr addr;
+#ifdef SHARED
asm (PCREL_OP ("lea", "_dl_start", "%0", "%0", "%%pc") "\n\t"
"sub.l _dl_start@GOT.w(%%a5), %0"
: "=a" (addr));
+#else
+ asm (PCREL_OP ("lea", "_dl_relocate_static_pie", "%0", "%0", "%%pc") "\n\t"
+ "sub.l _dl_relocate_static_pie@GOT.w(%%a5), %0"
+ : "=a" (addr));
+#endif
return addr;
}
@@ -182,6 +188,7 @@ _dl_start_user:\n\
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -222,7 +229,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
{
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
switch (r_type)
{
diff --git a/sysdeps/m68k/dl-tls.h b/sysdeps/m68k/dl-tls.h
index f853b99874..20d7d0d333 100644
--- a/sysdeps/m68k/dl-tls.h
+++ b/sysdeps/m68k/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. M68K version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
@@ -45,6 +45,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/m68k/dl-trampoline.S b/sysdeps/m68k/dl-trampoline.S
index 46e56e5555..7e1eace26b 100644
--- a/sysdeps/m68k/dl-trampoline.S
+++ b/sysdeps/m68k/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. m68k version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 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
diff --git a/sysdeps/m68k/ffs.c b/sysdeps/m68k/ffs.c
index e284315a93..cbee8c201d 100644
--- a/sysdeps/m68k/ffs.c
+++ b/sysdeps/m68k/ffs.c
@@ -1,7 +1,7 @@
/* ffs -- find first set bit in a word, counted from least significant end.
For mc68020, mc68030, mc68040.
This file is part of the GNU C Library.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Torbjorn Granlund (tege@sics.se).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/fpu/fclrexcpt.c b/sysdeps/m68k/fpu/fclrexcpt.c
index 7248cbbf82..b3bf9b760b 100644
--- a/sysdeps/m68k/fpu/fclrexcpt.c
+++ b/sysdeps/m68k/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fedisblxcpt.c b/sysdeps/m68k/fpu/fedisblxcpt.c
index 19d1668820..0e62cd47c2 100644
--- a/sysdeps/m68k/fpu/fedisblxcpt.c
+++ b/sysdeps/m68k/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2000.
diff --git a/sysdeps/m68k/fpu/feenablxcpt.c b/sysdeps/m68k/fpu/feenablxcpt.c
index cdb395d962..a67c4ac6fd 100644
--- a/sysdeps/m68k/fpu/feenablxcpt.c
+++ b/sysdeps/m68k/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2000.
diff --git a/sysdeps/m68k/fpu/fegetenv.c b/sysdeps/m68k/fpu/fegetenv.c
index 04ee8ebbd2..4f5774191e 100644
--- a/sysdeps/m68k/fpu/fegetenv.c
+++ b/sysdeps/m68k/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fegetexcept.c b/sysdeps/m68k/fpu/fegetexcept.c
index 65a1c1b32a..2167fb689d 100644
--- a/sysdeps/m68k/fpu/fegetexcept.c
+++ b/sysdeps/m68k/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2000.
diff --git a/sysdeps/m68k/fpu/fegetmode.c b/sysdeps/m68k/fpu/fegetmode.c
new file mode 100644
index 0000000000..fb5a4cdba9
--- /dev/null
+++ b/sysdeps/m68k/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. M68K version.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/sysdeps/m68k/fpu/fegetround.c b/sysdeps/m68k/fpu/fegetround.c
index 724246f016..5dd18b2ba7 100644
--- a/sysdeps/m68k/fpu/fegetround.c
+++ b/sysdeps/m68k/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/feholdexcpt.c b/sysdeps/m68k/fpu/feholdexcpt.c
index ff00e2f9b7..b47724a2e0 100644
--- a/sysdeps/m68k/fpu/feholdexcpt.c
+++ b/sysdeps/m68k/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fesetenv.c b/sysdeps/m68k/fpu/fesetenv.c
index 59189906a3..ab7b3e25ce 100644
--- a/sysdeps/m68k/fpu/fesetenv.c
+++ b/sysdeps/m68k/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fesetexcept.c b/sysdeps/m68k/fpu/fesetexcept.c
new file mode 100644
index 0000000000..0906e526be
--- /dev/null
+++ b/sysdeps/m68k/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. M68K version.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fesetexcept (int excepts)
+{
+ fexcept_t fpsr;
+
+ __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr));
+ fpsr |= excepts & FE_ALL_EXCEPT;
+ __asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr));
+
+ return 0;
+}
diff --git a/sysdeps/m68k/fpu/fesetmode.c b/sysdeps/m68k/fpu/fesetmode.c
new file mode 100644
index 0000000000..3569fd08ca
--- /dev/null
+++ b/sysdeps/m68k/fpu/fesetmode.c
@@ -0,0 +1,32 @@
+/* Install given floating-point control modes. M68K version.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+ femode_t mode;
+ if (modep == FE_DFL_MODE)
+ mode = _FPU_DEFAULT;
+ else
+ mode = *modep;
+ _FPU_SETCW (mode);
+ return 0;
+}
diff --git a/sysdeps/m68k/fpu/fesetround.c b/sysdeps/m68k/fpu/fesetround.c
index a1ea0d074e..e2b0c4a98a 100644
--- a/sysdeps/m68k/fpu/fesetround.c
+++ b/sysdeps/m68k/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/feupdateenv.c b/sysdeps/m68k/fpu/feupdateenv.c
index 077f6ad3aa..ee351a2f86 100644
--- a/sysdeps/m68k/fpu/feupdateenv.c
+++ b/sysdeps/m68k/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fgetexcptflg.c b/sysdeps/m68k/fpu/fgetexcptflg.c
index 0783381466..87c29a3b89 100644
--- a/sysdeps/m68k/fpu/fgetexcptflg.c
+++ b/sysdeps/m68k/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fsetexcptflg.c b/sysdeps/m68k/fpu/fsetexcptflg.c
index f51a129c92..1f2a5e4104 100644
--- a/sysdeps/m68k/fpu/fsetexcptflg.c
+++ b/sysdeps/m68k/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/ftestexcept.c b/sysdeps/m68k/fpu/ftestexcept.c
index e61f0cb0cb..cb7f063873 100644
--- a/sysdeps/m68k/fpu/ftestexcept.c
+++ b/sysdeps/m68k/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu_control.h b/sysdeps/m68k/fpu_control.h
index e443f2cdf8..db8b0c9c17 100644
--- a/sysdeps/m68k/fpu_control.h
+++ b/sysdeps/m68k/fpu_control.h
@@ -1,5 +1,5 @@
/* 68k FPU control word definitions.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 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
diff --git a/sysdeps/m68k/gccframe.h b/sysdeps/m68k/gccframe.h
index 634f021c46..c28db6c6ed 100644
--- a/sysdeps/m68k/gccframe.h
+++ b/sysdeps/m68k/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. m68k version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 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
diff --git a/sysdeps/m68k/jmpbuf-unwind.h b/sysdeps/m68k/jmpbuf-unwind.h
index aed4a260b1..8d0f3ffe6e 100644
--- a/sysdeps/m68k/jmpbuf-unwind.h
+++ b/sysdeps/m68k/jmpbuf-unwind.h
@@ -1,5 +1,5 @@
/* Examine __jmp_buf for unwinding frames. m68k version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 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
diff --git a/sysdeps/m68k/ldsodefs.h b/sysdeps/m68k/ldsodefs.h
index 0b93325168..58509ba823 100644
--- a/sysdeps/m68k/ldsodefs.h
+++ b/sysdeps/m68k/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 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
diff --git a/sysdeps/m68k/libc-tls.c b/sysdeps/m68k/libc-tls.c
index 9c2d002a0c..6bf81e9b4e 100644
--- a/sysdeps/m68k/libc-tls.c
+++ b/sysdeps/m68k/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. m68k version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/m680x0/add_n.S b/sysdeps/m68k/m680x0/add_n.S
index fbca15fea8..5d61884c69 100644
--- a/sysdeps/m68k/m680x0/add_n.S
+++ b/sysdeps/m68k/m680x0/add_n.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_add_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/bits/flt-eval-method.h b/sysdeps/m68k/m680x0/bits/flt-eval-method.h
new file mode 100644
index 0000000000..8bcaf79a7b
--- /dev/null
+++ b/sysdeps/m68k/m680x0/bits/flt-eval-method.h
@@ -0,0 +1,25 @@
+/* Define __GLIBC_FLT_EVAL_METHOD. M68K version.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/flt-eval-method.h> directly; include <math.h> instead."
+#endif
+
+/* The m68k FPUs evaluate all values in the 96-bit floating-point
+ format which is also available for the user as 'long double'. */
+#define __GLIBC_FLT_EVAL_METHOD 2
diff --git a/sysdeps/m68k/m680x0/bits/fp-logb.h b/sysdeps/m68k/m680x0/bits/fp-logb.h
new file mode 100644
index 0000000000..ab2d11a0fe
--- /dev/null
+++ b/sysdeps/m68k/m680x0/bits/fp-logb.h
@@ -0,0 +1,24 @@
+/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. M68K version.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/fp-logb.h> directly; include <math.h> instead."
+#endif
+
+#define __FP_LOGB0_IS_MIN 1
+#define __FP_LOGBNAN_IS_MIN 0
diff --git a/sysdeps/m68k/m680x0/bits/huge_vall.h b/sysdeps/m68k/m680x0/bits/huge_vall.h
deleted file mode 100644
index 6fcca1801d..0000000000
--- a/sysdeps/m68k/m680x0/bits/huge_vall.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* `HUGE_VALL' constant for m68k (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALL (__builtin_huge_vall ())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VALL (__extension__ 0x1.0p32767L)
-#elif defined __GNUC__
-
-# define HUGE_VALL \
- (__extension__ \
- ((union { unsigned long __l[3]; long double __ld; }) \
- { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
-
-#else /* not GCC */
-
-static union { unsigned char __c[12]; long double __ld; } __huge_vall =
- { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } };
-# define HUGE_VALL (__huge_vall.__ld)
-
-#endif /* GCC 2.95. */
diff --git a/sysdeps/m68k/m680x0/bits/mathdef.h b/sysdeps/m68k/m680x0/bits/mathdef.h
deleted file mode 100644
index a5509384c4..0000000000
--- a/sysdeps/m68k/m680x0/bits/mathdef.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1997-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* The m68k FPUs evaluate all values in the 96 bit floating-point format
- which is also available for the user as `long double'. Therefore we
- define: */
-typedef long double float_t; /* `float' expressions are evaluated as
- `long double'. */
-typedef long double double_t; /* `double' expressions are evaluated as
- `long double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647 - 1)
-# define FP_ILOGBNAN (2147483647)
-
-#endif /* ISO C99 */
diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index df498eff56..fbe8d029df 100644
--- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Definitions of inline math functions implemented by the m68881/2.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 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
@@ -28,103 +28,28 @@
#ifdef __GNUC__
-#ifdef __USE_ISOC99
-/* GCC 3.1 and up have builtins that actually can be used. */
-# if !__GNUC_PREREQ (3,1)
-/* ISO C99 defines some macros to perform unordered comparisons. The
- m68k FPU supports this with special opcodes and we should use them.
- These must not be inline functions since we have to be able to handle
- all floating-point types. */
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-# define isgreater(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsogt %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define isgreaterequal(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsoge %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define isless(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsolt %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define islessequal(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsole %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define islessgreater(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsogl %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define isunordered(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsun %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-# endif /* GCC 3.1 */
-
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
- return __u.__i[0] < 0;
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __d; int __i[3]; } __u = { __d: __x };
- return __u.__i[0] < 0;
-}
-#endif
-
-
#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \
|| defined __LIBC_INTERNAL_MATH_INLINES
#ifdef __LIBC_INTERNAL_MATH_INLINES
/* This is used when defining the functions themselves. Define them with
__ names, and with `static inline' instead of `extern inline' so the
- bodies will always be used, never an external function call. */
+ bodies will always be used, never an external function call.
+ Note: GCC 6 objects to __attribute__ ((__leaf__)) on static functions. */
# define __m81_u(x) __CONCAT(__,x)
# define __m81_inline static __inline
+# define __m81_nth(fn) __NTHNL (fn)
#else
# define __m81_u(x) x
-# define __m81_inline __MATH_INLINE
+# define __m81_inline __MATH_INLINE
+# define __m81_nth(fn) __NTH (fn)
# define __M81_MATH_INLINES 1
#endif
-/* Define a const math function. */
-#define __m81_defun(rettype, func, args) \
- __m81_inline rettype __attribute__((__const__)) \
- __NTH (__m81_u(func) args)
+/* Define a math function. */
+#define __m81_defun(rettype, func, args, attrs) \
+ __m81_inline rettype attrs \
+ __m81_nth (__m81_u(func) args)
/* Define the three variants of a math function that has a direct
implementation in the m68k fpu. FUNC is the name for C (which will be
@@ -132,17 +57,17 @@ __NTH (__signbitl (long double __x))
is the name of the fpu operation (without leading f). */
#ifdef __USE_ISOC99
-# define __inline_mathop(func, op) \
- __inline_mathop1(double, func, op) \
- __inline_mathop1(float, __CONCAT(func,f), op) \
- __inline_mathop1(long double, __CONCAT(func,l), op)
+# define __inline_mathop(func, op, attrs) \
+ __inline_mathop1(double, func, op, attrs) \
+ __inline_mathop1(float, __CONCAT(func,f), op, attrs) \
+ __inline_mathop1(long double, __CONCAT(func,l), op, attrs)
#else
-# define __inline_mathop(func, op) \
- __inline_mathop1(double, func, op)
+# define __inline_mathop(func, op, attrs) \
+ __inline_mathop1(double, func, op, attrs)
#endif
-#define __inline_mathop1(float_type,func, op) \
- __m81_defun (float_type, func, (float_type __mathop_x)) \
+#define __inline_mathop1(float_type,func, op, attrs) \
+ __m81_defun (float_type, func, (float_type __mathop_x), attrs) \
{ \
float_type __result; \
__asm __volatile__ ("f" __STRING(op) "%.x %1, %0" \
@@ -150,53 +75,54 @@ __NTH (__signbitl (long double __x))
return __result; \
}
-__inline_mathop(__atan, atan)
-__inline_mathop(__cos, cos)
-__inline_mathop(__sin, sin)
-__inline_mathop(__tan, tan)
-__inline_mathop(__tanh, tanh)
-__inline_mathop(__fabs, abs)
+__inline_mathop(__atan, atan,)
+__inline_mathop(__cos, cos,)
+__inline_mathop(__sin, sin,)
+__inline_mathop(__tan, tan,)
+__inline_mathop(__tanh, tanh,)
+__inline_mathop(__fabs, abs, __attribute__ ((__const__)))
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-__inline_mathop(__rint, int)
-__inline_mathop(__expm1, etoxm1)
-__inline_mathop(__log1p, lognp1)
+__inline_mathop(__rint, int,)
+__inline_mathop(__expm1, etoxm1,)
+__inline_mathop(__log1p, lognp1,)
#endif
#ifdef __USE_MISC
-__inline_mathop(__significand, getman)
+__inline_mathop(__significand, getman,)
#endif
#ifdef __USE_ISOC99
-__inline_mathop(__trunc, intrz)
+__inline_mathop(__trunc, intrz, __attribute__ ((__const__)))
#endif
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-__inline_mathop(atan, atan)
-__inline_mathop(tanh, tanh)
+__inline_mathop(atan, atan,)
+__inline_mathop(tanh, tanh,)
# if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-__inline_mathop(rint, int)
-__inline_mathop(log1p, lognp1)
+__inline_mathop(rint, int,)
+__inline_mathop(log1p, lognp1,)
# endif
# ifdef __USE_MISC
-__inline_mathop(significand, getman)
+__inline_mathop(significand, getman,)
# endif
# ifdef __USE_ISOC99
-__inline_mathop(trunc, intrz)
+__inline_mathop(trunc, intrz, __attribute__ ((__const__)))
# endif
#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
/* This macro contains the definition for the rest of the inline
- functions, using FLOAT_TYPE as the domain type and S as the suffix
- for the function names. */
+ functions, using FLOAT_TYPE as the domain type and M as a macro
+ that adds the suffix for the function names. */
-#define __inline_functions(float_type, s) \
-__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
+#define __inline_functions(float_type, m) \
+__m81_defun (float_type, m(__floor), (float_type __x), \
+ __attribute__ ((__const__))) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -212,7 +138,8 @@ __m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
return __result; \
} \
\
-__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
+__m81_defun (float_type, m(__ceil), (float_type __x), \
+ __attribute__ ((__const__))) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -228,17 +155,21 @@ __m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
return __result; \
}
-__inline_functions(double,)
+#define __CONCAT_d(arg) arg
+#define __CONCAT_f(arg) arg ## f
+#define __CONCAT_l(arg) arg ## l
+__inline_functions(double, __CONCAT_d)
#ifdef __USE_ISOC99
-__inline_functions(float,f)
-__inline_functions(long double,l)
+__inline_functions(float, __CONCAT_f)
+__inline_functions(long double, __CONCAT_l)
#endif
#undef __inline_functions
#ifdef __USE_MISC
-# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
+# define __inline_functions(float_type, m) \
+__m81_defun (int, m(__isinf), (float_type __value), \
+ __attribute__ ((__const__))) \
{ \
/* There is no branch-condition for infinity, \
so we must extract and examine the condition codes manually. */ \
@@ -248,7 +179,8 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \
} \
\
-__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
+__m81_defun (int, m(__finite), (float_type __value), \
+ __attribute__ ((__const__))) \
{ \
/* There is no branch-condition for infinity, so we must extract and \
examine the condition codes manually. */ \
@@ -258,8 +190,8 @@ __m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
return (__fpsr & (3 << 24)) == 0; \
} \
\
-__m81_defun (float_type, __CONCAT(__scalbn,s), \
- (float_type __x, int __n)) \
+__m81_defun (float_type, m(__scalbn), \
+ (float_type __x, int __n),) \
{ \
float_type __result; \
__asm __volatile__ ("fscale%.l %1, %0" : "=f" (__result) \
@@ -267,17 +199,18 @@ __m81_defun (float_type, __CONCAT(__scalbn,s), \
return __result; \
}
-__inline_functions(double,)
-__inline_functions(float,f)
-__inline_functions(long double,l)
+__inline_functions(double, __CONCAT_d)
+__inline_functions(float, __CONCAT_f)
+__inline_functions(long double, __CONCAT_l)
# undef __inline_functions
#endif /* Use misc. */
#if defined __USE_MISC || defined __USE_XOPEN
-# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
+# define __inline_functions(float_type, m) \
+__m81_defun (int, m(__isnan), (float_type __value), \
+ __attribute__ ((__const__))) \
{ \
char __result; \
__asm ("ftst%.x %1\n" \
@@ -285,10 +218,10 @@ __m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
return __result; \
}
-__inline_functions(double,)
+__inline_functions(double, __CONCAT_d)
# ifdef __USE_MISC
-__inline_functions(float,f)
-__inline_functions(long double,l)
+__inline_functions(float, __CONCAT_f)
+__inline_functions(long double, __CONCAT_l)
# endif
# undef __inline_functions
@@ -296,14 +229,14 @@ __inline_functions(long double,l)
#ifdef __USE_ISOC99
-# define __inline_functions(float_type, s) \
-__m81_defun (float_type, __CONCAT(__scalbln,s), \
- (float_type __x, long int __n)) \
+# define __inline_functions(float_type, m) \
+__m81_defun (float_type, m(__scalbln), \
+ (float_type __x, long int __n),) \
{ \
- return __CONCAT(__scalbn,s) (__x, __n); \
+ return m(__scalbn) (__x, __n); \
} \
\
-__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \
+__m81_defun (float_type, m(__nearbyint), (float_type __x),) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -317,44 +250,46 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \
return __result; \
} \
\
-__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \
+__m81_defun (long int, m(__lrint), (float_type __x),) \
{ \
long int __result; \
__asm __volatile__ ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \
return __result; \
}
-__inline_functions (double,)
-__inline_functions (float,f)
-__inline_functions (long double,l)
+__inline_functions (double, __CONCAT_d)
+__inline_functions (float, __CONCAT_f)
+__inline_functions (long double, __CONCAT_l)
# undef __inline_functions
#endif /* Use ISO C9x */
#ifdef __USE_GNU
-# define __inline_functions(float_type, s) \
+# define __inline_functions(float_type, m) \
__m81_inline void \
-__NTH (__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
- float_type *__cosx)) \
+__m81_nth (__m81_u(m(__sincos)) \
+ (float_type __x, float_type *__sinx, float_type *__cosx)) \
{ \
__asm __volatile__ ("fsincos%.x %2,%1:%0" \
: "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \
}
-__inline_functions (double,)
-__inline_functions (float,f)
-__inline_functions (long double,l)
+__inline_functions (double, __CONCAT_d)
+__inline_functions (float, __CONCAT_f)
+__inline_functions (long double, __CONCAT_l)
# undef __inline_functions
#endif
+#undef __CONCAT_d
+#undef __CONCAT_f
+#undef __CONCAT_l
+
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* Define inline versions of the user visible functions. */
-/* Note that there must be no whitespace before the argument passed for
- NAME, to make token pasting work correctly with -traditional. */
# define __inline_forward_c(rettype, name, args1, args2) \
__MATH_INLINE rettype __attribute__((__const__)) \
__NTH (name args1) \
@@ -375,7 +310,7 @@ __inline_forward_c(double,ceil, (double __x), (__x))
__inline_forward_c(int,isinf, (double __value), (__value))
# endif
__inline_forward_c(int,finite, (double __value), (__value))
-__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
+__inline_forward(double,scalbn, (double __x, int __n), (__x, __n))
# endif
# if defined __USE_MISC || defined __USE_XOPEN
# ifndef __USE_ISOC99 /* Conflict with macro of same name. */
@@ -383,9 +318,9 @@ __inline_forward_c(int,isnan, (double __value), (__value))
# endif
# endif
# ifdef __USE_ISOC99
-__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
-__inline_forward_c(double,nearbyint, (double __value), (__value))
-__inline_forward_c(long int,lrint, (double __value), (__value))
+__inline_forward(double,scalbln, (double __x, long int __n), (__x, __n))
+__inline_forward(double,nearbyint, (double __value), (__value))
+__inline_forward(long int,lrint, (double __value), (__value))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
@@ -399,13 +334,13 @@ __inline_forward_c(float,ceilf, (float __x), (__x))
# ifdef __USE_MISC
__inline_forward_c(int,isinff, (float __value), (__value))
__inline_forward_c(int,finitef, (float __value), (__value))
-__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
+__inline_forward(float,scalbnf, (float __x, int __n), (__x, __n))
__inline_forward_c(int,isnanf, (float __value), (__value))
# endif
# ifdef __USE_ISOC99
-__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
-__inline_forward_c(float,nearbyintf, (float __value), (__value))
-__inline_forward_c(long int,lrintf, (float __value), (__value))
+__inline_forward(float,scalblnf, (float __x, long int __n), (__x, __n))
+__inline_forward(float,nearbyintf, (float __value), (__value))
+__inline_forward(long int,lrintf, (float __value), (__value))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
@@ -417,14 +352,14 @@ __inline_forward_c(long double,ceill, (long double __x), (__x))
# ifdef __USE_MISC
__inline_forward_c(int,isinfl, (long double __value), (__value))
__inline_forward_c(int,finitel, (long double __value), (__value))
-__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
+__inline_forward(long double,scalbnl, (long double __x, int __n), (__x, __n))
__inline_forward_c(int,isnanl, (long double __value), (__value))
# endif
# ifdef __USE_ISOC99
-__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
- (__x, __n))
-__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
-__inline_forward_c(long int,lrintl, (long double __value), (__value))
+__inline_forward(long double,scalblnl, (long double __x, long int __n),
+ (__x, __n))
+__inline_forward(long double,nearbyintl, (long double __value), (__value))
+__inline_forward(long int,lrintl, (long double __value), (__value))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosl,
diff --git a/sysdeps/m68k/m680x0/fpu/e_acos.c b/sysdeps/m68k/m680x0/fpu/e_acos.c
index 522e20985e..67a2616be7 100644
--- a/sysdeps/m68k/m680x0/fpu/e_acos.c
+++ b/sysdeps/m68k/m680x0/fpu/e_acos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 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
diff --git a/sysdeps/m68k/m680x0/fpu/e_atan2.c b/sysdeps/m68k/m680x0/fpu/e_atan2.c
index 05c0988787..f1cd00df78 100644
--- a/sysdeps/m68k/m680x0/fpu/e_atan2.c
+++ b/sysdeps/m68k/m680x0/fpu/e_atan2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 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
diff --git a/sysdeps/m68k/m680x0/fpu/halfulp.c b/sysdeps/m68k/m680x0/fpu/e_exp2f_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/halfulp.c
+++ b/sysdeps/m68k/m680x0/fpu/e_exp2f_data.c
diff --git a/sysdeps/m68k/m680x0/fpu/e_fmod.c b/sysdeps/m68k/m680x0/fpu/e_fmod.c
index e7c958bead..83dbd37e85 100644
--- a/sysdeps/m68k/m680x0/fpu/e_fmod.c
+++ b/sysdeps/m68k/m680x0/fpu/e_fmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 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
diff --git a/sysdeps/m68k/m680x0/fpu/e_ilogb.c b/sysdeps/m68k/m680x0/fpu/e_ilogb.c
index 920f244f6a..e1cb2938bf 100644
--- a/sysdeps/m68k/m680x0/fpu/e_ilogb.c
+++ b/sysdeps/m68k/m680x0/fpu/e_ilogb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 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
diff --git a/sysdeps/m68k/m680x0/fpu/mpexp.c b/sysdeps/m68k/m680x0/fpu/e_log2f_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/mpexp.c
+++ b/sysdeps/m68k/m680x0/fpu/e_log2f_data.c
diff --git a/sysdeps/m68k/m680x0/fpu/mplog.c b/sysdeps/m68k/m680x0/fpu/e_logf_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/mplog.c
+++ b/sysdeps/m68k/m680x0/fpu/e_logf_data.c
diff --git a/sysdeps/m68k/m680x0/fpu/e_pow.c b/sysdeps/m68k/m680x0/fpu/e_pow.c
index 34bdf464b7..a94c0e0c0d 100644
--- a/sysdeps/m68k/m680x0/fpu/e_pow.c
+++ b/sysdeps/m68k/m680x0/fpu/e_pow.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 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
@@ -64,7 +64,7 @@ s(__ieee754_pow) (float_type x, float_type y)
if (y == 2)
return x * x;
if (y == 0.5 && !(x_cond & __M81_COND_NEG))
- return m81(__ieee754_sqrt) (x);
+ return m81(sqrt) (x);
if (x == 10.0)
{
@@ -106,7 +106,7 @@ s(__ieee754_pow) (float_type x, float_type y)
this format and rounding won't change the result. */
{
int32_t exponent;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
GET_LDOUBLE_WORDS (exponent, i0, i1, y);
exponent = (exponent & 0x7fff) - 0x3fff;
if (exponent <= 31
diff --git a/sysdeps/m68k/m680x0/fpu/slowexp.c b/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/slowexp.c
+++ b/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c
diff --git a/sysdeps/m68k/m680x0/fpu/e_scalb.c b/sysdeps/m68k/m680x0/fpu/e_scalb.c
index 498fdbe477..efa3133363 100644
--- a/sysdeps/m68k/m680x0/fpu/e_scalb.c
+++ b/sysdeps/m68k/m680x0/fpu/e_scalb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
diff --git a/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c b/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c
index 0a55f25a76..99fee81548 100644
--- a/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c
+++ b/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c b/sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c
deleted file mode 100644
index 1347b0468c..0000000000
--- a/sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/sysdeps/m68k/m680x0/fpu/libm-test-ulps b/sysdeps/m68k/m680x0/fpu/libm-test-ulps
index 7667d34b84..2247a4af60 100644
--- a/sysdeps/m68k/m680x0/fpu/libm-test-ulps
+++ b/sysdeps/m68k/m680x0/fpu/libm-test-ulps
@@ -1451,14 +1451,6 @@ ifloat: 7
ildouble: 9
ldouble: 9
-Function: "pow_tonearest":
-double: 1
-float: 7
-idouble: 1
-ifloat: 7
-ildouble: 7
-ldouble: 7
-
Function: "pow_towardzero":
double: 1
float: 4
diff --git a/sysdeps/m68k/m680x0/fpu/libm-test-ulps-name b/sysdeps/m68k/m680x0/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..35c8a9e5f0
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+M68k
diff --git a/sysdeps/m68k/m680x0/fpu/math-barriers.h b/sysdeps/m68k/m680x0/fpu/math-barriers.h
new file mode 100644
index 0000000000..b1b78d5f11
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/math-barriers.h
@@ -0,0 +1,37 @@
+/* Control when floating-point expressions are evaluated. M68k version.
+ Copyright (C) 2011-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef M68K_MATH_BARRIERS_H
+#define M68K_MATH_BARRIERS_H 1
+
+#define math_opt_barrier(x) \
+({ __typeof (x) __x; \
+ __asm ("" : "=f" (__x) : "0" (x)); \
+ __x; })
+#define math_force_eval(x) \
+do \
+ { \
+ __typeof (x) __x = (x); \
+ if (sizeof (x) <= sizeof (double)) \
+ __asm __volatile ("" : : "m" (__x)); \
+ else \
+ __asm __volatile ("" : : "f" (__x)); \
+ } \
+while (0)
+
+#endif
diff --git a/sysdeps/m68k/m680x0/fpu/slowpow.c b/sysdeps/m68k/m680x0/fpu/math_errf.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/slowpow.c
+++ b/sysdeps/m68k/m680x0/fpu/math_errf.c
diff --git a/sysdeps/m68k/m680x0/fpu/math_private.h b/sysdeps/m68k/m680x0/fpu/math_private.h
deleted file mode 100644
index 2b7909535e..0000000000
--- a/sysdeps/m68k/m680x0/fpu/math_private.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef M68K_MATH_PRIVATE_H
-#define M68K_MATH_PRIVATE_H 1
-
-#define math_opt_barrier(x) \
-({ __typeof (x) __x; \
- __asm ("" : "=f" (__x) : "0" (x)); \
- __x; })
-#define math_force_eval(x) \
-do \
- { \
- __typeof (x) __x = (x); \
- if (sizeof (x) <= sizeof (double)) \
- __asm __volatile ("" : : "m" (__x)); \
- else \
- __asm __volatile ("" : : "f" (__x)); \
- } \
-while (0)
-
-#include_next <math_private.h>
-#endif
diff --git a/sysdeps/m68k/m680x0/fpu/mathimpl.h b/sysdeps/m68k/m680x0/fpu/mathimpl.h
index cebec16200..848f9cffaa 100644
--- a/sysdeps/m68k/m680x0/fpu/mathimpl.h
+++ b/sysdeps/m68k/m680x0/fpu/mathimpl.h
@@ -1,6 +1,6 @@
/* Definitions of libc internal inline math functions implemented
by the m68881/2.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 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
@@ -20,27 +20,27 @@
/* This file contains the definitions of the inline math functions that
are only used internally inside libm, not visible to the user. */
-__inline_mathop (__ieee754_acos, acos)
-__inline_mathop (__ieee754_asin, asin)
-__inline_mathop (__ieee754_cosh, cosh)
-__inline_mathop (__ieee754_sinh, sinh)
-__inline_mathop (__ieee754_exp, etox)
-__inline_mathop (__ieee754_exp2, twotox)
-__inline_mathop (__ieee754_exp10, tentox)
-__inline_mathop (__ieee754_log10, log10)
-__inline_mathop (__ieee754_log2, log2)
-__inline_mathop (__ieee754_log, logn)
-__inline_mathop (__ieee754_sqrt, sqrt)
-__inline_mathop (__ieee754_atanh, atanh)
+__inline_mathop (__ieee754_acos, acos,)
+__inline_mathop (__ieee754_asin, asin,)
+__inline_mathop (__ieee754_cosh, cosh,)
+__inline_mathop (__ieee754_sinh, sinh,)
+__inline_mathop (__ieee754_exp, etox,)
+__inline_mathop (__ieee754_exp2, twotox,)
+__inline_mathop (__ieee754_exp10, tentox,)
+__inline_mathop (__ieee754_log10, log10,)
+__inline_mathop (__ieee754_log2, log2,)
+__inline_mathop (__ieee754_log, logn,)
+__inline_mathop (__ieee754_sqrt, sqrt,)
+__inline_mathop (__ieee754_atanh, atanh,)
-__m81_defun (double, __ieee754_remainder, (double __x, double __y))
+__m81_defun (double, __ieee754_remainder, (double __x, double __y),)
{
double __result;
__asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
return __result;
}
-__m81_defun (float, __ieee754_remainderf, (float __x, float __y))
+__m81_defun (float, __ieee754_remainderf, (float __x, float __y),)
{
float __result;
__asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
@@ -48,21 +48,21 @@ __m81_defun (float, __ieee754_remainderf, (float __x, float __y))
}
__m81_defun (long double,
- __ieee754_remainderl, (long double __x, long double __y))
+ __ieee754_remainderl, (long double __x, long double __y),)
{
long double __result;
__asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
return __result;
}
-__m81_defun (double, __ieee754_fmod, (double __x, double __y))
+__m81_defun (double, __ieee754_fmod, (double __x, double __y),)
{
double __result;
__asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
return __result;
}
-__m81_defun (float, __ieee754_fmodf, (float __x, float __y))
+__m81_defun (float, __ieee754_fmodf, (float __x, float __y),)
{
float __result;
__asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
@@ -70,7 +70,7 @@ __m81_defun (float, __ieee754_fmodf, (float __x, float __y))
}
__m81_defun (long double,
- __ieee754_fmodl, (long double __x, long double __y))
+ __ieee754_fmodl, (long double __x, long double __y),)
{
long double __result;
__asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
diff --git a/sysdeps/m68k/m680x0/fpu/s_atan.c b/sysdeps/m68k/m680x0/fpu/s_atan.c
index 5160faee52..a6f90d3298 100644
--- a/sysdeps/m68k/m680x0/fpu/s_atan.c
+++ b/sysdeps/m68k/m680x0/fpu/s_atan.c
@@ -1,34 +1,2 @@
-/* Copyright (C) 1996-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC atan
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-__CONCATX(__,FUNC) (float_type x)
-{
- return __m81_u(__CONCATX(__,FUNC))(x);
-}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_atan_template.c>
diff --git a/sysdeps/m68k/m680x0/m68020/bits/string.h b/sysdeps/m68k/m680x0/fpu/s_atan_template.c
index 78c95943e1..8696a65105 100644
--- a/sysdeps/m68k/m680x0/m68020/bits/string.h
+++ b/sysdeps/m68k/m680x0/fpu/s_atan_template.c
@@ -1,5 +1,5 @@
-/* Optimized, inlined string functions. m680x0 version, x >= 2.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Implement atan for m68k.
+ Copyright (C) 1996-2018 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
@@ -16,9 +16,11 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
+#include <math.h>
-/* Use the unaligned string inline ABI. */
-#define _STRING_INLINE_unaligned 1
+FLOAT
+M_DECL_FUNC (__atan) (FLOAT x)
+{
+ return __m81_u(M_SUF (__atan)) (x);
+}
+declare_mgen_alias (__atan, atan)
diff --git a/sysdeps/m68k/m680x0/fpu/s_atanf.c b/sysdeps/m68k/m680x0/fpu/s_atanf.c
index c98559a8ba..bc24155c41 100644
--- a/sysdeps/m68k/m680x0/fpu/s_atanf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_atanf.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-#define FUNC atanf
-#endif
-#define float_type float
-#include <s_atan.c>
+#include <math-type-macros-float.h>
+#include <s_atan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_atanl.c b/sysdeps/m68k/m680x0/fpu/s_atanl.c
index b7e608addd..28eea11999 100644
--- a/sysdeps/m68k/m680x0/fpu/s_atanl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_atanl.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-#define FUNC atanl
-#endif
-#define float_type long double
-#include <s_atan.c>
+#include <math-type-macros-ldouble.h>
+#include <s_atan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccosh.c b/sysdeps/m68k/m680x0/fpu/s_ccosh_template.c
index 47a4fb0c94..23308a20c3 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ccosh.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ccosh_template.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
@@ -21,27 +21,19 @@
#include <math.h>
#include "mathimpl.h"
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
+#define s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__ccosh) (__complex__ float_type x)
+CFLOAT
+s(__ccosh) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT retval;
unsigned long ix_cond = __m81_test (__imag__ x);
if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
{
/* Imaginary part is finite. */
- float_type sin_ix, cos_ix;
+ FLOAT sin_ix, cos_ix;
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
: "f" (__imag__ x));
@@ -73,4 +65,4 @@ s(__ccosh) (__complex__ float_type x)
return retval;
}
-weak_alias (s(__ccosh), s(ccosh))
+declare_mgen_alias (__ccosh, ccosh)
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccoshf.c b/sysdeps/m68k/m680x0/fpu/s_ccoshf.c
deleted file mode 100644
index 3c8e7c7bb7..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_ccoshf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_ccosh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccoshl.c b/sysdeps/m68k/m680x0/fpu/s_ccoshl.c
deleted file mode 100644
index 772d5786cf..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_ccoshl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_ccosh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ceil.c b/sysdeps/m68k/m680x0/fpu/s_ceil.c
index 93d5ad72e5..70aeb739f1 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ceil.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ceil.c
@@ -1,2 +1,2 @@
-#define FUNC ceil
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_ceil_template.c>
diff --git a/sysdeps/m68k/nptl/pthread_spin_lock.c b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c
index 5aaee5a37f..a4d032d90c 100644
--- a/sysdeps/m68k/nptl/pthread_spin_lock.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Implement ceil for m68k.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,9 +16,11 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
+#include <math.h>
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
+FLOAT
+M_DECL_FUNC (__ceil) (FLOAT x)
+{
+ return __m81_u(M_SUF (__ceil)) (x);
+}
+declare_mgen_alias (__ceil, ceil)
diff --git a/sysdeps/m68k/m680x0/fpu/s_ceilf.c b/sysdeps/m68k/m680x0/fpu/s_ceilf.c
index b3ba6a5700..74e027e40c 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ceilf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ceilf.c
@@ -1,2 +1,2 @@
-#define FUNC ceilf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_ceil_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ceill.c b/sysdeps/m68k/m680x0/fpu/s_ceill.c
index 2bf95b00c6..5188c2471d 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ceill.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ceill.c
@@ -1,2 +1,2 @@
-#define FUNC ceill
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_ceil_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexp.c b/sysdeps/m68k/m680x0/fpu/s_cexp_template.c
index f715b77d2d..02de829470 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cexp.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cexp_template.c
@@ -1,5 +1,5 @@
/* Complex exponential function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -22,21 +22,14 @@
#include <math.h>
#include "mathimpl.h"
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
+#define s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__cexp) (__complex__ float_type x)
+CFLOAT
+s(__cexp) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT retval;
unsigned long ix_cond;
ix_cond = __m81_test (__imag__ x);
@@ -133,4 +126,4 @@ s(__cexp) (__complex__ float_type x)
return retval;
}
-weak_alias (s(__cexp), s(cexp))
+declare_mgen_alias (__cexp, cexp)
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexpf.c b/sysdeps/m68k/m680x0/fpu/s_cexpf.c
deleted file mode 100644
index 177a360f9b..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_cexpf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_cexp.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexpl.c b/sysdeps/m68k/m680x0/fpu/s_cexpl.c
deleted file mode 100644
index bbda4ba990..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_cexpl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_cexp.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cos.c b/sysdeps/m68k/m680x0/fpu/s_cos.c
index 2f1adf77f5..24e508e5c3 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cos.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cos.c
@@ -1,2 +1,2 @@
-#define FUNC cos
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_cos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cos_template.c b/sysdeps/m68k/m680x0/fpu/s_cos_template.c
new file mode 100644
index 0000000000..a2574debdc
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_cos_template.c
@@ -0,0 +1,30 @@
+/* Implement cos for m68k.
+ Copyright (C) 2012-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__cos) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__cos)) (x);
+}
+declare_mgen_alias (__cos, cos)
diff --git a/sysdeps/m68k/m680x0/fpu/s_cosf.c b/sysdeps/m68k/m680x0/fpu/s_cosf.c
index b6d6accb4a..fcfc844dfe 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cosf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cosf.c
@@ -1,2 +1,2 @@
-#define FUNC cosf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_cos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cosl.c b/sysdeps/m68k/m680x0/fpu/s_cosl.c
index eb61521fdd..de8767cfe3 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cosl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cosl.c
@@ -1,2 +1,2 @@
-#define FUNC cosl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_cos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csin.c b/sysdeps/m68k/m680x0/fpu/s_csin_template.c
index b8419be897..1ea0b1bb77 100644
--- a/sysdeps/m68k/m680x0/fpu/s_csin.c
+++ b/sysdeps/m68k/m680x0/fpu/s_csin_template.c
@@ -1,5 +1,5 @@
/* Complex sine function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
@@ -21,27 +21,19 @@
#include <math.h>
#include "mathimpl.h"
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
+#define s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__csin) (__complex__ float_type x)
+CFLOAT
+s(__csin) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT retval;
unsigned long rx_cond = __m81_test (__real__ x);
if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
{
/* Real part is finite. */
- float_type sin_rx, cos_rx;
+ FLOAT sin_rx, cos_rx;
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx)
: "f" (__real__ x));
@@ -64,4 +56,4 @@ s(__csin) (__complex__ float_type x)
return retval;
}
-weak_alias (s(__csin), s(csin))
+declare_mgen_alias (__csin, csin)
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinf.c b/sysdeps/m68k/m680x0/fpu/s_csinf.c
deleted file mode 100644
index b760e192c3..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_csin.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinh.c b/sysdeps/m68k/m680x0/fpu/s_csinh_template.c
index c633cd8875..26c41a290d 100644
--- a/sysdeps/m68k/m680x0/fpu/s_csinh.c
+++ b/sysdeps/m68k/m680x0/fpu/s_csinh_template.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
@@ -21,21 +21,14 @@
#include <math.h>
#include "mathimpl.h"
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
+#define s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__csinh) (__complex__ float_type x)
+CFLOAT
+s(__csinh) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT retval;
unsigned long ix_cond;
ix_cond = __m81_test (__imag__ x);
@@ -43,7 +36,7 @@ s(__csinh) (__complex__ float_type x)
if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
{
/* Imaginary part is finite. */
- float_type sin_ix, cos_ix;
+ FLOAT sin_ix, cos_ix;
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
: "f" (__imag__ x));
@@ -66,4 +59,4 @@ s(__csinh) (__complex__ float_type x)
return retval;
}
-weak_alias (s(__csinh), s(csinh))
+declare_mgen_alias (__csinh, csinh)
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinhf.c b/sysdeps/m68k/m680x0/fpu/s_csinhf.c
deleted file mode 100644
index 2f7a43e6a8..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinhf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_csinh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinhl.c b/sysdeps/m68k/m680x0/fpu/s_csinhl.c
deleted file mode 100644
index 026a20e7be..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinhl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_csinh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinl.c b/sysdeps/m68k/m680x0/fpu/s_csinl.c
deleted file mode 100644
index ea2dad0556..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_csin.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1.c b/sysdeps/m68k/m680x0/fpu/s_expm1.c
index baa044ce99..3f9b4660a3 100644
--- a/sysdeps/m68k/m680x0/fpu/s_expm1.c
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 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
@@ -15,27 +15,6 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
-#include <errno.h>
-#include "mathimpl.h"
-
-#ifndef FUNC
-# define FUNC expm1
-#endif
-#ifndef float_type
-# define float_type double
-#endif
-#ifndef o_threshold
-# define o_threshold 7.09782712893383973096e+02
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-CONCATX(__,FUNC) (float_type x)
-{
- if ((__m81_test (x) & __M81_COND_INF) == 0 && isgreater (x, o_threshold))
- __set_errno (ERANGE);
- return __m81_u(CONCATX(__, FUNC)) (x);
-}
-weak_alias (CONCATX(__, FUNC), FUNC)
+#include <math-type-macros-double.h>
+#define o_threshold 7.09782712893383973096e+02
+#include <s_expm1_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1_template.c b/sysdeps/m68k/m680x0/fpu/s_expm1_template.c
new file mode 100644
index 0000000000..f055f7781a
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1_template.c
@@ -0,0 +1,30 @@
+/* Implement expm1 for m68k.
+ Copyright (C) 2012-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__expm1) (FLOAT x)
+{
+ if ((__m81_test (x) & __M81_COND_INF) == 0 && isgreater (x, o_threshold))
+ __set_errno (ERANGE);
+ return __m81_u(M_SUF (__expm1)) (x);
+}
+declare_mgen_alias (__expm1, expm1)
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1f.c b/sysdeps/m68k/m680x0/fpu/s_expm1f.c
index 2cd8ffcfeb..a36080030e 100644
--- a/sysdeps/m68k/m680x0/fpu/s_expm1f.c
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1f.c
@@ -1,4 +1,3 @@
-#define FUNC expm1f
-#define float_type float
+#include <math-type-macros-float.h>
#define o_threshold 8.8722831726e+01F
-#include <s_expm1.c>
+#include <s_expm1_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1l.c b/sysdeps/m68k/m680x0/fpu/s_expm1l.c
index a2c80860ba..cfbab2843b 100644
--- a/sysdeps/m68k/m680x0/fpu/s_expm1l.c
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1l.c
@@ -1,6 +1,5 @@
-#define FUNC expm1l
-#define float_type long double
+#include <math-type-macros-ldouble.h>
/* 400c0000b17217f7d1cf79ab */
#define o_threshold 1.13565234062941439487914863093465101e+04L
-#include <s_expm1.c>
+#include <s_expm1_template.c>
libm_hidden_def (__expm1l)
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs.c b/sysdeps/m68k/m680x0/fpu/s_fabs.c
index 1f0631e2ff..179a94add2 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fabs.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fabs.c
@@ -1,2 +1,2 @@
-#define FUNC fabs
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_fabs_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs_template.c b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c
new file mode 100644
index 0000000000..8af749a3f3
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c
@@ -0,0 +1,26 @@
+/* Implement fabs for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__fabs) (FLOAT x)
+{
+ return __m81_u(M_SUF (__fabs)) (x);
+}
+declare_mgen_alias (__fabs, fabs)
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabsf.c b/sysdeps/m68k/m680x0/fpu/s_fabsf.c
index 8f9421998a..9072d2a76a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fabsf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fabsf.c
@@ -1,2 +1,2 @@
-#define FUNC fabsf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_fabs_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabsl.c b/sysdeps/m68k/m680x0/fpu/s_fabsl.c
index 8ac14d5b8c..fa48f8ae4e 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fabsl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fabsl.c
@@ -1,2 +1,2 @@
-#define FUNC fabsl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_fabs_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_floor.c b/sysdeps/m68k/m680x0/fpu/s_floor.c
index e1219c602a..339ae2cce4 100644
--- a/sysdeps/m68k/m680x0/fpu/s_floor.c
+++ b/sysdeps/m68k/m680x0/fpu/s_floor.c
@@ -1,2 +1,2 @@
-#define FUNC floor
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_floor_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_floor_template.c b/sysdeps/m68k/m680x0/fpu/s_floor_template.c
new file mode 100644
index 0000000000..7779813d84
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_floor_template.c
@@ -0,0 +1,26 @@
+/* Implement floor for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__floor) (FLOAT x)
+{
+ return __m81_u(M_SUF (__floor)) (x);
+}
+declare_mgen_alias (__floor, floor)
diff --git a/sysdeps/m68k/m680x0/fpu/s_floorf.c b/sysdeps/m68k/m680x0/fpu/s_floorf.c
index f4f9b9a1d8..5d998e0217 100644
--- a/sysdeps/m68k/m680x0/fpu/s_floorf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_floorf.c
@@ -1,2 +1,2 @@
-#define FUNC floorf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_floor_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_floorl.c b/sysdeps/m68k/m680x0/fpu/s_floorl.c
index 2c1ffd7d2c..2295f99845 100644
--- a/sysdeps/m68k/m680x0/fpu/s_floorl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_floorl.c
@@ -1,2 +1,2 @@
-#define FUNC floorl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_floor_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c b/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c
index efe2116f22..657fe0c476 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument. m68k version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Fixed for m68k by Andreas Schwab <schwab@suse.de>.
@@ -26,7 +26,7 @@
int
__fpclassifyl (long double x)
{
- u_int32_t ex, hx, lx;
+ uint32_t ex, hx, lx;
int retval = FP_NORMAL;
GET_LDOUBLE_WORDS (ex, hx, lx, x);
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexp.c b/sysdeps/m68k/m680x0/fpu/s_frexp.c
index 34e6ad1efa..be8db3875a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_frexp.c
+++ b/sysdeps/m68k/m680x0/fpu/s_frexp.c
@@ -1,53 +1,2 @@
-/* Copyright (C) 1996-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC frexp
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-__CONCATX(__,FUNC) (float_type value, int *expptr)
-{
- float_type mantissa, exponent;
- int iexponent;
- unsigned long fpsr;
-
- __asm ("ftst%.x %1\n"
- "fmove%.l %/fpsr, %0"
- : "=dm" (fpsr) : "f" (value));
- if (fpsr & (7 << 24))
- {
- /* Not finite or zero. */
- *expptr = 0;
- return value;
- }
- __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value));
- iexponent = (int) exponent + 1;
- *expptr = iexponent;
- __asm ("fscale%.l %2, %0"
- : "=f" (mantissa)
- : "0" (value), "dmi" (-iexponent));
- return mantissa;
-}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_frexp_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexp_template.c b/sysdeps/m68k/m680x0/fpu/s_frexp_template.c
new file mode 100644
index 0000000000..5036433766
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_frexp_template.c
@@ -0,0 +1,45 @@
+/* Implement frexp for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__frexp) (FLOAT value, int *expptr)
+{
+ FLOAT mantissa, exponent;
+ int iexponent;
+ unsigned long fpsr;
+
+ __asm ("ftst%.x %1\n"
+ "fmove%.l %/fpsr, %0"
+ : "=dm" (fpsr) : "f" (value));
+ if (fpsr & (7 << 24))
+ {
+ /* Not finite or zero. */
+ *expptr = 0;
+ return value;
+ }
+ __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value));
+ iexponent = (int) exponent + 1;
+ *expptr = iexponent;
+ __asm ("fscale%.l %2, %0"
+ : "=f" (mantissa)
+ : "0" (value), "dmi" (-iexponent));
+ return mantissa;
+}
+declare_mgen_alias (__frexp, frexp)
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexpf.c b/sysdeps/m68k/m680x0/fpu/s_frexpf.c
index 893b6ad3cf..6cf7ceb294 100644
--- a/sysdeps/m68k/m680x0/fpu/s_frexpf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_frexpf.c
@@ -1,3 +1,2 @@
-#define FUNC frexpf
-#define float_type float
-#include <s_frexp.c>
+#include <math-type-macros-float.h>
+#include <s_frexp_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexpl.c b/sysdeps/m68k/m680x0/fpu/s_frexpl.c
index e8b5edf6b4..44e67bf8d7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_frexpl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_frexpl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 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
diff --git a/sysdeps/m68k/m680x0/fpu/s_isinf.c b/sysdeps/m68k/m680x0/fpu/s_isinf.c
index aa15e2ca90..339db1f9f4 100644
--- a/sysdeps/m68k/m680x0/fpu/s_isinf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_isinf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 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
diff --git a/sysdeps/m68k/m680x0/fpu/s_llrint.c b/sysdeps/m68k/m680x0/fpu/s_llrint.c
index d3f4154f42..6ca1875869 100644
--- a/sysdeps/m68k/m680x0/fpu/s_llrint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_llrint.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -20,13 +20,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include "mathimpl.h"
long long int
__llrint (double x)
{
int32_t e;
- u_int32_t h, l, s;
+ uint32_t h, l, s;
long long int result;
x = __m81_u(__rint) (x);
@@ -72,4 +73,4 @@ __llrint (double x)
return result;
}
-weak_alias (__llrint, llrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_llrintf.c b/sysdeps/m68k/m680x0/fpu/s_llrintf.c
index 8c8ad56023..f972cf99f1 100644
--- a/sysdeps/m68k/m680x0/fpu/s_llrintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_llrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -20,13 +20,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include "mathimpl.h"
long long int
__llrintf (float x)
{
int32_t e;
- u_int32_t i, s;
+ uint32_t i, s;
long long int result;
x = __m81_u(__rintf) (x);
@@ -62,4 +63,4 @@ __llrintf (float x)
return result;
}
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_llrintl.c b/sysdeps/m68k/m680x0/fpu/s_llrintl.c
index d239fc0a99..9caa46f98a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_llrintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -20,13 +20,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include "mathimpl.h"
long long int
__llrintl (long double x)
{
int32_t e, s;
- u_int32_t h, l;
+ uint32_t h, l;
long long int result;
x = __m81_u(__rintl) (x);
@@ -61,4 +62,4 @@ __llrintl (long double x)
return result;
}
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_log1p.c b/sysdeps/m68k/m680x0/fpu/s_log1p.c
index 082618df18..5da96c5834 100644
--- a/sysdeps/m68k/m680x0/fpu/s_log1p.c
+++ b/sysdeps/m68k/m680x0/fpu/s_log1p.c
@@ -1,4 +1,34 @@
-#define FUNC log1p
-#undef weak_alias
-#define weak_alias(a,b)
-#include <s_atan.c>
+/* Implement logp1 for m68k.
+ Copyright (C) 2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#ifndef FUNC
+#define FUNC log1p
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+__CONCATX(__,FUNC) (float_type x)
+{
+ return __m81_u(__CONCATX(__,FUNC))(x);
+}
diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pf.c b/sysdeps/m68k/m680x0/fpu/s_log1pf.c
index 480c39519f..1e408ffffe 100644
--- a/sysdeps/m68k/m680x0/fpu/s_log1pf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_log1pf.c
@@ -1,4 +1,3 @@
#define FUNC log1pf
-#undef weak_alias
-#define weak_alias(a,b)
-#include <s_atanf.c>
+#define float_type float
+#include <s_log1p.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pl.c b/sysdeps/m68k/m680x0/fpu/s_log1pl.c
index a4f34a4f86..ffe1d8893f 100644
--- a/sysdeps/m68k/m680x0/fpu/s_log1pl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_log1pl.c
@@ -1,4 +1,3 @@
#define FUNC log1pl
-#undef weak_alias
-#define weak_alias(a,b)
-#include <s_atanl.c>
+#define float_type long double
+#include <s_log1p.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint.c b/sysdeps/m68k/m680x0/fpu/s_lrint.c
index 1096931eed..31440cfdbc 100644
--- a/sysdeps/m68k/m680x0/fpu/s_lrint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_lrint.c
@@ -1,37 +1,2 @@
-/* Round argument to nearest integral value according to current rounding
- direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- 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
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-#ifndef suffix
-#define suffix /*empty*/
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-long int
-CONCATX(__lrint,suffix) (float_type x)
-{
- return __m81_u(CONCATX(__lrint,suffix)) (x);
-}
-weak_alias (CONCATX(__lrint,suffix), CONCATX(lrint,suffix))
+#include <math-type-macros-double.h>
+#include <s_lrint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint_template.c b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c
new file mode 100644
index 0000000000..6a531789d2
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c
@@ -0,0 +1,28 @@
+/* Round argument to nearest integral value according to current rounding
+ direction.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+long int
+M_DECL_FUNC (__lrint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__lrint)) (x);
+}
+declare_mgen_alias (__lrint, lrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrintf.c b/sysdeps/m68k/m680x0/fpu/s_lrintf.c
index 44924cb82f..77e753baa7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_lrintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_lrintf.c
@@ -1,3 +1,2 @@
-#define suffix f
-#define float_type float
-#include <s_lrint.c>
+#include <math-type-macros-float.h>
+#include <s_lrint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrintl.c b/sysdeps/m68k/m680x0/fpu/s_lrintl.c
index cd0bd23b8a..a4670b83c6 100644
--- a/sysdeps/m68k/m680x0/fpu/s_lrintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_lrintl.c
@@ -1,3 +1,2 @@
-#define suffix l
-#define float_type long double
-#include <s_lrint.c>
+#include <math-type-macros-ldouble.h>
+#include <s_lrint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_modf.c b/sysdeps/m68k/m680x0/fpu/s_modf.c
index 11970950c2..1d1c0ea7f2 100644
--- a/sysdeps/m68k/m680x0/fpu/s_modf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_modf.c
@@ -1,53 +1,2 @@
-/* Copyright (C) 1996-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-float_type
-s(__modf) (float_type x, float_type *iptr)
-{
- float_type x_int, result;
- unsigned long x_cond;
-
- __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x));
- *iptr = x_int;
- x_cond = __m81_test (x);
- if (x_cond & __M81_COND_INF)
- {
- result = 0;
- if (x_cond & __M81_COND_NEG)
- result = -result;
- }
- else if (x_cond & __M81_COND_ZERO)
- result = x;
- else
- result = x - x_int;
- return result;
-}
-weak_alias (s(__modf), s(modf))
+#include <math-type-macros-double.h>
+#include <s_modf_template.c>
diff --git a/sysdeps/m68k/coldfire/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/s_modf_template.c
index e143db29e8..a6f51bd6d7 100644
--- a/sysdeps/m68k/coldfire/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/m680x0/fpu/s_modf_template.c
@@ -1,5 +1,5 @@
-/* Inline math functions for Coldfire.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Implement modf for m68k.
+ Copyright (C) 1996-2018 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
@@ -16,29 +16,28 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
+#include <math.h>
+#include "mathimpl.h"
-#ifndef __extern_always_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_always_inline
-#endif
-
-#if defined __USE_ISOC99 && defined __GNUC__
-
-/* Test for negative number. Used in the signbit macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- return __builtin_signbitf (__x);
-}
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
+FLOAT
+M_DECL_FUNC (__modf) (FLOAT x, FLOAT *iptr)
{
- return __builtin_signbit (__x);
+ FLOAT x_int, result;
+ unsigned long x_cond;
+
+ __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x));
+ *iptr = x_int;
+ x_cond = __m81_test (x);
+ if (x_cond & __M81_COND_INF)
+ {
+ result = 0;
+ if (x_cond & __M81_COND_NEG)
+ result = -result;
+ }
+ else if (x_cond & __M81_COND_ZERO)
+ result = x;
+ else
+ result = x - x_int;
+ return result;
}
-
-#endif
+declare_mgen_alias (__modf, modf)
diff --git a/sysdeps/m68k/m680x0/fpu/s_modff.c b/sysdeps/m68k/m680x0/fpu/s_modff.c
index 0c44d7c0ab..3d28880398 100644
--- a/sysdeps/m68k/m680x0/fpu/s_modff.c
+++ b/sysdeps/m68k/m680x0/fpu/s_modff.c
@@ -1,3 +1,2 @@
-#define SUFF f
-#define float_type float
-#include <s_modf.c>
+#include <math-type-macros-float.h>
+#include <s_modf_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_modfl.c b/sysdeps/m68k/m680x0/fpu/s_modfl.c
index c7075b3ba9..9057645249 100644
--- a/sysdeps/m68k/m680x0/fpu/s_modfl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_modfl.c
@@ -1,3 +1,2 @@
-#define SUFF l
-#define float_type long double
-#include <s_modf.c>
+#include <math-type-macros-ldouble.h>
+#include <s_modf_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint.c
index b87f5e2160..6af0d9b1a9 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nearbyint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyint.c
@@ -1,2 +1,2 @@
-#define FUNC nearbyint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_nearbyint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c
new file mode 100644
index 0000000000..971511321b
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c
@@ -0,0 +1,26 @@
+/* Implement nearbyint for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__nearbyint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__nearbyint)) (x);
+}
+declare_mgen_alias (__nearbyint, nearbyint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c b/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c
index 70d08ab44c..aefd7fc7c5 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c
@@ -1,2 +1,2 @@
-#define FUNC nearbyintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_nearbyint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c b/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c
index 230cd7784c..8516caf947 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c
@@ -1,2 +1,2 @@
-#define FUNC nearbyintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_nearbyint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nextafterl.c b/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
index c46c0e76ec..76e900055f 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
@@ -28,12 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
long double __nextafterl(long double x, long double y)
{
int32_t ix,iy,esx,esy;
- u_int32_t hx,hy,lx,ly;
+ uint32_t hx,hy,lx,ly;
GET_LDOUBLE_WORDS(esx,hx,lx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquo.c b/sysdeps/m68k/m680x0/fpu/s_remquo.c
index ef9c4e4c27..b1d8f3a972 100644
--- a/sysdeps/m68k/m680x0/fpu/s_remquo.c
+++ b/sysdeps/m68k/m680x0/fpu/s_remquo.c
@@ -1,46 +1,2 @@
-/* Compute remainder and a congruent to the quotient. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- 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
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-
-float_type
-s(__remquo) (float_type x, float_type y, int *quo)
-{
- float_type result;
- int cquo, fpsr;
-
- __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1"
- : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x));
- cquo = (fpsr >> 16) & 0x7f;
- if (fpsr & (1 << 23))
- cquo = -cquo;
- *quo = cquo;
- return result;
-}
-weak_alias (s(__remquo), s(remquo))
+#include <math-type-macros-double.h>
+#include <s_remquo_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquo_template.c b/sysdeps/m68k/m680x0/fpu/s_remquo_template.c
new file mode 100644
index 0000000000..e7c7be6271
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_remquo_template.c
@@ -0,0 +1,36 @@
+/* Compute remainder and a congruent to the quotient. m68k fpu version
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__remquo) (FLOAT x, FLOAT y, int *quo)
+{
+ FLOAT result;
+ int cquo, fpsr;
+
+ __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1"
+ : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x));
+ cquo = (fpsr >> 16) & 0x7f;
+ if (fpsr & (1 << 23))
+ cquo = -cquo;
+ *quo = cquo;
+ return result;
+}
+declare_mgen_alias (__remquo, remquo)
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquof.c b/sysdeps/m68k/m680x0/fpu/s_remquof.c
index 8a292fc26c..f2b86628d2 100644
--- a/sysdeps/m68k/m680x0/fpu/s_remquof.c
+++ b/sysdeps/m68k/m680x0/fpu/s_remquof.c
@@ -1,3 +1,2 @@
-#define SUFF f
-#define float_type float
-#include <s_remquo.c>
+#include <math-type-macros-float.h>
+#include <s_remquo_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquol.c b/sysdeps/m68k/m680x0/fpu/s_remquol.c
index d236cfd1f9..cb18d9e520 100644
--- a/sysdeps/m68k/m680x0/fpu/s_remquol.c
+++ b/sysdeps/m68k/m680x0/fpu/s_remquol.c
@@ -1,3 +1,2 @@
-#define SUFF l
-#define float_type long double
-#include <s_remquo.c>
+#include <math-type-macros-ldouble.h>
+#include <s_remquo_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_rint.c b/sysdeps/m68k/m680x0/fpu/s_rint.c
index f0f18c7346..fa092c07eb 100644
--- a/sysdeps/m68k/m680x0/fpu/s_rint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_rint.c
@@ -1,2 +1,2 @@
-#define FUNC rint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_rint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_rint_template.c b/sysdeps/m68k/m680x0/fpu/s_rint_template.c
new file mode 100644
index 0000000000..4f4ef12aab
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_rint_template.c
@@ -0,0 +1,26 @@
+/* Implement rint for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__rint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__rint)) (x);
+}
+declare_mgen_alias (__rint, rint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_rintf.c b/sysdeps/m68k/m680x0/fpu/s_rintf.c
index 4e00cab0fb..5cda19c690 100644
--- a/sysdeps/m68k/m680x0/fpu/s_rintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_rintf.c
@@ -1,2 +1,2 @@
-#define FUNC rintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_rint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_rintl.c b/sysdeps/m68k/m680x0/fpu/s_rintl.c
index 305667b3a1..df393ee895 100644
--- a/sysdeps/m68k/m680x0/fpu/s_rintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_rintl.c
@@ -1,2 +1,2 @@
-#define FUNC rintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_rint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_scalbn.c b/sysdeps/m68k/m680x0/fpu/s_scalbn.c
index 886a13dcaf..eed3a351fe 100644
--- a/sysdeps/m68k/m680x0/fpu/s_scalbn.c
+++ b/sysdeps/m68k/m680x0/fpu/s_scalbn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 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
diff --git a/sysdeps/m68k/m680x0/fpu/s_significand.c b/sysdeps/m68k/m680x0/fpu/s_significand.c
index 34d4ea3d14..3259d4ee6a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_significand.c
+++ b/sysdeps/m68k/m680x0/fpu/s_significand.c
@@ -1,2 +1,21 @@
-#define FUNC significand
-#include <s_atan.c>
+/* Implement significand for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC significand
+#include <s_log1p.c>
+weak_alias (__significand, significand)
diff --git a/sysdeps/m68k/m680x0/fpu/s_significandf.c b/sysdeps/m68k/m680x0/fpu/s_significandf.c
index 4e769ca317..95da7cf969 100644
--- a/sysdeps/m68k/m680x0/fpu/s_significandf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_significandf.c
@@ -1,2 +1,4 @@
-#define FUNC significandf
-#include <s_atanf.c>
+#define FUNC significandf
+#define float_type float
+#include <s_log1p.c>
+weak_alias (__significandf, significandf)
diff --git a/sysdeps/m68k/m680x0/fpu/s_significandl.c b/sysdeps/m68k/m680x0/fpu/s_significandl.c
index 8c6fc7e610..356b48d138 100644
--- a/sysdeps/m68k/m680x0/fpu/s_significandl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_significandl.c
@@ -1,2 +1,4 @@
#define FUNC significandl
-#include <s_atanl.c>
+#define float_type long double
+#include <s_log1p.c>
+weak_alias (__significandl, significandl)
diff --git a/sysdeps/m68k/m680x0/fpu/s_sin.c b/sysdeps/m68k/m680x0/fpu/s_sin.c
index 9b54adb849..b52e804ab9 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sin.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sin.c
@@ -1,38 +1,2 @@
-/* Copyright (C) 2012-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <errno.h>
-#include "mathimpl.h"
-
-#ifndef FUNC
-# define FUNC sin
-#endif
-#ifndef float_type
-# define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-CONCATX(__,FUNC) (float_type x)
-{
- if (__m81_test (x) & __M81_COND_INF)
- __set_errno (EDOM);
- return __m81_u(CONCATX(__, FUNC)) (x);
-}
-weak_alias (CONCATX(__, FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_sin_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sin_template.c b/sysdeps/m68k/m680x0/fpu/s_sin_template.c
new file mode 100644
index 0000000000..6872889710
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_sin_template.c
@@ -0,0 +1,30 @@
+/* Implement sin for m68k.
+ Copyright (C) 2012-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__sin) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__sin)) (x);
+}
+declare_mgen_alias (__sin, sin)
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos.c b/sysdeps/m68k/m680x0/fpu/s_sincos.c
index f681b16bf7..9226798fd7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sincos.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sincos.c
@@ -1,34 +1,2 @@
-/* Copyright (C) 1997-2016 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
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC sincos
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-void
-CONCATX(__,FUNC) (float_type x, float_type *sinx, float_type *cosx)
-{
- __m81_u(CONCATX(__,FUNC))(x, sinx, cosx);
-}
-weak_alias (CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_sincos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos_template.c b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c
new file mode 100644
index 0000000000..5d2af7e4ba
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c
@@ -0,0 +1,26 @@
+/* Implement sincos for m68k.
+ Copyright (C) 1997-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+void
+M_DECL_FUNC (__sincos) (FLOAT x, FLOAT *sinx, FLOAT *cosx)
+{
+ __m81_u(M_SUF (__sincos)) (x, sinx, cosx);
+}
+declare_mgen_alias (__sincos, sincos)
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincosf.c b/sysdeps/m68k/m680x0/fpu/s_sincosf.c
index 7ee2ec6600..581388bdc6 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sincosf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sincosf.c
@@ -1,3 +1,2 @@
-#define FUNC sincosf
-#define float_type float
-#include <s_sincos.c>
+#include <math-type-macros-float.h>
+#include <s_sincos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincosl.c b/sysdeps/m68k/m680x0/fpu/s_sincosl.c
index f998cc0977..6a88d3e88a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sincosl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sincosl.c
@@ -1,3 +1,2 @@
-#define FUNC sincosl
-#define float_type long double
-#include <s_sincos.c>
+#include <math-type-macros-ldouble.h>
+#include <s_sincos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sinf.c b/sysdeps/m68k/m680x0/fpu/s_sinf.c
index 304f4f76f6..7868705d27 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sinf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sinf.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-# define FUNC sinf
-#endif
-#define float_type float
-#include <s_sin.c>
+#include <math-type-macros-float.h>
+#include <s_sin_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sinl.c b/sysdeps/m68k/m680x0/fpu/s_sinl.c
index 31dac0bee7..f542d1b096 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sinl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sinl.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-# define FUNC sinl
-#endif
-#define float_type long double
-#include <s_sin.c>
+#include <math-type-macros-ldouble.h>
+#include <s_sin_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tan.c b/sysdeps/m68k/m680x0/fpu/s_tan.c
index dfbbbb2270..c680a6b041 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tan.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tan.c
@@ -1,2 +1,2 @@
-#define FUNC tan
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_tan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tan_template.c b/sysdeps/m68k/m680x0/fpu/s_tan_template.c
new file mode 100644
index 0000000000..54ec165f90
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_tan_template.c
@@ -0,0 +1,30 @@
+/* Implement tan for m68k.
+ Copyright (C) 2012-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__tan) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__tan)) (x);
+}
+declare_mgen_alias (__tan, tan)
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanf.c b/sysdeps/m68k/m680x0/fpu/s_tanf.c
index 9ae66ddbf3..a95d4d757c 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanf.c
@@ -1,2 +1,2 @@
-#define FUNC tanf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_tan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh.c b/sysdeps/m68k/m680x0/fpu/s_tanh.c
index ac2e7dbb79..11d4bc4f71 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanh.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanh.c
@@ -1,2 +1,2 @@
-#define FUNC tanh
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_tanh_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh_template.c b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c
new file mode 100644
index 0000000000..e7122a651c
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c
@@ -0,0 +1,26 @@
+/* Implement tanh for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__tanh) (FLOAT x)
+{
+ return __m81_u(M_SUF (__tanh)) (x);
+}
+declare_mgen_alias (__tanh, tanh)
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanhf.c b/sysdeps/m68k/m680x0/fpu/s_tanhf.c
index 1addaae4ff..40f45a2fd7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanhf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanhf.c
@@ -1,2 +1,2 @@
-#define FUNC tanhf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_tanh_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanhl.c b/sysdeps/m68k/m680x0/fpu/s_tanhl.c
index 6e997911f2..72f4d8f1bc 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanhl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanhl.c
@@ -1,2 +1,2 @@
-#define FUNC tanhl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tanh_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanl.c b/sysdeps/m68k/m680x0/fpu/s_tanl.c
index 27daf8f29b..099dbfde7d 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanl.c
@@ -1,2 +1,2 @@
-#define FUNC tanl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc.c b/sysdeps/m68k/m680x0/fpu/s_trunc.c
index 96f29a776c..a9f0c4b9db 100644
--- a/sysdeps/m68k/m680x0/fpu/s_trunc.c
+++ b/sysdeps/m68k/m680x0/fpu/s_trunc.c
@@ -1,2 +1,2 @@
-#define FUNC trunc
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_trunc_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc_template.c b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c
new file mode 100644
index 0000000000..39a6822cfb
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c
@@ -0,0 +1,26 @@
+/* Implement trunc for m68k.
+ Copyright (C) 1996-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__trunc) (FLOAT x)
+{
+ return __m81_u(M_SUF (__trunc)) (x);
+}
+declare_mgen_alias (__trunc, trunc)
diff --git a/sysdeps/m68k/m680x0/fpu/s_truncf.c b/sysdeps/m68k/m680x0/fpu/s_truncf.c
index 44dca748ca..65474c779b 100644
--- a/sysdeps/m68k/m680x0/fpu/s_truncf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_truncf.c
@@ -1,2 +1,2 @@
-#define FUNC truncf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_trunc_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_truncl.c b/sysdeps/m68k/m680x0/fpu/s_truncl.c
index 8d35777aed..cbb87540cf 100644
--- a/sysdeps/m68k/m680x0/fpu/s_truncl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_truncl.c
@@ -1,2 +1,2 @@
-#define FUNC truncl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_trunc_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_exp2f.c b/sysdeps/m68k/m680x0/fpu/w_exp2f.c
new file mode 100644
index 0000000000..583065d12a
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_exp2f.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_exp2f.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_expf.c b/sysdeps/m68k/m680x0/fpu/w_expf.c
new file mode 100644
index 0000000000..b5fe164520
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_expf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_log2f.c b/sysdeps/m68k/m680x0/fpu/w_log2f.c
new file mode 100644
index 0000000000..3f5c71cec2
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_log2f.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_log2f.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_logf.c b/sysdeps/m68k/m680x0/fpu/w_logf.c
new file mode 100644
index 0000000000..ea48d1356e
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_logf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_logf.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_powf.c b/sysdeps/m68k/m680x0/fpu/w_powf.c
new file mode 100644
index 0000000000..d133216f5b
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_powf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_powf.c>
diff --git a/sysdeps/m68k/m680x0/lshift.S b/sysdeps/m68k/m680x0/lshift.S
index b5f5f74ac2..bba11c46dc 100644
--- a/sysdeps/m68k/m680x0/lshift.S
+++ b/sysdeps/m68k/m680x0/lshift.S
@@ -1,6 +1,6 @@
/* mc68020 __mpn_lshift -- Shift left a low-level natural-number integer.
-Copyright (C) 1996-2016 Free Software Foundation, Inc.
+Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/m68020/addmul_1.S b/sysdeps/m68k/m680x0/m68020/addmul_1.S
index 2c94465cb1..2eee6d1543 100644
--- a/sysdeps/m68k/m680x0/m68020/addmul_1.S
+++ b/sysdeps/m68k/m680x0/m68020/addmul_1.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
the result to a second limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/m68020/atomic-machine.h b/sysdeps/m68k/m680x0/m68020/atomic-machine.h
index 24bc5c5ef7..1bc695d418 100644
--- a/sysdeps/m68k/m680x0/m68020/atomic-machine.h
+++ b/sysdeps/m68k/m680x0/m68020/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2003.
@@ -47,6 +47,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
({ __typeof (*(mem)) __ret; \
__asm __volatile ("cas%.b %0,%2,%1" \
@@ -73,7 +76,7 @@ typedef uintmax_t uatomic_max_t;
__typeof (mem) __memp = (mem); \
__asm __volatile ("cas2%.l %0:%R0,%1:%R1,(%2):(%3)" \
: "=d" (__ret) \
- : "d" (newval), "r" (__memp), \
+ : "d" ((__typeof (*(mem))) (newval)), "r" (__memp), \
"r" ((char *) __memp + 4), "0" (oldval) \
: "memory"); \
__ret; })
@@ -101,8 +104,9 @@ typedef uintmax_t uatomic_max_t;
__asm __volatile ("1: cas2%.l %0:%R0,%1:%R1,(%2):(%3);" \
" jbne 1b" \
: "=d" (__result) \
- : "d" (newvalue), "r" (__memp), \
- "r" ((char *) __memp + 4), "0" (__result) \
+ : "d" ((__typeof (*(mem))) (newvalue)), \
+ "r" (__memp), "r" ((char *) __memp + 4), \
+ "0" (__result) \
: "memory"); \
} \
__result; })
@@ -144,7 +148,7 @@ typedef uintmax_t uatomic_max_t;
" cas2%.l %0:%R0,%1:%R1,(%3):(%4);" \
" jbne 1b" \
: "=d" (__result), "=&d" (__temp) \
- : "d" (value), "r" (__memp), \
+ : "d" ((__typeof (*(mem))) (value)), "r" (__memp), \
"r" ((char *) __memp + 4), "0" (__result) \
: "memory"); \
} \
@@ -175,8 +179,9 @@ typedef uintmax_t uatomic_max_t;
" cas2%.l %0:%R0,%1:%R1,(%3):(%4);" \
" jbne 1b" \
: "=d" (__oldval), "=&d" (__temp) \
- : "d" (value), "r" (__memp), \
- "r" ((char *) __memp + 4), "0" (__oldval) \
+ : "d" ((__typeof (*(mem))) (value)), \
+ "r" (__memp), "r" ((char *) __memp + 4), \
+ "0" (__oldval) \
: "memory"); \
} \
})
diff --git a/sysdeps/m68k/m680x0/m68020/mul_1.S b/sysdeps/m68k/m680x0/m68020/mul_1.S
index 8b1c27e578..2d7720672e 100644
--- a/sysdeps/m68k/m680x0/m68020/mul_1.S
+++ b/sysdeps/m68k/m680x0/m68020/mul_1.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_mul_1 -- Multiply a limb vector with a limb and store
the result in a second limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/m68020/string_private.h b/sysdeps/m68k/m680x0/m68020/string_private.h
index 6846663811..3c372a18b3 100644
--- a/sysdeps/m68k/m680x0/m68020/string_private.h
+++ b/sysdeps/m68k/m680x0/m68020/string_private.h
@@ -1,5 +1,5 @@
/* Define _STRING_ARCH_unaligned. m680x0 version, x >= 2.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 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
diff --git a/sysdeps/m68k/m680x0/m68020/submul_1.S b/sysdeps/m68k/m680x0/m68020/submul_1.S
index 5ec3064a6c..edb0975e6d 100644
--- a/sysdeps/m68k/m680x0/m68020/submul_1.S
+++ b/sysdeps/m68k/m680x0/m68020/submul_1.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
the result from a second limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/rshift.S b/sysdeps/m68k/m680x0/rshift.S
index 6e351d4fc6..db9d60b3db 100644
--- a/sysdeps/m68k/m680x0/rshift.S
+++ b/sysdeps/m68k/m680x0/rshift.S
@@ -1,6 +1,6 @@
/* mc68020 __mpn_rshift -- Shift right a low-level natural-number integer.
-Copyright (C) 1996-2016 Free Software Foundation, Inc.
+Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/sub_n.S b/sysdeps/m68k/m680x0/sub_n.S
index e62772ad56..5e7732e3af 100644
--- a/sysdeps/m68k/m680x0/sub_n.S
+++ b/sysdeps/m68k/m680x0/sub_n.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
store difference in a third limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/sysdep.h b/sysdeps/m68k/m680x0/sysdep.h
index e53887786e..5430f4236e 100644
--- a/sysdeps/m68k/m680x0/sysdep.h
+++ b/sysdeps/m68k/m680x0/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for m680x0.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 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
diff --git a/sysdeps/m68k/memchr.S b/sysdeps/m68k/memchr.S
index a29b9a3aed..89cd8f6e91 100644
--- a/sysdeps/m68k/memchr.S
+++ b/sysdeps/m68k/memchr.S
@@ -1,7 +1,7 @@
/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in the
first N bytes of STR.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/memcopy.h b/sysdeps/m68k/memcopy.h
index 33a20640cf..58569c61c2 100644
--- a/sysdeps/m68k/memcopy.h
+++ b/sysdeps/m68k/memcopy.h
@@ -1,5 +1,5 @@
/* memcopy.h -- definitions for memory copy functions. Motorola 68020 version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/m68k/memusage.h b/sysdeps/m68k/memusage.h
index c1e78e3591..eb88e203d7 100644
--- a/sysdeps/m68k/memusage.h
+++ b/sysdeps/m68k/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 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
diff --git a/sysdeps/m68k/nptl/Makefile b/sysdeps/m68k/nptl/Makefile
index 8b445c019d..97126b5971 100644
--- a/sysdeps/m68k/nptl/Makefile
+++ b/sysdeps/m68k/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# Copyright (C) 2010-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
#
diff --git a/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h b/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..53e2d01db8
--- /dev/null
+++ b/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
+
+ 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
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T 36
+#define __SIZEOF_PTHREAD_MUTEX_T 24
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Data structure for mutex handling. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+#define __PTHREAD_MUTEX_USE_UNION 1
+
+#define __LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
+#define __ONCE_ALIGNMENT __attribute__ ((__aligned__ (4)))
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers __attribute__ ((__aligned__ (4)));
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ int __cur_writer;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/m68k/nptl/bits/pthreadtypes.h b/sysdeps/m68k/nptl/bits/pthreadtypes.h
deleted file mode 100644
index d8faa7a000..0000000000
--- a/sysdeps/m68k/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
-
- 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
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <endian.h>
-
-#define __SIZEOF_PTHREAD_ATTR_T 36
-#define __SIZEOF_PTHREAD_MUTEX_T 24
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 32
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 20
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is
- deliberately not exposed. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is deliberately not exposed. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock __attribute__ ((__aligned__ (4)));
- unsigned int __count;
- int __owner;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock __attribute__ ((__aligned__ (4)));
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int __attribute__ ((__aligned__ (4))) pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock __attribute__ ((__aligned__ (4)));
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- int __writer;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align __attribute__ ((__aligned__ (4)));
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/m68k/nptl/bits/semaphore.h b/sysdeps/m68k/nptl/bits/semaphore.h
index b5b56daec9..56c1fb3cee 100644
--- a/sysdeps/m68k/nptl/bits/semaphore.h
+++ b/sysdeps/m68k/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/nptl/pthread-offsets.h b/sysdeps/m68k/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..9617354dc7
--- /dev/null
+++ b/sysdeps/m68k/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/m68k/nptl/pthreaddef.h b/sysdeps/m68k/nptl/pthreaddef.h
index f3299d0b7d..68fc37a394 100644
--- a/sysdeps/m68k/nptl/pthreaddef.h
+++ b/sysdeps/m68k/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/nptl/tcb-offsets.sym b/sysdeps/m68k/nptl/tcb-offsets.sym
index b1bba65868..241fb8b47c 100644
--- a/sysdeps/m68k/nptl/tcb-offsets.sym
+++ b/sysdeps/m68k/nptl/tcb-offsets.sym
@@ -7,5 +7,4 @@
#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
diff --git a/sysdeps/m68k/nptl/tls.h b/sysdeps/m68k/nptl/tls.h
index f93228212b..53be3a02cc 100644
--- a/sysdeps/m68k/nptl/tls.h
+++ b/sysdeps/m68k/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/m68k version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
@@ -26,17 +26,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -144,6 +134,7 @@ extern void * __m68k_read_tp (void);
# define NO_TLS_OFFSET -1
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/m68k/preconfigure b/sysdeps/m68k/preconfigure
index 94fc1aabc2..1028dac080 100644
--- a/sysdeps/m68k/preconfigure
+++ b/sysdeps/m68k/preconfigure
@@ -13,5 +13,9 @@ m68k) variant=`(echo "#ifdef __mcoldfire__"
echo >&2 "Cannot determine m68k processor variant"
exit 1
fi
- base_machine=m68k machine=m68k/$variant ;;
+ base_machine=m68k machine=m68k/$variant
+ if test "$variant" = "coldfire"; then
+ with_fp_cond="defined __mcffpu__"
+ fi
+ ;;
esac
diff --git a/sysdeps/m68k/rawmemchr.S b/sysdeps/m68k/rawmemchr.S
index 70baab679c..3fba31ec4f 100644
--- a/sysdeps/m68k/rawmemchr.S
+++ b/sysdeps/m68k/rawmemchr.S
@@ -1,6 +1,6 @@
/* rawmemchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/setjmp.c b/sysdeps/m68k/setjmp.c
index 9c080ea937..650367f795 100644
--- a/sysdeps/m68k/setjmp.c
+++ b/sysdeps/m68k/setjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 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
diff --git a/sysdeps/m68k/sotruss-lib.c b/sysdeps/m68k/sotruss-lib.c
index 609536c4bc..e6988379d3 100644
--- a/sysdeps/m68k/sotruss-lib.c
+++ b/sysdeps/m68k/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for m68k.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/m68k/stackinfo.h b/sysdeps/m68k/stackinfo.h
index edf37d051c..e700508422 100644
--- a/sysdeps/m68k/stackinfo.h
+++ b/sysdeps/m68k/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 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
diff --git a/sysdeps/m68k/start.S b/sysdeps/m68k/start.S
index 36dab891f0..7bab3e1cde 100644
--- a/sysdeps/m68k/start.S
+++ b/sysdeps/m68k/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF m68k ABI.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 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
@@ -76,7 +76,7 @@ _start:
pea (%a1) /* Push address of the shared library
termination function. */
-#ifdef SHARED
+#ifdef PIC
/* Load PIC register. */
LOAD_GOT (%a5)
diff --git a/sysdeps/m68k/strchr.S b/sysdeps/m68k/strchr.S
index 758e0a441d..e2f97f97f5 100644
--- a/sysdeps/m68k/strchr.S
+++ b/sysdeps/m68k/strchr.S
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/strchrnul.S b/sysdeps/m68k/strchrnul.S
index 59645979a4..ea157555c1 100644
--- a/sysdeps/m68k/strchrnul.S
+++ b/sysdeps/m68k/strchrnul.S
@@ -1,7 +1,7 @@
/* strchrnul (str, ch) -- Return pointer to first occurrence of CH in STR
or the final NUL byte.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/symbol-hacks.h b/sysdeps/m68k/symbol-hacks.h
new file mode 100644
index 0000000000..3b5b71ccbe
--- /dev/null
+++ b/sysdeps/m68k/symbol-hacks.h
@@ -0,0 +1,21 @@
+/* Hacks needed for symbol manipulation. m68k version.
+ Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
+
+#include_next "symbol-hacks.h"
diff --git a/sysdeps/m68k/sys/ucontext.h b/sysdeps/m68k/sys/ucontext.h
index ef85368cb2..7b723d6862 100644
--- a/sysdeps/m68k/sys/ucontext.h
+++ b/sysdeps/m68k/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 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
@@ -21,87 +21,105 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
/* Type for general register. */
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 18
+#define __NGREG 18
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
+#ifdef __USE_MISC
/* Number of each register is the `gregset_t' array. */
enum
{
R_D0 = 0,
-#define R_D0 R_D0
+# define R_D0 R_D0
R_D1 = 1,
-#define R_D1 R_D1
+# define R_D1 R_D1
R_D2 = 2,
-#define R_D2 R_D2
+# define R_D2 R_D2
R_D3 = 3,
-#define R_D3 R_D3
+# define R_D3 R_D3
R_D4 = 4,
-#define R_D4 R_D4
+# define R_D4 R_D4
R_D5 = 5,
-#define R_D5 R_D5
+# define R_D5 R_D5
R_D6 = 6,
-#define R_D6 R_D6
+# define R_D6 R_D6
R_D7 = 7,
-#define R_D7 R_D7
+# define R_D7 R_D7
R_A0 = 8,
-#define R_A0 R_A0
+# define R_A0 R_A0
R_A1 = 9,
-#define R_A1 R_A1
+# define R_A1 R_A1
R_A2 = 10,
-#define R_A2 R_A2
+# define R_A2 R_A2
R_A3 = 11,
-#define R_A3 R_A3
+# define R_A3 R_A3
R_A4 = 12,
-#define R_A4 R_A4
+# define R_A4 R_A4
R_A5 = 13,
-#define R_A5 R_A5
+# define R_A5 R_A5
R_A6 = 14,
-#define R_A6 R_A6
+# define R_A6 R_A6
R_A7 = 15,
-#define R_A7 R_A7
+# define R_A7 R_A7
R_SP = 15,
-#define R_SP R_SP
+# define R_SP R_SP
R_PC = 16,
-#define R_PC R_PC
+# define R_PC R_PC
R_PS = 17
-#define R_PS R_PS
+# define R_PS R_PS
};
/* Structure to describe FPU registers. */
-typedef struct fpregset
+typedef struct
{
int f_pcr;
int f_psr;
int f_fpiaddr;
int f_fpregs[8][3];
} fpregset_t;
+#endif
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Context to describe whole processor state. */
typedef struct
{
- int version;
- gregset_t gregs;
+ int __ctx(version);
+ gregset_t __ctx(gregs);
} mcontext_t;
-#define MCONTEXT_VERSION 1
+#ifdef __USE_MISC
+# define MCONTEXT_VERSION 1
+#endif
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
- __sigset_t uc_sigmask;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
+ sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
- long int uc_filler[201];
+ long int __glibc_reserved1[201];
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/m68k/sysdep.h b/sysdeps/m68k/sysdep.h
index 74776d81b7..0ecb3eae9f 100644
--- a/sysdeps/m68k/sysdep.h
+++ b/sysdeps/m68k/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for m68k.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 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
diff --git a/sysdeps/m68k/tls-macros.h b/sysdeps/m68k/tls-macros.h
index 5ec46d71ab..cf4a78cf97 100644
--- a/sysdeps/m68k/tls-macros.h
+++ b/sysdeps/m68k/tls-macros.h
@@ -1,5 +1,5 @@
/* Macros for accessing thread-local storage. m68k version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/tst-audit.h b/sysdeps/m68k/tst-audit.h
index 76aea5c95d..d4d7369458 100644
--- a/sysdeps/m68k/tst-audit.h
+++ b/sysdeps/m68k/tst-audit.h
@@ -1,5 +1,5 @@
/* Definitions for testing PLT entry/exit auditing. m68k version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/m68k/wcpcpy.c b/sysdeps/m68k/wcpcpy.c
index bfc659949f..b87ccb69c5 100644
--- a/sysdeps/m68k/wcpcpy.c
+++ b/sysdeps/m68k/wcpcpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
diff --git a/sysdeps/m68k/wcpcpy_chk.c b/sysdeps/m68k/wcpcpy_chk.c
index 9f408c05fe..c440af63c9 100644
--- a/sysdeps/m68k/wcpcpy_chk.c
+++ b/sysdeps/m68k/wcpcpy_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.