15 Commits

Author SHA1 Message Date
Akos Kiss
3ba286f3e1 Turn modified fdlibm into Jerry's own libm
* Rename modified fdlibm to jerry-libm
  * Move third-party/fdlibm to jerry-libm
  * Rename original fdlibm.h to jerry-libm-internal.h
    * And remove it from the public headers.
  * Rename jerry-libm's public header to math.h
    * This also makes jerry-core sources include `<math.h>`. Therefore,
      should anyone want to use a different libm implementation with
      jerry, it becomes possible. (The same way as we provide a minimal
      libc with standard headers, but should it be insufficient or
      conflicting for someone, it can be replaced.)
  * Drop `s_` prefix from jerry-libm sources
    * The original fdlibm implementation had various prefixes (e.g., `k_`
      for sources of kernel routines, and `w_` for wrapper routines), but
      after the specialization of fdlibm to jerry, only `s_` remained.
      Since it does not encode anything anymore, it can be dropped.
  * Stylistic edits to jerry-libm's CMakeLists
    * Align project name with other CMakeLists in the code base
  * Move Jerry-LibM under Apache License
    * Using the same approach as was used by linux-wireless when ath5k
      driver license needed clarification. Solution was proposed by SFLC.
      External mail for future reference: http://lwn.net/Articles/247806/

* Tests & checks
  * Remove FD from the name of libm unit test-related files
  * Make vera++ and cppcheck check jerry-libm

* Targets
  * Speculative update of targets to use jerry-libm

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-08 15:38:47 +02:00
Akos Kiss
45c89fef28 Add AArch64 support to fdlibm
Endianness was not properly set/detected for AArch64. Once that is
fixed, the platform is well-supported.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-06 13:10:50 +00:00
Akos Kiss
3127b9d34d Fix asin
Re-styling of the sources revealed that the false branch of an
if-else construct in `asin` did not contain all the statements
that it should. (This was an issue -- a bad smell at least --
that's been around since 1995, according to the legacy SCCS ID.)

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-06 13:45:22 +02:00
Akos Kiss
8dd5186a0d Re-style fdlibm to conform to jerry guidelines
* First re-style was done automatically by indent to minimize the
  chance of errors during rewrite.

* Manual changes were applied to non-critical places only (comments
  and spaces):
  * Replaced all tabs with spaces.
  * Fixed tab stops in formulae in function comments.
    (Note: ASCII art for math formulae (especially for super- and
    subscripts) is a terrible idea.)
  * Unified the style of function comments.
  * Moved some in-code comments to their right places, which indent
    couldn't handle.
  * Added spaces to formulae of in-code comments to make them more
    readable.
  * Added braces mandated by jerry style guidelines.
  * Added parentheses to multiline #ifdef.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-06 13:45:22 +02:00
Akos Kiss
b39474c746 Merge sin/cos/tan and all helper functinos in a single source
* Made helper functions static.
* Changed the signature of __kernel_rem_pio2 not to require the
  ipio2 argument

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-06 13:45:22 +02:00
Akos Kiss
a72caf1301 Turn simple constants to preprocessor macros
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-06 13:45:22 +02:00
Akos Kiss
397dff81ee Specialize fdlibm to jerry
Keep IEEE code paths only:
* removed SVID, XOPEN, POSIX code paths from everywhere.
* deleted s_lib_version.c, as version is only useful if multiple
  standards are supported.
* deleted k_standard.c, as it handles non-IEEE exception cases only.
* renamed the e_{acos,asin,atan2,exp,fmod,log,pow,sqrt}.c sources as
  s_.*, dropped the __ieee754_ prefix from the names of the
  appropriate functions therein, and deleted the
  w_{acos,asin,atan2,exp,fmod,log,pow,sqrt}.c wrapper code.

Keep C99 declaration variants only:
* removed old C-style function declaration variants.
* removed data declaration variants where const qualifier was not
  used.

Clean unused sources/functions:
* removed s_{rint,significand,tanh}.c and the appropriate functions
  defined therein.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-06 13:45:22 +02:00
Akos Kiss
2a5d17e736 Fix SCCS IDs in fdlibm
Most of the legacy version control IDs in fdlibm are already simple
comments at the beginning of the source files. However, in some
files, there are leftover global variables and pragmas. (The global
variable in e_pow.c even increases the .data section in both debug
and release builds.) This patch turns all legacy IDs to comments of
unified style.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-03-16 09:32:50 +01:00
Akos Kiss
aa0b6215fa Replace the EXTERN_C macro with extern "C" { block in fdlibm
Jerry-libc and jerry-core already uses the block-based approach.
Now, removing the last remnant of the macro approach from fdlibm as
well.

Closes issue #900

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-02-22 09:33:10 +01:00
SaeHie Park
f7b370ba42 Disable warning messages of fdlibm for mips
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-08-26 14:00:36 +09:00
Peter Gal
021fc62652 Fix endian detection on 32bit
When using the -std=c99 the gcc does not defines the i386 macro
just the __i386 and __ i386 __.

Fixes issue #355

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-24 11:00:24 +02:00
Szilard Ledan
bac7908448 Add fmod function to the fdlibm
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-06-22 12:55:26 +02:00
Tamas Czene
677a0a45d0 Fixed nuttx build with fdlibm
JerryScript-DCO-1.0-Signed-off-by: Tamas Czene tczene.u-szeged@partner.samsung.com
2015-05-26 14:03:07 +02:00
Tamas Czene
7dfbc88cc0 Added Math functions
JerryScript-DCO-1.0-Signed-off-by: Tamas Czene tczene.u-szeged@partner.samsung.com
2015-05-19 18:09:12 +02:00
Ruben Ayrapetyan
e1c57dc231 Adding valgrind's memcheck support in mem-heap. Adding valgrind's headers valgrind.h and memcheck.h to third-party/valgrind directory. 2014-08-01 18:22:34 +04:00