blob: fd45d821048dc3431fffb8c23d2f66e96314f862 [file] [log] [blame]
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +00001/*
2 * Copyright (c) 2020-2021 Arm Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#ifndef SRC_CORE_NEON_WRAPPER_INTRINSICS_SVQADD_H
25#define SRC_CORE_NEON_WRAPPER_INTRINSICS_SVQADD_H
26#if defined(__ARM_FEATURE_SVE)
27#include <arm_sve.h>
28namespace arm_compute
29{
30namespace wrapper
31{
32#define SVQADD_IMPL_F(type, postfix, svppostfix) \
33 inline type svqadd(const type &val1, const type &val2) \
34 { \
35 return svadd_##postfix##_z(svptrue_##svppostfix(), val1, val2); \
36 }
37
38SVQADD_IMPL_F(svfloat32_t, f32, b32)
39SVQADD_IMPL_F(svfloat16_t, f16, b16)
40#undef SVQADD_IMPL_F
41
42#define SVQADD_IMPL(type, postfix) \
43 inline type svqadd(const type &val1, const type &val2) \
44 { \
45 return svqadd_##postfix(val1, val2); \
46 }
47
48SVQADD_IMPL(svint32_t, s32)
49SVQADD_IMPL(svint16_t, s16)
50SVQADD_IMPL(svint8_t, s8)
51SVQADD_IMPL(svuint32_t, u32)
52SVQADD_IMPL(svuint16_t, u16)
53SVQADD_IMPL(svuint8_t, u8)
54
55#undef SVQADD_IMPL
56} // namespace wrapper
57} // namespace arm_compute
58
59#endif /* defined(__ARM_FEATURE_SVE) */
60#endif /* SRC_CORE_NEON_WRAPPER_INTRINSICS_SVQADD_H */