From 098868b338e9afd3ef844070a94b9b10360d913f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 22 Oct 2017 17:39:36 +0000 Subject: math: new log2f from https://github.com/ARM-software/optimized-routines, commit 04884bd04eac4b251da4026900010ea7d8850edc code size change: +177 bytes. benchmark on x86_64 before, after, speedup: -Os: log2f rthruput: 11.38 ns/call 5.99 ns/call 1.9x log2f latency: 35.01 ns/call 22.57 ns/call 1.55x -O3: log2f rthruput: 10.82 ns/call 5.58 ns/call 1.94x log2f latency: 35.13 ns/call 21.04 ns/call 1.67x --- src/math/log2f_data.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/math/log2f_data.h (limited to 'src/math/log2f_data.h') diff --git a/src/math/log2f_data.h b/src/math/log2f_data.h new file mode 100644 index 00000000..4fa48956 --- /dev/null +++ b/src/math/log2f_data.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017-2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ +#ifndef _LOG2F_DATA_H +#define _LOG2F_DATA_H + +#include + +#define LOG2F_TABLE_BITS 4 +#define LOG2F_POLY_ORDER 4 +extern hidden const struct log2f_data { + struct { + double invc, logc; + } tab[1 << LOG2F_TABLE_BITS]; + double poly[LOG2F_POLY_ORDER]; +} __log2f_data; + +#endif -- cgit v1.2.1