diff options
author | Szabolcs Nagy <nsz@port70.net> | 2017-10-22 14:19:20 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-04-17 23:42:38 -0400 |
commit | db505b794c697631f65e6b91ff106496debb86ac (patch) | |
tree | 2a1b54ce3017522a6f7b0d4e76e3cedfa1629889 /src/math/logf_data.h | |
parent | 169fc008d8daf5265847c593b1c78f3513d9172b (diff) | |
download | musl-db505b794c697631f65e6b91ff106496debb86ac.tar.gz |
math: new logf
from https://github.com/ARM-software/optimized-routines,
commit 04884bd04eac4b251da4026900010ea7d8850edc,
with minor changes to better fit into musl.
code size change: +289 bytes.
benchmark on x86_64 before, after, speedup:
-Os:
logf rthruput: 8.40 ns/call 6.14 ns/call 1.37x
logf latency: 31.79 ns/call 24.33 ns/call 1.31x
-O3:
logf rthruput: 8.43 ns/call 5.58 ns/call 1.51x
logf latency: 32.04 ns/call 20.88 ns/call 1.53x
Diffstat (limited to 'src/math/logf_data.h')
-rw-r--r-- | src/math/logf_data.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/math/logf_data.h b/src/math/logf_data.h new file mode 100644 index 00000000..00cff6f8 --- /dev/null +++ b/src/math/logf_data.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ +#ifndef _LOGF_DATA_H +#define _LOGF_DATA_H + +#include <features.h> + +#define LOGF_TABLE_BITS 4 +#define LOGF_POLY_ORDER 4 +extern hidden const struct logf_data { + struct { + double invc, logc; + } tab[1 << LOGF_TABLE_BITS]; + double ln2; + double poly[LOGF_POLY_ORDER - 1]; /* First order coefficient is 1. */ +} __logf_data; + +#endif |