Commit Graph

185 Commits

Author SHA1 Message Date
Joseph Myers
ace614b8a5 soft-fp: support after-rounding tininess detection.
IEEE 754-2008 defines two ways in which tiny results can be detected,
"before rounding" (based on the infinite-precision result) and "after
rounding" (based on the result when rounded to normal precision as if
the exponent range were unbounded).  All binary operations on an
architecture must use the same choice of how tininess is detected.

soft-fp has so far implemented only before-rounding tininess
detection.  This patch adds support for after-rounding tininess
detection.  A new macro _FP_TININESS_AFTER_ROUNDING is added that
sfp-machine.h must define (soft-fp is meant to be self-contained so
the existing tininess.h files aren't used here, though the information
going in sfp-machine.h has been taken from them).  The soft-fp macros
dealing with raising underflow exceptions then handle the cases where
the choice matters specially, rounding a copy of the input to the
appropriate precision to see if a value that's tiny before rounding
isn't tiny after rounding.

Tested for mips64 using GCC trunk (which now uses soft-fp on MIPS, so
supporting exceptions and rounding modes for long double where not
previously supported - this is the immediate motivation for doing this
patch now) together with (a) a patch to sysdeps/mips/math-tests.h to
enable exceptions / rounding modes tests for long double for GCC 4.9
and later, and (b) corresponding changes applied to libgcc's soft-fp
and sfp-machine.h files.  In the libgcc context this is also tested on
x86_64 (also an after-rounding architecture) with testcases for
__float128 that I intend to add to the GCC testsuite when updating
soft-fp there.

(To be clear: this patch does not fix any glibc bugs that were
user-visible in past releases, since after-rounding architectures
didn't use soft-fp in any affected case with support for
floating-point exceptions - so there is no corresponding Bugzilla bug.
Rather, it works together with the GCC changes to use soft-fp on MIPS
to allow previously absent long double functionality to work properly,
and allows soft-fp to be used in glibc on after-rounding architectures
in cases where it couldn't previously be used.)

	* soft-fp/op-common.h (_FP_DECL): Mark exponent as possibly
	unused.
	(_FP_PACK_SEMIRAW): Determine tininess based on rounding shifted
	value if _FP_TININESS_AFTER_ROUNDING and unrounded value is in
	subnormal range.
	(_FP_PACK_CANONICAL): Determine tininess based on rounding to
	normal precision if _FP_TININESS_AFTER_ROUNDING and unrounded
	value has largest subnormal exponent.
	* soft-fp/soft-fp.h [FP_NO_EXCEPTIONS]
	(_FP_TININESS_AFTER_ROUNDING): Undefine and redefine to 0.
	* sysdeps/aarch64/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): New macro.
	* sysdeps/alpha/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/arm/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
	Likewise.
	* sysdeps/mips/mips64/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/mips/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/powerpc/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/sh/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
	Likewise.
	* sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/tile/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
	Likewise.
2014-02-12 18:27:12 +00:00
Ondřej Bílka
a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Kaz Kojima
feab239727 Add -mieee to SH sysdep-CFLAGS for older SH compilers. 2014-01-28 09:03:14 +09:00
Kaz Kojima
7d69a1b092 Regenerate SH libm-test-ulps with proper compiler options. 2014-01-27 08:50:47 +09:00
Kaz Kojima
9cadb35cbb Move SH libm-test-ulps to sysdeps/sh and regenerate it. 2014-01-25 10:22:14 +09:00
Kaz Kojima
0bad441c77 Restore ucontext ABI for soft-float sh4. 2014-01-24 12:56:12 +09:00
Kaz Kojima
7007c661ad Adjust SH specific fpu_control.h and ucontext.h files. 2014-01-23 14:22:58 +09:00
Allan McRae
d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Kaz Kojima
29618f6b74 Make soft-float sh use soft-fp fma/fmaf. 2013-12-17 09:00:05 +09:00
Kaz Kojima
8a5c7897dd Move sysdeps/sh/sh4/fpu/bits/fenv.h to sysdeps/sh/bits/. 2013-12-14 10:12:32 +09:00
Kaz Kojima
8517800fab Add SH implementation of sotruss-lib.c and c++-types.data. 2013-12-06 08:22:22 +09:00
Joseph Myers
3c1c46a64a Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
Mike Frysinger
cb8a6dbd17 rename configure.in to configure.ac
Autoconf has been deprecating configure.in for quite a long time.
Rename all our configure.in and preconfigure.in files to .ac.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-10-30 17:32:08 +10:00
Kaz Kojima
80a83dd70e Add SH implementation of stackguard-macros.h. 2013-09-27 10:59:02 +09:00
Kaz Kojima
be09e8c9ec Add sh4 implementation of fegetexceptflag. 2013-06-21 18:07:31 +09:00
Joseph Myers
9c84384cc1 Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
Siddhesh Poyarekar
b937534868 Avoid crashing in LD_DEBUG when program name is unavailable
Resolves: #15465

The program name may be unavailable if the user application tampers
with argc and argv[].  Some parts of the dynamic linker caters for
this while others don't, so this patch consolidates the check and
fallback into a single macro and updates all users.
2013-05-29 21:34:12 +05:30
Joseph Myers
b50a71810b Don't include expected results in libm-test test names. 2013-05-22 11:49:36 +00:00
Joseph Myers
db62a90753 Handle sincos with generic libm-test logic. 2013-05-19 14:45:41 +00:00
Joseph Myers
568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Thomas Schwinge
d072f3f772 sysdeps/sh/dl-machine.h: Define ELF_MACHINE_RUNTIME_FIXUP_PARAMS.
Fixes fallout from commit 2e64d2659d.
2012-11-20 19:29:23 +01:00
Joseph Myers
acfa885ff1 Fix types of FE_DFL_ENV and FE_NOMASK_ENV (bug 14805). 2012-11-05 13:38:40 +00:00
Joseph Myers
5b5b04d628 Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
Joseph Myers
fbeafedeea Make fenv.h FE_* macros usable in #if (bug 3439). 2012-11-03 17:07:56 +00:00
Joseph Myers
903252aadb Build SH backtrace with -funwind-tables. 2012-11-01 00:22:53 +00:00
Joseph Myers
2a27fd6dae Fix strtod handling of underflow (bug 14047). 2012-10-30 13:51:27 +00:00
Roland McGrath
b8493de0ec Add missing magic to GLIBC_PROVIDES. 2012-10-09 15:41:30 -07:00
Roland McGrath
93c65d4384 Clean up init-first.c files. 2012-10-01 12:55:34 -07:00
Carlos O'Donell
30f696374d Fifth argument of la_pltenter() is not constant.
The original runtime linker auditing interface described
by Solaris allows the 5th argument of la_pltenter() to be
modified. This patch cleans up the ldsodefs.h definitions
such that the 5th argument is not constant.

At one point the 5th argument *was* constant but this was
changed with commit 2413fdba7a.
This patch updates alpha, ia64, mips, sh and sparc with similar
changes.
2012-08-16 08:41:05 -07:00
Marek Polacek
b67e9372b2 Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
Joseph Myers
3129cfc6ec Move testsuite audit definitions to sysdeps tst-audit.h files. 2012-07-26 11:29:07 +00:00
Joseph Myers
56e49b714e Move ldsodefs.h audit definitions to sysdeps directories. 2012-07-25 16:03:02 +00:00
Marek Polacek
3b05db33f6 Remove TLS configure checks. 2012-07-17 23:57:43 +02:00
Joseph Myers
cfc82fd8ac Split tls-macros.h into sysdeps directories. 2012-07-17 11:30:58 +00:00
Marek Polacek
7b8e0d49cb Get rid of ASM_GLOBAL_DIRECTIVE. 2012-07-10 14:30:24 +02:00
Thomas Schwinge
a9fa33ba8b Some missing bits from sysdeps/*/elf dismissal.
This fixes up commits 735095ae95,
09ae94c11b, and
ff962fb6a1.
2012-06-23 12:27:58 +02:00
Thomas Schwinge
58f902b8d8 SH: Preserve more registers for frame unwinding purposes, add CFI directives. 2012-06-23 12:11:13 +02:00
Thomas Schwinge
1518f58b61 SH: Optimize assembler code in context of call to __fortify_fail.
__fortify_fail has »__attribute__ ((__noreturn__))«.
2012-06-23 12:07:04 +02:00
Thomas Schwinge
967705fee1 SH: ABORT_INSTRUCTION. 2012-06-23 11:47:39 +02:00
Thomas Schwinge
99ff6e5c49 SH: No FE_UPWARD, FE_DOWNWARD. 2012-06-09 18:46:01 +02:00
Thomas Schwinge
366af02c96 SH: Do not re-write fpscr after reading it. 2012-06-09 18:36:52 +02:00
Thomas Schwinge
04fb54b507 SH: Use fpu_control_t for the temporary FPU control word. 2012-05-28 01:03:18 +02:00
Kaz Kojima
3f99608f82 SH: feraiseexcept: Restore fpscr flag fields. 2012-05-28 01:02:34 +02:00
Chung-Lin Tang
65a4de4e06 SH: Add CFI directives. 2012-05-28 00:11:06 +02:00
Chung-Lin Tang
3ce2865f93 SH: Replace <endian.h> usage with pre-processor macros.
Follow-up to f8887d0a5f.
2012-04-25 14:39:28 +08:00
Kaz Kojima
f402708f8a Fix return value of SH fesetround. 2012-04-05 11:58:30 +09:00
Kaz Kojima
2ecccfc97a Set SH fpcsr register which read again. 2012-04-05 11:57:03 +09:00
Kaz Kojima
8a53f50f2a Fix SH4 fraiseexcpt so to generate exceptions appropriately. 2012-04-05 11:53:49 +09:00
Kaz Kojima
15a946b57a Add support fedisableexcept, feenableexcept, fegetexcept and feupdateenv
for SH.
2012-04-05 11:43:30 +09:00
Thomas Schwinge
228c019e63 Call __ctype_init in early glibc startup.
This adds the bits missing from fd5bdc0924.
2012-04-02 22:26:43 +02:00