Commit Graph

5 Commits

Author SHA1 Message Date
Andrew Hsieh
f242723e9d Fixed API18 math.h for clang3.4
Clang3.4 can take __builtin_nexttoward and __builtin_nexttowardf.
Also fix a minor typo in comment

Change-Id: If98a35e2e38c45ebd619b0ceb6c5ee41acc4e415
2013-12-30 14:14:09 +08:00
Logan Chien
ad40d952a1 Workaround the __builtin_isnan() type error for clang 3.4.
Similar to clang 3.3, it seems that clang 3.4 declares an incompatible
function prototypes for __builtin_isnan().  To workaround this issue,
we should not declare the function prototype for __builtin_isnan().

Note: Though it may be good to fix this in clang type checker, like
__builtin_nexttoward(), however it seems non-trivial since __builtin_isnsn()
might be overloaded.  We can revert this after we have fixed the
clang builtin definition.

Change-Id: I329b56225f3d229b0c141bb8414c4369f154efda
2013-12-25 01:59:29 +00:00
Andrew Hsieh
2a571fda2b Fix -mhard-float for calling __builtin_* math functions
Annotate __builtin math functions with __NDK_FPABI_MATH__ too.
1. __attribute__((pcs("aapcs"))) has no effect on codegen when __buitlin
   function is emitted inlined.
2. When __builtin call into regular function in Android's libm, it has
   proper attribute which observes soft float-abi

Change-Id: I11e8b74fc22f3072b9ce849193e4a56e98c92d64
2013-12-04 11:45:04 +08:00
Andrew Hsieh
5881b5cbe7 Add __NDK_FPABI__ to function taking/returning float/double
Allow user code to be compiled with "-mhard-float" for armeabi-v7a
(which implies -mfloat-abi=hard), and either link with
1. Android native APIs which use softfp, or
2. A customized libm_hard.a which is compiled with -mhard-float. Need
   -D_NDK_MATH_NO_SOFTFP=1

See tests/device/hard-float/jni/Android.mk for details and restriction
on Clang

Change-Id: I773a842c73368e08b9a6cda0441e95a96fa303b2
2013-10-17 19:15:22 +08:00
Andrew Hsieh
0df3e70b99 Add missing math functions
1. Add sincos, sincosf, and sincosl to API >= 9 (for ARM only,
   because X86 and MIPS have it already)
2. Add nan, nanf, nanl, and tgammaf to API >= 13 (11 actually,
   but we don't want to add another API which is not released)
3. Add log2, log2f, log2l, logbl, nexttoward, and nexttowardl to
   API >= 18

See b.android.com/38423

Change-Id: I0a756aeeddafc3862f3c0ae38218cb3301608231
2013-10-15 15:55:12 +08:00