aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/NEON/NEMath.inl
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-08-02 13:44:33 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commitd8e765ba79772ecc3deda89ae3adab903c744296 (patch)
tree08b11fb4ebb27c3a59ee1f2a5ffcf9665f5a6200 /arm_compute/core/NEON/NEMath.inl
parentcfc6fe8bffceb9acc5234985f6da73361abd56d7 (diff)
downloadComputeLibrary-d8e765ba79772ecc3deda89ae3adab903c744296.tar.gz
COMPMID-472 : Implement Floor for CL and NEON.
Change-Id: I675a4545b1fe9ab665a07c834720bfe7ff589cee Reviewed-on: http://mpd-gerrit.cambridge.arm.com/82527 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/core/NEON/NEMath.inl')
-rw-r--r--arm_compute/core/NEON/NEMath.inl10
1 files changed, 10 insertions, 0 deletions
diff --git a/arm_compute/core/NEON/NEMath.inl b/arm_compute/core/NEON/NEMath.inl
index 08f6749ac9..bdd747c4e9 100644
--- a/arm_compute/core/NEON/NEMath.inl
+++ b/arm_compute/core/NEON/NEMath.inl
@@ -54,6 +54,16 @@ const std::array<float32x4_t, 8> log_tab =
}
};
+inline float32x4_t vfloorq_f32(float32x4_t val)
+{
+ static const float32x4_t CONST_1 = vdupq_n_f32(1.f);
+
+ const int32x4_t z = vcvtq_s32_f32(val);
+ const float32x4_t r = vcvtq_f32_s32(z);
+
+ return vbslq_f32(vcgtq_f32(r, val), vsubq_f32(r, CONST_1), r);
+}
+
inline float32x4_t vinvsqrtq_f32(float32x4_t x)
{
float32x4_t sqrt_reciprocal = vrsqrteq_f32(x);