diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-10-19 10:15:54 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-10-31 10:17:30 +0000 |
commit | 5ef0bdd53dd2ce6bc7ad28077ffac3bf9e939b5f (patch) | |
tree | 9268cc52debd91a4c146493b53e28ea937fef4e1 /src/core/NEON/SVEMath.h | |
parent | 29254aeb11a76c86449c2f38587e9144b2f2aacb (diff) | |
download | ComputeLibrary-5ef0bdd53dd2ce6bc7ad28077ffac3bf9e939b5f.tar.gz |
Fix SVE kernel using SVE2 instruction
Resolves: COMPMID-6493
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I038d91ba266e1e8bf124336bcd272ec77e92038c
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10490
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Anitha Raj <Anitha.Raj@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/SVEMath.h')
-rw-r--r-- | src/core/NEON/SVEMath.h | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/src/core/NEON/SVEMath.h b/src/core/NEON/SVEMath.h index 6d69b330ba..49ed9df720 100644 --- a/src/core/NEON/SVEMath.h +++ b/src/core/NEON/SVEMath.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 Arm Limited. + * Copyright (c) 2020-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_SVEMATH_H -#define ARM_COMPUTE_SVEMATH_H +#ifndef ACL_SRC_CORE_NEON_SVEMATH_H +#define ACL_SRC_CORE_NEON_SVEMATH_H #if defined(ARM_COMPUTE_ENABLE_SVE) #include "src/core/NEON/wrapper/intrinsics/svcvt.h" @@ -96,6 +96,19 @@ svfloat16_t svtanh_f16_z(svbool_t pg, svfloat16_t val); */ svfloat16_t svexp_f16_z(svbool_t pg, svfloat16_t x); +#ifdef ARM_COMPUTE_ENABLE_SVE2 + +/** Calculate exponential + * + * @param[in] pg Input predicate. + * @param[in] x Input vector value in F16 format. + * + * @return The calculated exponent. + */ +svfloat16_t svexp_f16_z_sve2(svbool_t pg, svfloat16_t x); + +#endif // ARM_COMPUTE_ENABLE_SVE2 + /** Calculate reciprocal. * * @param[in] pg Input predicate. @@ -114,6 +127,19 @@ svfloat16_t svinv_f16_z(svbool_t pg, svfloat16_t x); */ svfloat16_t svlog_f16_z(svbool_t pg, svfloat16_t x); +#ifdef ARM_COMPUTE_ENABLE_SVE2 + +/** Calculate logarithm + * + * @param[in] pg Input predicate. + * @param[in] x Input vector value in F32 format. + * + * @return The calculated logarithm. + */ +svfloat16_t svlog_f16_z_sve2(svbool_t pg, svfloat16_t x); + +#endif // ARM_COMPUTE_ENABLE_SVE2 + /** Calculate inverse square root. * * @param[in] pg Input predicate. @@ -148,6 +174,19 @@ svfloat32_t svsin_f32_z(svbool_t pg, svfloat32_t val); */ svfloat16_t svsin_f16_z(svbool_t pg, svfloat16_t val); +#ifdef ARM_COMPUTE_ENABLE_SVE2 + +/** Calculate sine. + * + * @param[in] pg Input predicate. + * @param[in] val Input vector value in radians, F16 format. + * + * @return The calculated sine. + */ +svfloat16_t svsin_f16_z_sve2(svbool_t pg, svfloat16_t val); + +#endif // ARM_COMPUTE_ENABLE_SVE2 + /** Calculate n power of a number. * * pow(x,n) = e^(n*log(x)) @@ -172,6 +211,22 @@ svfloat32_t svpow_f32_z(svbool_t pg, svfloat32_t a, svfloat32_t b); */ svfloat16_t svpow_f16_z(svbool_t pg, svfloat16_t a, svfloat16_t b); +#ifdef ARM_COMPUTE_ENABLE_SVE2 + +/** Calculate n power of a number. + * + * pow(x,n) = e^(n*log(x)) + * + * @param[in] pg Input predicate. + * @param[in] a Input vector value in F16 format. + * @param[in] b Powers to raise the input to. + * + * @return The calculated power. + */ +svfloat16_t svpow_f16_z_sve2(svbool_t pg, svfloat16_t a, svfloat16_t b); + +#endif // ARM_COMPUTE_ENABLE_SVE2 + /** Convert and pack four 32-bit float vectors into an 8-bit integer vector * * @param[in] in_0 The first float vector @@ -190,4 +245,4 @@ int_vec_type convert_float_to_int(const svfloat32_t &in_0, } // namespace arm_compute #include "src/core/NEON/SVEMath.inl" #endif /* defined(ARM_COMPUTE_ENABLE_SVE) */ -#endif /* ARM_COMPUTE_SVEMATH_H */ +#endif // ACL_SRC_CORE_NEON_SVEMATH_H |