Commit graph

19 commits

Author SHA1 Message Date
Elliott Hughes
2dcc5ce03c Use clang's builtins for sqrt()/sqrtf() and lrint() family.
Bug: https://github.com/google/android-riscv64/issues/12
Test: llvm-objdump
Change-Id: I2b5647ca245b28433faabe633d970ea2fd69c763
2023-02-01 02:05:24 +00:00
Elliott Hughes
7047431d2f arm64: fix fesetround().
The FE_* rounding mode constants have different values on different
architectures, so you can't just copy & paste the validity check from
one to another, like I did here...

Bug: http://b/254501880
Test: treehugger
Change-Id: I2ffa766ffcbe22c1afcd28eab4bd964100dc2d98
2022-10-19 18:44:33 +00:00
Elliott Hughes
a93431ca4c arm64: simplify the fenv implementation a bit.
The macOS man page was helpful in advancing my understanding of
feupdateenv() in particular.

Test: treehugger
Change-Id: I511e8b31ac16f3fdf08b42eee5a2e6558ec3b70b
2022-10-14 20:38:35 +00:00
Tamas Petz
42b6530b1b libm: Add Armv8.3-A PAuth and Armv8.5-A BTI support to assembly files
This change adds both Armv8.3-A Pointer Authentication and Armv8.5-A BTI
support to *.S files.

Tests: Tested on FVP with BTI enabled

Change-Id: I82750afcbc950a91584463fbc979c2c35d41916a
2020-09-04 11:28:49 +02:00
Jake Weinstein
1e108e3432 Use builtins for ceil/floor/rint/trunc on arm64
Change-Id: I5c8be32b4d5a136690a496cddfec7d1fc2b25ee1
2017-12-11 02:50:54 -05:00
Elliott Hughes
9a1bb70ba0 Use builtins for fma/fmax/fmin/round on arm64.
Bug: http://b/27829506
Change-Id: Id243e3ba0041d5efce496f0760815e591a2c00a0
Test: ran tests and inspected arm64 assembler
2017-11-09 15:57:34 -08:00
Elliott Hughes
3b583f6330 Revert "Use builtins for fma/fmax/fmin/round on arm/arm64."
Apparently we still build non-NEON variants of bionic!

This reverts commit e57d772353.

Change-Id: I5436d913b1dc9b7d8f5e6afaea9b45002be7e825
2017-11-09 17:47:49 +00:00
Elliott Hughes
e57d772353 Use builtins for fma/fmax/fmin/round on arm/arm64.
Bug: http://b/27829506
Test: ran tests and inspected arm/arm64/x86/x86-64 assembler
Change-Id: I8af60b44c75dddbb11949f208a8a70ed3cff12c8
2017-11-08 15:13:58 -08:00
Elliott Hughes
b6c7f6e595 Fix arm/arm64 <fenv.h> to match current reality.
ARM stopped supporting enabling of FP exceptions years ago.

Bug: http://b/68832485
Test: ran tests
Change-Id: I8450baa78e04d994c352180975b0a1ecd5a9f662
2017-11-03 16:46:32 -07:00
Elliott Hughes
882b8afedc Regenerate NOTICE files.
Also clean up some near-miss copyright headers in libm, and remove
some cruft in <grp.h>/<pwd.h> that the script can't automatically
ignore since we stripped all the tabs in those files.

Change-Id: I10796c54dda1ceba87822ae0de26b5d71b54972b
2016-05-16 17:46:00 -07:00
Christopher Ferris
fa7752986d Fix arm64 fenv warnings, and make warnings errors.
Even though the control registers being read/written in fenv.c only
have 32 bits that are used, the instructions take a 64 bit register.
Make sure the inline assembler in the macros use 64 bit values.

Verified that before the change and after the change, the disassembly
is exactly the same.

In addition, add -Werror to the cflags.

Change-Id: I6603779327488c23e3aab13300edf2e02b101916
2015-10-23 16:41:17 -07:00
Christopher Ferris
995b813e91 For libm, use a macro for aliasing symbols.
Change-Id: Ibd42ebc387c2bf3eba9aa96091770915b4b34184
2015-03-13 23:57:15 -07:00
Amaury Le Leyzour
32936c895d Add aarch64 instructions wherever possible
fma, sqrt and various rounding functions have aarch64 instruction equivalent

Change-Id: I1284f31b9f78f914281e5563b8d44db8362b627d
2015-03-04 12:18:52 -08:00
Serban Constantinescu
a147a1da5c AArch64: libm: Fix ARM64 fenv_t and refactor ARM64 libm implementation.
This patch fixes the ARM64 ABI for libm. fenv_t is now split in 32bit status
and 32bit control. This mirrors the AArch64 FPU control and status
registers (FPCR, FPSR).

The patch also refactors the libm implementation for ARM64 into a finer
grained control over the FPU registers.

Bionic-benchmarks has been expanded with 3 more benchmarks for floating
point operations. The new libm implementation for ARM64 performs better
over all the math benchmarks available.

Change-Id: I2a7f81d6b4e55c91f8a63a4c69614fc8b1bcf2db
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2014-06-09 13:52:28 -07:00
Calin Juravle
1abc9ff6a5 Clean-up _fpmath and fake_long_doubles
- promoted IEEEld2bits to fpmath since most of the where the same for
diffrent archs
- removed _fpmath
- reinstated weak_references
- moved isfinite and isnormal to libc
- clean up fake_long_doubles
- clean up some useless ifdefs
- added missing nexttoward* tests

Bug: 14134235
Change-Id: I95639c4885653fe47fd7dc0570ee5bb3389bbc6b
2014-04-23 19:03:06 +01:00
Elliott Hughes
0f95a55322 Fix arm64 floating point definitions.
Change-Id: I6836da8fc9f66465435a21c51cb18851e20e9645
2014-04-14 15:33:32 -07:00
Calin Juravle
4d77c1151c Fix LP64 libm for 128-bit long doubles
* reworked amd64/_fpmath.h and arm64/_fpmath.h to support 128-bit long
doubles.
* improved tests to cover long double cases
* made modfl an alias for LP32

Tests pass on x86, x86_64, arm, arm64 and mips.

Bug: 12921273

Change-Id: Ibe39acde57972447a8950fa45b1e702acc68ebeb
2014-03-24 11:48:42 +00:00
Calin Juravle
2d367905a2 Moved to a more openbsd-like fenv.h
Factored out common declarations to include/fenv.h and pushed
the implementation to .c files.

Bug: 11050744
Change-Id: I446b13cc4bc599d328343a8d392b07de280f6304
2014-02-26 12:30:44 +00:00
Colin Cross
d1973ca513 bionic: rename aarch64 target to arm64
Rename aarch64 build targets to arm64.  The gcc toolchain is still
aarch64.

Change-Id: Ia92d8a50824e5329cf00fd6f4f92eae112b7f3a3
2014-01-23 18:35:39 -08:00