Fork of the OpenLibm math library with fx-9860G and fx-CG 50 support.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
Lephenixnoir 9828d2e3f2
meta: update build instructions
7 months ago
.github Update FUNDING.yml 3 years ago
aarch64 Make fenv methods static on additional platforms. 2 years ago
amd64 Revert "Export `fenv` functions on all platforms (#213)" 2 years ago
arm Remove unused Symbol.map files. 8 years ago
bsdsrc add missing weak references for long double functions 2 years ago
docs Update list of libm libraries 3 years ago
i387 Fix invalid assembly directive caught by clang 7 years ago
include fenv: avoid internal includes in user-facing headers 7 months ago
ld80 Fix undefined reference to __fpgetprec on i386 7 years ago
ld128 Fix compilation on AArch64 6 years ago
mips Using cdefs-compat.h and stdint.h instead <sys/types.h> 5 years ago
powerpc Make fenv methods static on additional platforms. 2 years ago
s390 s390(x) port 4 years ago
sh3eb fenv: provide environment primitives 2 years ago
src add missing weak references for long double functions 2 years ago
test Fix #211 2 years ago
wasm32 wasm32 support (#192) 4 years ago
.gitignore add support for quick build with GiteaPC 2 years ago
.mailmap Add mailmap 11 years ago
.travis.yml travis: Add mips, mipsel, mips64el build. 5 years ago
LICENSE.md Update references to JuliaLang to point to JuliaMath (#182) 5 years ago
Make.inc make: do not compile the static archive with -fPIC 2 years ago
Makefile install: trim the set of installed headers (and libm.a) 7 months ago
README-OpenLibm.md sh3eb: move older README 2 years ago
README.md meta: update build instructions 7 months ago
appveyor.yml Update appveyor.yml 5 years ago
giteapc.make install: trim the set of installed headers (and libm.a) 7 months ago
openlibm.pc.in Update references to JuliaLang to point to JuliaMath (#182) 5 years ago

README.md

Soft-FP sh3eb port of OpenLibm

This is a fork of OpenLibm with support for the sh3eb architecture, intended for add-in programming on SuperH CASIO calculators.

Installing with GiteaPC

This library can be installed automatically as part of the fxSDK with GiteaPC:

% giteapc install Lephenixnoir/OpenLibm

Building manually

You will need a GCC toolchain built with --target=sh3eb-elf, such as the sh-elf-gcc commonly used on Planète Casio.

You can install directly in the internal folder of your compiler, or somewhere else if you have a more detailed setup.

# Example 1: Use the compiler's internal folder
% COMPILER_DIR="$(sh-elf-gcc --print-file-name=.)"
% LIBDIR="$COMPILER_DIR"
% INCDIR="$COMPILER_DIR/include"
# Example 2: Using the fxSDK's custom setup
% LIBDIR="$(fxsdk path lib)"
% INCDIR="$(fxsdk path include)"

You can then build and install the static library and the headers.

% make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc \
    libdir="$LIBDIR" includedir="$INCDIR" \
    install-static-superh install-headers-superh

The -superh targets differ from the the normal targets in the following ways:

  • install-static-superh also creates a symlink libm.a -> libopenlibm.a.
  • install-headers-superh installs directly in $LIBDIR instead of $LIBDIR/openlibm since OpenLibm headers reference each other without that prefix and enforcing the correct -I in every project is quite painful. In addition, it skips internal and non-SuperH headers.

Using the library

Include the headers <openlibm_complex.h>, <openlibm_fenv.h> and <openlibm_math.h>. Or, if you are using a suitable libc like fxlibc, include directly the standard headers <complex.h>, <fenv.h> and <math.h>.

Link with -lm. In a Makefile, update your LDFLAGS:

LDFLAGS += -lm

In CMake, use target_link_libraries():

target_link_libraries(<TARGET> PUBLIC -lm)

README and Licensing

See the original README file in README-OpenLibm.md. OpenLibm contains code covered by various licenses, see LICENSE.md.