Commit Graph

136 Commits

Author SHA1 Message Date
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
Ed Schouten b6ff8bbe91 Clean up a change that I sneaked in accidentically.
I often build the code with -Wmissing-prototypes to ensure that we don't
accidentically pollute the symbol namespace. If we want to provide a
symbol such as isopenlibm(), make sure we also declare it in
<openlibm_math.h>.
2015-02-12 13:58:35 +01:00
Ed Schouten 16902a6ce1 Reconnect cbrtl() to the build. It seems to build properly. 2015-02-12 13:49:47 +01:00
Ed Schouten 8c8693cf79 Remove [jy][01n]f(). X/Open only standardizes the double versions. 2015-02-12 13:48:13 +01:00
Ed Schouten ce4982acf8 Remove scalb(). The scalbn() or scalbln() function should be used. 2015-02-12 13:38:13 +01:00
Ed Schouten c08bd962f2 Remove the non-standard finite() function. 2015-02-12 13:35:19 +01:00
Ed Schouten ae1e0c309a Remove the non-standard drem() function. 2015-02-12 13:29:38 +01:00
Ed Schouten eca4ac8bf1 Remove the non-standard significand() function. 2015-02-12 13:28:37 +01:00
Ed Schouten 532fe1553e Remove the non-standard gamma() function. Use lgamma() instead. 2015-02-12 13:25:30 +01:00
Viral B. Shah ce8af02232 Merge pull request #82 from talex5/minios2
No stdio.h on Mini-OS, so use cdefs.h again there
2015-01-13 00:52:42 +05:30
Thomas Leonard b19856215c No stdio.h on Mini-OS, so use cdefs.h again there. 2015-01-12 10:45:03 +00:00
Ed Schouten 7e5585aaca Rename openlibm.h to openlibm_math.h.
This is a bit more consistent with the naming of the other header files
(openlibm_complex.h and openlibm_fenv.h). Re-add an openlibm.h header
that includes all of the public headers as a shorthand.

Fix up all of the source files to include <openlibm_math.h> instead of
<openlibm.h>. While there, fix ordering of the includes.
2015-01-11 23:37:01 +01:00
Ed Schouten c2154fd3f3 Add missing void keyword to keep -Wold-style-definition happy. 2015-01-11 23:01:49 +01:00
Ed Schouten bc3f903bc2 Move public headers into include/ and private headers into src/.
While there, also modify the install target. We should make sure to
install all openlibm*.h headers. There is still some work to be done:
openlibm_fenv_*.h still depends on some additional bits. I'd propose
that we eventually create an include/openlibm_cdefs.h that contains all
of the macros we need.
2015-01-11 16:35:32 +01:00