Commit Graph

723 Commits

Author SHA1 Message Date
joerg
b32c7c5ab8 Add -mfpu=vfp for fenv.c, since it gets those instructions from
machdep/armreg.h
2014-08-10 20:48:34 +00:00
isaki
ef13227625 Improve the code. %sp@(4) is already loaded in %fp0.
PR/49083 (2)
2014-08-10 13:30:43 +00:00
isaki
914e175cb7 Remove a meaningless conditional branch.
PR/49083 (1)
2014-08-10 13:29:10 +00:00
matt
547b3a3b01 Changes to existing files to enable building AARCH64 userland.
evbarm64-el
This is clang only.  While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
2014-08-10 05:56:36 +00:00
matt
beb9c6d1b5 Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
2014-08-10 05:47:35 +00:00
joerg
13b8fa7d71 Add modfl(3). From FreeBSD. 2014-06-16 12:54:42 +00:00
mrg
26f35dd6b6 remove the build support for GCC 4.1, and any hacks i found for it.
there could still be more -- i only looked for lines matching
both "HAVE_GCC" and "4" as words (grep -w.)
2014-06-13 01:17:45 +00:00
martin
3313ae3d61 Re-enable alpha IEEE compiler options 2014-05-18 10:47:03 +00:00
martin
fb80a335f8 Comment out the ieee fp flags for alpha for now - something (tm) is not
working right, see PR port-alpha/48782.
2014-05-05 18:08:32 +00:00
martin
511cd1dbe5 Tune COPTS for alpha 2014-04-28 08:46:35 +00:00
christos
ff9eccbdec add -g to LINTFLAGS 2014-04-01 19:12:37 +00:00
martin
6d0fe06315 Avoid strict aliasing problems 2014-03-23 15:26:47 +00:00
dsl
3a9ebe222a Change 'i0' to be signed so that the sign bit is preserved on 'k'
and the code at the bottom splits the multiply.
Fixes denormal results.
This might have been introduced when I deferred shifting 'k' left.
2014-03-18 21:52:19 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
dsl
0f547b99f1 Simplify somewhat: this is C not FORTRAN-IV - we have structures!
Directly us 'ieee_double_shape_type' when ripping apart the fp number
  to avoid an extra store-load in 'STRICT_ASSIGN'.
Keep 'k' as the exponent, only do 'k << 20' when generating the fp number
  from it.
Fix infinity and underflow returns on i386 - because the value is returned
  in %st0 (x87 stack) we have to generate a long double error value.
The returned value for integers -1023 and below (which should be denormal
  fp valuesr) are 'just plain wrong' (tm).
2014-03-16 22:44:48 +00:00
dsl
ec1660cff5 Fix overflow and underflow on i386.
The return value of a 'float' function is in the x87 %st(0) register.
This is an 80bit 'long double' register.
If you multiply 0x1p100f by 0x1p100f the caller sees 0x1p200 - not the
  expected infinity.
So use a 'double' value which goes through a store-load sequence to generate
  the required exception and value.
2014-03-16 22:30:43 +00:00
martin
16e71f2a62 Add roundl() 2014-03-16 10:02:27 +00:00
martin
d30e39112d Provide all missing variants of trunc/floor/ceil. 2014-03-16 09:51:39 +00:00
martin
03e412de5e Need to load the full argument 2014-03-15 14:12:56 +00:00
martin
89434fa764 Provide copysignf and copysignl 2014-03-15 12:20:09 +00:00
dsl
092f718fed There is some very odd code in s_exp2.c that only works if 'double'
values are rounded to 53 bit mantissa in teh x87 registers.
This hasn't been true since Nov 11 2013.
Forcing a store-load for 'double' in STRICT_ASSIGN() seems to fix things
  (at least enough for the few random test cases).
I suspect the code could be changed so that the number of mantissa bits
  didn't matter.
2014-03-14 22:21:31 +00:00
martin
7a17404a6d XXX This is all wrong and needs new tables and constants - but at least use
constants in the VAX double range for now, so it is compilable with newer
gcc.
2014-03-12 19:42:18 +00:00
martin
ed95e9602b Include new/missing files for vax 2014-03-06 11:01:16 +00:00
martin
74530a2d26 Provide sqrtl alias 2014-03-06 11:00:17 +00:00
martin
f03b314bc0 Simple tanf() for vax 2014-03-06 10:59:52 +00:00
martin
ea3fa8f391 Simplistic tanhf() for vax 2014-03-06 10:59:00 +00:00
martin
96c6725640 Simplistic log1pf() for vax 2014-03-06 10:58:26 +00:00
martin
ae998fcbfa log10f() for vax 2014-03-06 10:57:44 +00:00
martin
d408a8629c log2() for vax 2014-03-06 10:57:01 +00:00
martin
13958f72dc Add brute-force adaptions of the ieee version of exp2() and exp2f for
vax. Needs some polishing (and table adaption), but should get the build
going for now.
2014-03-06 10:55:57 +00:00
dsl
77e93a9cb9 Drop in a fabs() after the fsqrt().
While it may seem pointless, it the rouding mode is set to round towards
minus infinity then acos(-1) calculates atan2(sqrt(1.0 - 1.0), -1) the subtract
generates -0.0 which sqrt() preserves.
atan2(-0, -1) is -pi, but acos(-1) is expected to be +pi.
This might 'fix' the test failures seen in some environments, but they
are not failing due to an obvously incorrent x87 rounding mode.
2014-03-03 08:00:50 +00:00
joerg
a48c968746 Update compiler-rt glue for the new source layout. 2014-02-26 22:37:55 +00:00
martin
39ae3c2126 Provide scalbnl, scalbnf, logbl, logbf, fmaxl for vax. 2014-02-03 21:22:21 +00:00
joerg
1b87ac407e For ancient GCC, disable the missing prototype warning completely. 2014-02-03 13:30:10 +00:00
joerg
69a4347a81 Restore -Wno-error for clang build. Just don't try to force GCC 4.1 for
clang, okay?
2014-01-31 22:17:50 +00:00
matt
3813b22c96 Just use EXT_EXP_INFNAN instead of EXT_EXP_INF or EXT_EXP_NAN. 2014-01-31 19:38:47 +00:00
martin
3b4c95b566 -Wno-error=missing-prototypes is not available on gcc 4.1 2014-01-31 10:35:14 +00:00
joerg
720b2586bd Include compiler-rt in libc, libm and libkern. 2014-01-29 23:37:18 +00:00
skrll
eed4dff2e8 Add various functions which need fenv support to arm. 2014-01-18 17:20:36 +00:00
joerg
07d3f56792 Use normal style for checking for long double support. Add missing
aliases for fminl and fmaxl, fabsl is here just for symmetry.
2013-11-29 22:16:10 +00:00
martin
3807220809 Provide expm1f() 2013-11-24 18:50:58 +00:00
martin
56e076908e Provide erff() and erfcf(). 2013-11-24 15:16:49 +00:00
martin
d506da106c Provide cbrtl() and cbrtf() for vax 2013-11-24 15:12:10 +00:00
martin
707fcaf05d Provide cbrtf() and cbrtl() 2013-11-24 14:49:00 +00:00
martin
8a90528455 Provide powl() 2013-11-24 14:46:18 +00:00
martin
d8880f8387 Provide (very stupid) versions of atanf(), asinf() and acosf() 2013-11-24 14:41:53 +00:00
martin
f4e3824c84 For the non-fenv archs: just use double - punt 2013-11-22 20:15:06 +00:00
martin
e37a907951 Try to fix the build (again): move e_sqrtl.c to common soure, but
move the include of fenv.h into the #ifdef __HAVE_LONG_DOUBLE block
and also provide a -DHAVE_FENV_H from the makefile for archs that have
it - leaving out exception settings on architectures that do not provide
it.
2013-11-22 13:37:24 +00:00
martin
b2718b01b0 Fix stupid bug in previous (fixing fmodf) 2013-11-22 10:59:31 +00:00
martin
497f604871 Fix copy & pasto (make temp variable long double).
Fixes fmodl() test failure on sparc64
2013-11-21 13:41:10 +00:00
martin
d2eda6d998 e_sqrtl.c requires fenv.h, so only build it on platfomrs supporting that 2013-11-21 11:21:54 +00:00
martin
cd0bb19b28 Add fmodf and fmodl 2013-11-21 10:48:11 +00:00
martin
42e0203237 Make it compile on archs with implicit NBIT 2013-11-20 21:12:30 +00:00
joerg
f1faa48b8c Fix operand order. 2013-11-20 12:29:13 +00:00
joerg
f20cb70dbc Long double conditional. 2013-11-20 11:39:00 +00:00
joerg
f63f9867dd Add cbrtl(3) and sqrtl(3), from FreeBSD. 2013-11-19 19:24:33 +00:00
joerg
4281b1a8f9 Report correct exception for fmodl. 2013-11-19 14:04:24 +00:00
joerg
af35a9928f Alias to fmod for platforms with double == long double 2013-11-19 14:02:59 +00:00
martin
6aa2ab9e22 Make it compile on archs with implicit NBIT 2013-11-14 15:25:22 +00:00
wiz
a987b5b309 Add missing comma. 2013-11-13 22:11:52 +00:00
joerg
bc2f32b2d9 truncl(3) 2013-11-13 22:09:55 +00:00
joerg
cbc2f8caeb Add FreeBSD's truncl and minimal testing. 2013-11-13 12:58:11 +00:00
joerg
e53a269b0d Add missing __HAVE_LONG_DOUBLE protection. 2013-11-13 01:03:08 +00:00
joerg
3988594e8b Typo. 2013-11-12 17:37:43 +00:00
joerg
06b4b3a613 Add some fake long double -> double wrappers for various transcendental
functions. They are expected to be implement properly at a later time.
2013-11-12 17:36:14 +00:00
joerg
d0d4402155 Initial version of fmodl from FreeBSD.
Basic test case for the fmod family.
2013-11-12 16:48:39 +00:00
joerg
80f3dc5a69 Man page entries for ceill, floorl and roundl. 2013-11-12 00:10:29 +00:00
joerg
2e412cf6b8 Add initial version of ceill, floorl and roundl from FreeBSD. 2013-11-11 23:57:34 +00:00
joerg
0c8d18a9b2 Preserve the initial x87 control word in the global FP environment
in preparation for adjusting the default based on the main binary
version.
2013-11-11 00:31:51 +00:00
christos
25dc998745 fix unused variable warnings 2013-11-09 21:41:03 +00:00
christos
6c5b63c739 simplify. 2013-11-06 16:49:21 +00:00
christos
eca2236bd9 use the masked variable 2013-10-18 17:03:02 +00:00
joerg
50850b07af Hook complex operation support into libm when not using libgcc. 2013-10-15 23:59:36 +00:00
joerg
3657cb7f1d Update LLVM/Clang snapshot to r191105. This brings in a better detection
of unused static variables and functions. Disable this for some external
code and for ioconf.c in the kernel.
2013-09-21 22:28:12 +00:00
joerg
4d12bfcd15 Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
2013-09-12 15:36:14 +00:00
martin
4d09747fe0 s_nexttoward.c does not make sense compiling for 32 bit sparc (double ==
long double), so ifdef it out in the sparc64 compat library build. I hope
the nextafter alias is set up correctly (where?) - and someone please
suggest a better way for this if clause.
2013-08-22 08:24:30 +00:00
martin
cf61cf5c2c Add nexttoward, nearbyint and rintl for sparc64 2013-08-21 13:06:00 +00:00
martin
317c06397c Add support for the long double format used on sparc64 2013-08-21 13:04:44 +00:00
martin
24488e4c56 Add support for archs with LDBL_IMPLICIT_NBIT 2013-08-21 13:03:56 +00:00
matt
f28360367c If __HAVE_LONG_DOUBLE is not defined,
add a strong alias for nextafterl to nextafter
2013-07-18 22:32:53 +00:00
matt
6bcb6c9e28 Only compile is __HAVE_LONG_DOUBLE is defined 2013-07-18 22:31:13 +00:00
christos
5101b66eab Add missing .go and fix lint rule. 2013-06-20 19:49:47 +00:00
riastradh
5cb75bff7e Fix amd64 feraiseexcept so that it actually traps.
The call to fwait got lost somewhere along the line; the i387 code
has it.

XXX pullup to 6
2013-05-29 02:27:39 +00:00
riastradh
0eddede86f Fix sense of fegetexcept on x86.
Somehow I overlooked this when I fixed feenableexcept and
fedisableexcept last summer.

XXX pullup to 6
2013-05-29 00:53:19 +00:00
martin
56f02cd141 Fix POLYD/Mariah fallout and include the scalbn sources (which do not
use polyd).
Fix global names and weak aliases.
2013-05-24 12:45:40 +00:00
mlelstv
bec369833b Correctly alias the ldexp* functions to the scalbn equivalents
that take an int argument.
2013-05-20 20:27:43 +00:00
joerg
65098ec1a4 Fix ldexp aliases. 2013-05-20 19:40:09 +00:00
mlelstv
d896c3b677 Use correct alias for scalbn(). Tested by martin@. 2013-05-20 15:13:36 +00:00
martin
6883e0df33 Try to fix bogus underflow test (obvious copy & pasto) - someone please
review to make sure I got it right.
This fixes PR 47834.
2013-05-19 20:50:02 +00:00
matt
8f0edf9e8a Fix feclearexcept return value (should be 0). 2013-05-01 04:04:54 +00:00
matt
745c75b88e Use MKSOFTFLOAT = no for including arm hardfloat files.
When arm and MKSOFTFLOAT = yes, make explicit dependency to .c files
so .S won't be used.
2013-05-01 04:04:31 +00:00
joerg
56cae1058e Provide scalbln weak alias. Fix argument order for STRONG_ALIAS.
Expect WEAK_ALIAS and STRONG_ALIAS to exist.
2013-04-30 21:55:31 +00:00
matt
194fd46747 Make this compile for earmhf 2013-04-30 01:45:13 +00:00
matt
bc08020c0d Add a C99 <fenv.h> implementation for arm. 2013-04-28 21:06:34 +00:00
joerg
c13cb064fe Drop s_scalbnl.c (and s_scalbln.S as side effect) and provide scalbnl in
s_scalbln.c.
2013-04-28 14:46:14 +00:00
joerg
560a52b9a0 Retire ldexp sources. scalbn has the aliases. 2013-04-27 22:58:15 +00:00
joerg
bc802c017d Add a dummy s_scalbln.S to avoid the generic implementations of scalbln
and co on i386 and amd64. They are implemented next to scalbn and co.
2013-04-27 18:44:39 +00:00
joerg
877d9fe29e Add aliases to scalbn* as ldexp*, they are identical for FLT_RADIX=2. 2013-04-27 18:43:25 +00:00
joerg
5204c9072e Add aliases for scalbn* to ldexp, they are identical for FLT_RADIX=2. 2013-04-27 18:39:28 +00:00
joerg
d816b4de58 Use the correct register on AMD64 for the argument. 2013-04-27 18:36:41 +00:00
joerg
c3a587caac Move scalbnl back to s_scalbln.c to match the assembler implementations. 2013-04-27 17:20:36 +00:00
joerg
a3f958023b Casting is a not a valid way to check for overflow, so be explicit and
use the limit macros.
2013-04-27 17:19:47 +00:00
joerg
4dfc9ad094 Use namespace.h. Don't redefine scalblnl on 64bit platforms. 2013-04-27 16:43:13 +00:00
njoly
1a8ac39140 Kill some extra backslashes. 2013-04-26 18:18:22 +00:00
uebayasi
bad3256eeb Pass a real file as MLINKS target; fix unnecessary (re)install. 2013-04-06 12:16:49 +00:00
njoly
0f84e47820 Remove unknown .LP macro. 2013-03-14 19:15:34 +00:00
matt
e443b7748e Remove .fpu since it's not needed 2013-02-14 09:27:26 +00:00
matt
0748121219 Use right macro for __strong_alias 2013-02-14 09:24:50 +00:00
matt
5d4ceff81f Define a strong alias, not a weak one 2013-02-14 09:23:40 +00:00
matt
b25c1339c3 Deal with an implicit NBIT 2013-02-14 08:56:56 +00:00
martin
905b216648 Use __HAVE_LONG_DOUBLE instead of EXT_EXPBITS and include s_nextafterl.c
as well as s_frexpl.c in the global list of "common" sources - as we
seem to have no arch redefining the standard double variant, it seems
unlikely we will have on redefining the long double version in assembler.
2013-02-12 21:40:18 +00:00
martin
1bdd60c0cc Use __weak_alias instead of __weak_reference (obvious pasto) 2013-02-12 08:21:48 +00:00
matt
0d613952ce Fix the strong alias correctly this time. 2013-02-12 02:52:13 +00:00
matt
9aeffda480 any arch that has fenv.[ch] can have fma as well (since fma uses fenv). 2013-02-11 17:55:01 +00:00
matt
04ec087c22 Add fma/fmaf/fmal for arm hard float which uses the VFP vmla instruction. 2013-02-11 17:41:13 +00:00
matt
6567e38835 Add VFP versions of lrint/lrintf/lrintl for earmhf* 2013-02-11 12:43:03 +00:00
matt
bec7d6b6c4 Fix strong_alias 2013-02-11 04:57:22 +00:00
christos
e2402e5654 use __HAVE_LONG_DOUBLE 2013-02-11 02:45:27 +00:00
christos
3884ecde09 provide ldexpl 2013-02-11 02:45:15 +00:00
christos
be32181245 add more functions required by fma 2013-02-11 01:47:04 +00:00
christos
2ee19bcb19 more stuff from FreeBSD 2013-02-11 01:38:10 +00:00
christos
e3f9b211a9 hook fma to the build 2013-02-11 01:29:58 +00:00
matt
3a4e9cb991 Add long double version of x86 scalb functions 2013-02-11 01:19:33 +00:00
christos
ff820d76df bring in fma from FreeBSD 2013-02-11 00:49:23 +00:00
christos
076b167207 make these only work for things that have EXT_ foo definitions. 2013-02-09 23:14:44 +00:00
matt
9074d59336 Use FP_ILOGB0 and FP_ILOGBNAN 2013-02-09 22:56:00 +00:00
christos
afdc807ef9 Hook to the build. 2013-02-09 22:33:13 +00:00
christos
60e078850a FreeBSD version 2013-02-09 22:32:47 +00:00
christos
ee48b743e7 Make this work for NetBSD 2013-02-09 20:19:13 +00:00
christos
80388058ff one more 2013-02-09 19:39:01 +00:00
christos
be721c1dad add FreeBSD implementations. 2013-02-09 19:37:48 +00:00
matt
c31c561dde Add support for the ARM hardfloat instructions vsqrt and vabs. 2013-02-03 07:13:07 +00:00
matt
52af3052a7 Document the long double versions. 2013-01-29 02:54:30 +00:00
matt
d6b3d22ed9 Document long double versions of these routines. 2013-01-29 02:05:08 +00:00
pgoyette
5bbb1e2022 Add missing ';' to fix the build. 2013-01-28 14:09:43 +00:00
matt
81629d5d17 Deal with _LP64 properly. 2013-01-28 06:34:09 +00:00
matt
0e9f9224ed Add long double aliases 2013-01-28 06:26:20 +00:00
wiz
aea943bc0e Convert to mdoc and fix stuff while here. 2012-12-27 21:34:09 +00:00
njoly
8f831e5efb Add No macro to ensure that "and" word is not taken as function
argument.
2012-11-10 15:59:58 +00:00
dholland
449e13d08d proofreading 2012-11-06 21:43:37 +00:00
matt
e4c3811f58 Fix copyright. 2012-08-08 16:58:28 +00:00
matt
c79f17b998 Add a long double version of trunc. 2012-08-08 16:57:24 +00:00
matt
57a1ba1789 Use COPTS instead of CFLAGS 2012-08-04 15:16:16 +00:00
riastradh
3a4a1ac26a Mask off the result of feenableexcept and fedisableexcept on x86.
These shouldn't return bits outside FE_ALL_EXCEPT.
2012-08-04 03:53:55 +00:00
abs
7d974f9a82 ANSI prototypes 2012-06-08 11:13:33 +00:00
christos
a898920ce2 Add tgamma{,f} from FreeBSD via rudolf, netbsd at eq dot cz 2012-05-05 17:54:13 +00:00
joerg
b757af438b Disable new -Wstring-plus-int warning where needed for now.
Adjust various places that add GCC-only options to check for the active
compiler first.
2012-04-04 10:59:44 +00:00
matt
fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
njoly
92562600d4 On alpha compile the math library with dynamic rounding mode instead
of fixed normal IEEE rounding mode. This makes function that depends on
the current rounding mode, such as rint(3), just work.
2012-03-09 08:03:53 +00:00
drochner
fc3deeb5d7 fix minor typo 2011-11-29 13:17:04 +00:00