aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/NEON/NEMath.inl
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-08-10 17:36:36 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit3a6163ed0c2d0ab4cac0456e8f66c704c6ad10c2 (patch)
treef2e34b47fb0b8bf1fac18c337a67c0145def7b7b /arm_compute/core/NEON/NEMath.inl
parente3f1bd10e71075f7d8b406698809666e1eb4e7ae (diff)
downloadComputeLibrary-3a6163ed0c2d0ab4cac0456e8f66c704c6ad10c2.tar.gz
COMPMID-1499: Fixed issues to build for FP16 on Android
Change-Id: I7cd15e9115b5c6f544005528d69061751286be11 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143708 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'arm_compute/core/NEON/NEMath.inl')
-rw-r--r--arm_compute/core/NEON/NEMath.inl56
1 files changed, 28 insertions, 28 deletions
diff --git a/arm_compute/core/NEON/NEMath.inl b/arm_compute/core/NEON/NEMath.inl
index 84154020a5..61d25d115c 100644
--- a/arm_compute/core/NEON/NEMath.inl
+++ b/arm_compute/core/NEON/NEMath.inl
@@ -173,35 +173,7 @@ inline float32x4_t vpowq_f32(float32x4_t val, float32x4_t n)
#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
/** Exponent polynomial coefficients */
-const std::array<float16x8_t, 8> exp_tab_f16 =
-{
- {
- vdupq_n_f16(1.f),
- vdupq_n_f16(0.0416598916054f),
- vdupq_n_f16(0.500000596046f),
- vdupq_n_f16(0.0014122662833f),
- vdupq_n_f16(1.00000011921f),
- vdupq_n_f16(0.00833693705499f),
- vdupq_n_f16(0.166665703058f),
- vdupq_n_f16(0.000195780929062f),
- }
-};
-
/** Logarithm polynomial coefficients */
-const std::array<float16x8_t, 8> log_tab_f16 =
-{
- {
- vdupq_n_f16(-2.29561495781f),
- vdupq_n_f16(-2.47071170807f),
- vdupq_n_f16(-5.68692588806f),
- vdupq_n_f16(-0.165253549814f),
- vdupq_n_f16(5.17591238022f),
- vdupq_n_f16(0.844007015228f),
- vdupq_n_f16(4.58445882797f),
- vdupq_n_f16(0.0141278216615f),
- }
-};
-
#ifndef DOXYGEN_SKIP_THIS
inline float16x4_t vinvsqrt_f16(float16x4_t x)
{
@@ -264,6 +236,20 @@ inline float16x8_t vtaylor_polyq_f16(float16x8_t x, const std::array<float16x8_t
inline float16x8_t vexpq_f16(float16x8_t x)
{
+ static const std::array<float16x8_t, 8> exp_tab_f16 =
+ {
+ {
+ vdupq_n_f16(1.f),
+ vdupq_n_f16(0.0416598916054f),
+ vdupq_n_f16(0.500000596046f),
+ vdupq_n_f16(0.0014122662833f),
+ vdupq_n_f16(1.00000011921f),
+ vdupq_n_f16(0.00833693705499f),
+ vdupq_n_f16(0.166665703058f),
+ vdupq_n_f16(0.000195780929062f),
+ }
+ };
+
static const float16x8_t CONST_LN2 = vdupq_n_f16(0.6931471805f); // ln(2)
static const float16x8_t CONST_INV_LN2 = vdupq_n_f16(1.4426950408f); // 1/ln(2)
static const float16x8_t CONST_0 = vdupq_n_f16(0.f);
@@ -285,6 +271,20 @@ inline float16x8_t vexpq_f16(float16x8_t x)
inline float16x8_t vlogq_f16(float16x8_t x)
{
+ static const std::array<float16x8_t, 8> log_tab_f16 =
+ {
+ {
+ vdupq_n_f16(-2.29561495781f),
+ vdupq_n_f16(-2.47071170807f),
+ vdupq_n_f16(-5.68692588806f),
+ vdupq_n_f16(-0.165253549814f),
+ vdupq_n_f16(5.17591238022f),
+ vdupq_n_f16(0.844007015228f),
+ vdupq_n_f16(4.58445882797f),
+ vdupq_n_f16(0.0141278216615f),
+ }
+ };
+
static const int16x8_t CONST_127 = vdupq_n_s16(127); // 127
static const float16x8_t CONST_LN2 = vdupq_n_f16(0.6931471805f); // ln(2)