Commit Graph

149 Commits

Author SHA1 Message Date
Lephenixnoir 8afd538dc8
add missing weak references for long double functions
This ensures that all standard long double functions are defined when
building with 64-bit long double.
2021-05-20 23:30:25 +02:00
Lephenixnoir 668336366e
merge from upstream, updated to 0.7.5 2021-05-20 21:31:25 +02:00
Lephenixnoir d241d4f77a
fix aliases not using underscore prefixes in assembler code
long double functions, that are identical to double functions, usually
define themselves as weak references to their double counterpart.
However, the piece of assembler written for that produces

  .equ <name>l, <name>

but on SuperH C-exported symbols have leading underscores. This commit
adds an SH3 exception to use instead

  .equ _<name>l, _<name>

which fixes a number of long double functions.
2021-05-20 21:27:38 +02:00
Steven G. Kargl 711654eeab
Fix incorrect results in `hypotl` near underflow
Fixes #224.
2021-02-10 12:44:19 -08:00
Viral B. Shah aeab19f47e Fix for #211
Co-authored by: @kargl
2021-02-08 09:39:30 -05:00
Viral B. Shah 98f87135b0 Fix #211
Patched by importing latest msun version
2021-02-06 18:10:09 -05:00
Viral B. Shah 40dac9dd77 Restore STRICT_ASSIGN on FreeBSD as suggested in #215
Co-authored-by: @kargl
2021-02-06 17:27:15 -05:00
Lephenixnoir 44c1cbb8eb
sh3eb: add suport for the sh3eb softfp platform 2020-10-24 13:55:39 +02:00
Lephenixnoir 1b364a5edf
sh3eb: copy files from the MIPS softfp fenv.h 2020-10-24 13:42:09 +02:00
Keno Fischer b34f107e24
Fix Apple Silicon build (#214)
My previous Apple Silicon build went through, so I thought it already
worked, but it turns out it accidentally built an armv7 build instead.
This actually fixes the Apple Silicon build. One thing to note in
particular is that on Apple Silicong `long double` is the same as
`double` while on Linux `long double` is a 128 bit double-double
format.

Co-authored-by: Elliot Saba <staticfloat@gmail.com>
2020-09-03 18:27:17 -04:00
Viral B. Shah 0276147a68
Merge pull request #209 from embeddedartistry/master
Refactor: OLM_DLLEXPORT definition now lives in a standalone header.
2020-08-29 11:12:57 -04:00
Keno Fischer 4f559d4c14
Replace a few remaining __strong_reference uses (#210)
__strong_alias is an ELF feature that is not available on Darwin/MachO.
We have openlibm_strong_reference to paper over these differences,
but we weren't using it consistently. In particular, we were still
using it to define long double -> double aliases on platforms where
these are the same type (e.g. aarch64). This didn't used to matter,
because the only such platform we supported was always Linux and
thus ELF. This patch fixes these instances thus fixing the build
on Apple Silicon.
2020-07-09 15:51:12 -04:00
Phillip Johnston 0418324ca4 Refactor: OLM_DLLEXPORT definition now lives in a standalone header.
On x86_64, openlibm_fenv.h is silently coupled to openlibm_complex.h due to the inclusion of math_private.h inside of openlibm_fenv_amd64.h. The math_private.h header was included to gain access to the OLM_DLLEXPORT macro. However, this macro is redefined, since it is originally defined in openlibm_math.h. This inclusion also exposes math_private.h to public clients, which is undesirable.

Instead, a standalone header is created to contain the OLM_DLLEXPORT definition. This header is used included in the appropriate files. openlibm_fenv_amd64.h is no longer coupled to math_private.h.
2020-06-10 15:57:08 -07:00
llucinat f952e167d2 Fix weak reference macro redefinition in wasm32 target 2019-11-14 08:41:10 +01:00
gufe44 c4dca1e84a
Add files via upload 2019-10-26 01:53:42 +02:00
gufe44 d4077aa131
Suggestions
https://github.com/JuliaMath/openlibm/pull/197#pullrequestreview-307404318
2019-10-26 01:05:27 +02:00
gufe44 ea065f90cb
Update src/cdefs-compat.h
Co-Authored-By: Jameson Nash <vtjnash@gmail.com>
2019-10-25 23:45:13 +02:00
gufe44 2080b23690
NetBSD fix 2019-10-25 18:32:47 +02:00
Daniel Mendler 72f33a3bf9 wasm32 support (#192) 2019-04-14 15:11:03 -07:00
Jeremy Soller f24b1bfe55 Fix compilation of gcc when using openlibm as system libm (#190)
For some sad reason, gcc poisons LONG_DOUBLE in sreal.c. The identifier has been changed to OLM_LONG_DOUBLE.
2019-01-14 11:53:14 -08:00
Dan Horák 2a1e56858a s390(x) port 2018-11-07 12:11:15 +01:00
Viral B. Shah 73b3d88ef1
Merge pull request #181 from CDLuminate/mipsport
Updated MIPS port
2018-06-18 16:01:04 -04:00
Radovan Birdic 4f5112ea59 Support for mips architectures
Changes needed for mips suport have been added.
Code for openlibm_fenv_mips.h, mips_fpmath.h and fenv.c
was taken from https://github.com/freebsd/freebsd
2018-06-04 09:38:27 +00:00
Jeff Walden 787652b054
msun: signed overflow in atan2
As a component of atan2(y, x), the case of x == 1.0 is farmed out to
atan(y). The current implementation of this comparison is vulnerable
to signed integer underflow (that is, undefined behavior), and it's
performed in a somewhat more complicated way than it need be. Change
it to not be quite so cute, rather directly comparing the high/low
bits of x to the specific IEEE-754 bit pattern that encodes 1.0.

Note that while there are three different e_atan* files in the
relevant directory, only this one needs fixing. e_atan2f.c already
compares against the full bit pattern encoding 1.0f, while
e_atan2l.cuses bitwise-ands/ors/nots and so doesn't require a change.

Incorporated from FreeBSD source tree. See:
b21ccf63f2
2018-04-07 10:35:06 -07:00
Alex Arslan 72bfab46a0
Avoid redefining macros defined by the system
In particular, OpenBSD already defines __GNUC_PREREQ__, __BEGIN_DECLS,
and __warn_references. Hiding the definitions behind #ifndef guards
avoids warnings when building.
2018-04-06 14:41:06 -07:00
Takuya Nakaoka d134c84e91 Fix reversed outputs of sincosl 2018-01-26 15:33:30 +09:00
Patrick Kofod Mogensen 3db5e546e4
Minor typo in expm1 comment
`exp(+-inf)={inf, 0}`, so...
2017-11-30 13:19:33 +01:00
Alex Arslan c3968ca11f Allow building on DragonFly BSD (#167) 2017-09-22 13:22:43 -07:00
Martin Lucina b5b63ba66d Enable long double functions for aarch64
Per discussion in #157, it is correct to enable these for aarch64.
2017-07-27 13:29:33 +00:00
Elliot Saba c21453060d Cleanup `ARCH` handling, reorganize `AArch64` and `Make.inc`.
* Previously, behavior differed if the same value of `ARCH` was defined
  within `Make.inc` or defined on the command line.  Don't do that.

* Provide saner defaults for `ARCH` and `MARCH`, and more importantly,
  allow for the proper overriding of both.

* Split `AArch64` code further away from the other `arm` code.
2017-01-16 11:44:14 -08:00
Keno Fischer 5fd9dcbbdf Fix incorrect attribute as a result of blanket rename 2016-05-03 18:48:45 -04:00
Keno Fischer 28fb939b0d Blanket rename DLLEXPORT->OLM_DLLEXPORT 2016-03-13 21:07:55 -04:00
Keno Fischer 81053b7fcb Fix Clang warnings on Windows
- Align DLLEXPORT in definitions and declations. There is still a few
  cases left, where the declation in the compiler's complex.h disagrees
  with the implementation here. For now we can't do anything about that,
  but maybe should be revisited in the future.
- Fix the syntax on an .ascii directive that gcc accepted mistakingly, but
  clang does not.
2016-03-13 06:21:15 +00:00
Milan Bouchet-Valat e836b30cc7 Avoid defining __pure2 if already defined
This gets rid of a warning on Mac OS X due to the fact that
sys/cdefs.h defines it already.
2016-03-08 10:34:20 +01:00
Milan Bouchet-Valat 226faf4e11 Avoid redefining __pure2 in types-compat 2016-03-03 17:05:12 +01:00
Milan Bouchet-Valat 2c3f3b5a99 Cleanup bsd_cdefs.h, merge i387 and amd64 duplicate files
Most macros were not actually used. This gets rid of warnings when
building on Linux.
2016-03-02 21:21:25 +01:00
Milan Bouchet-Valat b5ca785d4c Avoid redefining endianness macros with some gcc versions
_LITTLE_ENDIAN and _BIG_ENDIAN are built-in on some platforms/versions.
Better use __ORDER_LITTLE_ENDIAN__, __ORDER_BIG_ENDIAN__ and __BYTE_ORDER__,
which are standard for gcc and clang, and define them when they are missing.
Also remove the special-case for FreeBSD, which is apprently not needed.
2016-03-02 21:21:25 +01:00
Milan Bouchet-Valat 949c530994 Fix misleading indentation (spotted by GCC 6) 2016-03-02 21:21:25 +01:00
Ed Schouten 62c7361aab Suppress a compiler warning generated by Clang.
Clang doesn't like it if you bitshift negative numbers, as the behaviour
of it is undefined. Solve this by first shifting, followed by negating.
This was fixed similarly in FreeBSD.
2016-02-27 19:23:08 +01:00
Ed Schouten 78c0afb2a7 Rename _scan_nan() to __scan_nan().
The current tradition of openlibm is to hide all of its internal symbols
into the reserved system namespace. CloudABI has a check in place to
ensure that its C library (which contains openlibm) to not place any
unwanted symbols into the public namespace. openlibm seems to leak
_scan_nan() in there, so we'd better add an additional underscore.
2016-02-27 17:26:15 +01:00
Viral B. Shah 05f9de6c05 Revert "moved src/cdefs-compat.h -> include/cdefs-compat.h"
This reverts commit 07a535e55d.
2016-02-24 10:33:19 +05:30
Viral B. Shah 07a535e55d moved src/cdefs-compat.h -> include/cdefs-compat.h 2016-02-24 10:06:55 +05:30
Simon Byrne 830dc991f3 Support powerpc
This fixes #113, based on files from FreeBSD. Tested on machine hosted by [OSUOSL](http://osuosl.org/services/powerdev/).
2016-02-23 11:08:14 +00:00
Viral B. Shah 4c8740ad58 Import these fixes from upstream.
0563b7a42b/lib/msun/src/e_j0f.c

Fix test build on OS X.
2015-11-13 09:16:51 +05:30
Viral B. Shah c29e8b1b6e Revert "Remove [jy][01n]f(). X/Open only standardizes the double versions."
This reverts commit 8c8693cf79.
2015-11-13 09:06:24 +05:30
Graham Inggs ebe1db3ce4 Build on GNU/kfreeBSD and GNU/Hurd
Use __GLIBC__ instead of __linux
Simplify Make.inc as per JuliaLang/openspecfun@e91925a
2015-11-10 21:38:51 +02:00
Ed Schouten ec5833a498 Add a copy of FreeBSD's lib/libc/aarch64/_fpmath.h.
This makes it possible to build OpenLibm on ARM64 CPUs.
2015-10-26 10:26:19 +01:00
Alexander Light f30b0d3045 Fix build for i386
This would not build on i386 due to a missing include.
2015-02-26 16:01:30 -05:00
Viral B. Shah 8247b5af78 Revert "Update to the latest s_scalbln.c from msun."
This reverts commit a2f4e102f2.
2015-02-21 07:50:35 +05:30
Viral B. Shah a2f4e102f2 Update to the latest s_scalbln.c from msun. 2015-02-20 23:56:48 +05:30