mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Use ARM's faster math functions on non-tiny builds
This commit is contained in:
parent
3c10fb5580
commit
4814b6bdf8
58 changed files with 3760 additions and 361 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "libc/math.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
|
@ -61,3 +62,12 @@ TEST(exp, fun) {
|
|||
ASSERT_STREQ("6.389056", gc(xasprintf("%f", expm1(2.0))));
|
||||
ASSERT_STREQ("6.389056", gc(xasprintf("%f", exp(2.0) - 1.0)));
|
||||
}
|
||||
|
||||
BENCH(expl, bench) {
|
||||
double _exp(double) asm("exp");
|
||||
float _expf(float) asm("expf");
|
||||
long double _expl(long double) asm("expl");
|
||||
EZBENCH2("exp", donothing, _exp(.7)); /* ~6ns */
|
||||
EZBENCH2("expf", donothing, _expf(.7)); /* ~5ns */
|
||||
EZBENCH2("expl", donothing, _expl(.7)); /* ~20ns */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue