Commit Graph

55 Commits

Author SHA1 Message Date
Lephenixnoir feba6242e4
fenv: avoid internal includes in user-facing headers
A future cleanup will drastically reduce the set of headers being installed,
and we don't want to install internal headers in particular.
2022-08-19 16:02:05 +02:00
Lephenixnoir 668336366e
merge from upstream, updated to 0.7.5 2021-05-20 21:31:25 +02:00
JC Estibariz 9152b0d1b0 Fix compilation errors on wasm32 2020-12-01 13:17:32 -05:00
Lephenixnoir 44c1cbb8eb
sh3eb: add suport for the sh3eb softfp platform 2020-10-24 13:55:39 +02:00
Lephenixnoir 89b463b811
sh3eb: only retain the softfp option of the MIPS fenv.h 2020-10-24 13:42:09 +02:00
Lephenixnoir 1b364a5edf
sh3eb: copy files from the MIPS softfp fenv.h 2020-10-24 13:42:09 +02: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
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
Radovan Birdic 4dcc76ed96 Using cdefs-compat.h and stdint.h instead <sys/types.h>
fenv-softfloat.h file added
SOFTFLOAT code parts are not tested.
2018-06-04 09:38:27 +00: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
Elliot Saba d982368bec Fix `arm` floating-point status register code
* Use an actual compiler definition to determine whether we have a
  floating-point unit or not.

* Use a modern (VFPU) assembly instruction to get/set the fpsr

* If we don't have an fpsr, at least zero out the return value
2017-01-16 11:44:14 -08:00
Arjen Roodselaar 212f8a1b4c Include missing decls for ARM 2016-07-18 17:05:09 -07:00
Keno Fischer 5fd9dcbbdf Fix incorrect attribute as a result of blanket rename 2016-05-03 18:48:45 -04:00
Graham Inggs 019990ecb7 WIP: Enable build on aarch64 2016-04-08 19:37:13 +02: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
Tony Kelman c3b18b1096 Revert "Fix #35"
This reverts commit 8b3b520675.
This was causing dllexport-related errors on win64
2016-02-27 02:32:03 -08:00
Simon Byrne 10bae6608d fix ARCH variable for powerpc, and rearrange fenv.h union for endianness 2016-02-26 16:35:26 +00: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 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
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 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
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 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
Ed Schouten 17688c4487 Rename include/fenv.h to <openlibm_fenv.h>.
OpenLibm has an implementation of fenv.h internally. This may be
problematic in case you want it to build against the host system's
implementation, as it would require you to somehow take the fenv.h file
out of the compiler search path.

Simply use a different naming scheme, similar to openlibm.h and
openlibm_complex.h. If we want to build against the host's fenv.h, we
can simply add an '#include <fenv.h>' from within this header.
2015-01-09 13:11:12 +01:00
Ed Schouten 78f622e84a Use endianness definitions provided by GCC or Clang if available.
Instead of using all sorts of operating system specific constructs, we
can just query the compiler which byte order is being used. This has the
advantage that the code builds on new platforms without any tweaks.
2015-01-07 22:33:54 +01:00
Ed Schouten 9a48c87386 Don't attempt to pull in <sys/cdefs.h> directly.
<sys/cdefs.h> is not a standard header. Instead, we'd better pull in a
common header like <stdio.h>. It is very likely that such a header
already provides the necessary bits.
2015-01-07 22:22:52 +01:00
Thomas Leonard 4cb9231f1a Removed some uses of sys/types.h
It's useful to be able to compile openlibm in environments where this
doesn't exist (e.g. OS kernels).
2014-12-01 11:10:41 +00:00
Thomas Leonard 9f4f2c6d57 u_int8_t, etc are non-standard, so define on all platforms 2014-11-27 14:47:36 +00:00
Thomas Leonard f22d7db106 Fixed build on ARM
Removed all long double support, since ARM doesn't have long doubles.
2014-05-26 10:55:49 +01:00
Tony Kelman 8b59bbc18b Export ldexp aliases on Windows
skip END and add .drectve export in assembly versions

uncomment __strong_reference definition from cdefs-compat.h

use weak references in place of strong references on Mac

add DLLEXPORT to all strong references

Fixes Julia issue #6777
2014-05-09 17:05:33 -07:00
Jameson Nash 2eb1876bb8 add more windows compatibility definitions 2014-03-18 21:22:51 -04:00
Jameson Nash 66e6f8ea91 normalize __WIN32__ to _WIN32, which is defined by all Windows compilers 2014-03-18 20:47:48 -04:00
Jameson Nash e9661c36af WIN32 build fix 2012-11-09 02:25:25 -05:00
Mike Nolta ec53659c6a fixes for freebsd9 2012-10-30 17:54:30 -04:00
Keno Fischer 87ce7cedda Fix build on amd64 linux 2012-08-19 04:15:47 -04:00
Keno Fischer 4b078ee343 Fix __weak_reference for clang [closes #9] 2012-07-03 13:50:00 +02:00
Viral B. Shah 62c895488f Workarounds in cdefs-compat for clang. 2012-07-03 16:24:32 +05:30
Keno Fischer f21624349f Build fix for amd64 Linux 2012-05-25 20:04:41 -07:00
Keno Fischer adb103acec Build fixes for Windows 2012-05-25 21:25:13 -04:00
Jameson Nash a9d723a19e typo 2012-04-08 21:02:23 -04:00