From db505b794c697631f65e6b91ff106496debb86ac Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 22 Oct 2017 14:19:20 +0000 Subject: 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 --- src/math/logf_data.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/math/logf_data.h (limited to 'src/math/logf_data.h') 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 + +#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 -- cgit v1.2.1