Commit graph

4 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
4ceb3474be Add riscv64 lrint.S.
This is mainly just to match what we have for arm64.

The test failures before and after this change are all for the long
double variant, which this change doesn't touch. (The problem there is
that clang is calling `__fixtfdi` for the cast in lrintl(), but that
doesn't respect the current rounding mode, which lrintl() is required
to do. `#pragma STDC FENV_ACCESS ON` doesn't fix this, so there's going
to be some llvm work needed to fix this.)

I've replaced the ASSERTs with EXPECTs in the relevant test to ensure
we're checking all the other assertions despite the `long double`
failures.

Test: bionic-unit-tests-static
Change-Id: Ia24bf21619631b6f8b3b607d30536011bb4cd826
2022-10-25 22:27:10 +00:00
Elliott Hughes
a4398452fd Add trivial assembler implementations of sqrt()/sqrtf().
10x faster in the usual bionic benchmarks.

Test: treehugger
Change-Id: If121cb1ed1ff0756310f34cbaa2c14e28484f1b8
2022-10-24 20:31:09 +00:00
Elliott Hughes
6a1b0f3cac riscv64: fenv implementation.
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Signed-off-by: Xia Lifang <lifang_xia@linux.alibaba.com>
Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
Signed-off-by: Lu Xufan <luxufan@iscas.ac.cn>
Test: treehugger
Change-Id: I0f0227cd4cb5e78aba1a749f8d8fce296a024dfb
2022-10-14 21:34:18 +00:00