mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Make further progress on non-x86 support
This commit is contained in:
parent
aef9a69a60
commit
036b9a0002
155 changed files with 2307 additions and 653 deletions
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
|
@ -56,3 +57,12 @@ TEST(fabs, stuff) {
|
|||
EXPECT_EQ(1, !!isnan(fabs(-NAN)));
|
||||
EXPECT_EQ(0, !!signbit(fabs(-NAN)));
|
||||
}
|
||||
|
||||
BENCH(fabs, bench) {
|
||||
double _fabs(double) asm("fabs");
|
||||
float _fabsf(float) asm("fabsf");
|
||||
long double _fabsl(long double) asm("fabsl");
|
||||
EZBENCH2("fabs", donothing, _fabs(.7)); /* ~6ns */
|
||||
EZBENCH2("fabsf", donothing, _fabsf(.7)); /* ~5ns */
|
||||
EZBENCH2("fabsl", donothing, _fabsl(.7)); /* ~28ns */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue