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
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/math.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
|
@ -53,3 +54,12 @@ TEST(floorl, test) {
|
|||
EXPECT_STREQ("INFINITY", gc(xdtoal(floorl(INFINITY))));
|
||||
EXPECT_STREQ("-INFINITY", gc(xdtoal(floorl(-INFINITY))));
|
||||
}
|
||||
|
||||
BENCH(floorl, bench) {
|
||||
double _floor(double) asm("floor");
|
||||
float _floorf(float) asm("floorf");
|
||||
long double _floorl(long double) asm("floorl");
|
||||
EZBENCH2("floor", donothing, _floor(.7)); /* ~3ns */
|
||||
EZBENCH2("floorf", donothing, _floorf(.7)); /* ~3ns */
|
||||
EZBENCH2("floorl", donothing, _floorl(.7)); /* ~9ns */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue