blob: 649fe468a33ca24bb7b8280a799f12cd9756937f [file] [log] [blame]
Georgios Pinitasff4fca02020-10-02 21:00:00 +01001/*
2 * Copyright (c) 2020 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_COMMON_REGISTRARS_H
25#define SRC_CORE_COMMON_REGISTRARS_H
26
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000027#if defined(ENABLE_FP16_KERNELS)
28
29#if defined(__ARM_FEATURE_SVE)
30#define REGISTER_FP16_SVE(func_name) &(func_name)
31#else /* !defined(__ARM_FEATURE_SVE) */
32#define REGISTER_FP16_SVE(func_name) nullptr
33#endif /* defined(__ARM_FEATURE_SVE) */
34
35#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
Georgios Pinitasff4fca02020-10-02 21:00:00 +010036#define REGISTER_FP16_NEON(func_name) &(func_name)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000037#else /* !defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) */
Georgios Pinitasff4fca02020-10-02 21:00:00 +010038#define REGISTER_FP16_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000039#endif /* defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) */
40
41#else /* !defined(ENABLE_FP16_KERNELS) */
42#define REGISTER_FP16_NEON(func_name) nullptr
43#define REGISTER_FP16_SVE(func_name) nullptr
Georgios Pinitasff4fca02020-10-02 21:00:00 +010044#endif /* defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) */
45
46#if defined(ENABLE_FP32_KERNELS)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000047#if defined(__ARM_FEATURE_SVE)
48#define REGISTER_FP32_SVE(func_name) &(func_name)
49#endif /* defined(__ARM_FEATURE_SVE) */
Georgios Pinitasff4fca02020-10-02 21:00:00 +010050#define REGISTER_FP32_NEON(func_name) &(func_name)
51#else /* defined(ENABLE_FP32_KERNELS) */
52#define REGISTER_FP32_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000053#define REGISTER_FP32_SVE(func_name) nullptr
Georgios Pinitasff4fca02020-10-02 21:00:00 +010054#endif /* defined(ENABLE_FP32_KERNELS) */
55
Michalis Spyrouc4d45552020-10-19 12:41:30 +010056#if defined(ENABLE_QASYMM8_SIGNED_KERNELS)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000057#if defined(__ARM_FEATURE_SVE)
58#define REGISTER_QASYMM8_SIGNED_SVE(func_name) &(func_name)
59#endif /* defined(__ARM_FEATURE_SVE) */
Michalis Spyrouc4d45552020-10-19 12:41:30 +010060#define REGISTER_QASYMM8_SIGNED_NEON(func_name) &(func_name)
61#else /* defined(ENABLE_QASYMM8_SIGNED_KERNELS) */
62#define REGISTER_QASYMM8_SIGNED_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000063#define REGISTER_QASYMM8_SIGNED_SVE(func_name) nullptr
Michalis Spyrouc4d45552020-10-19 12:41:30 +010064#endif /* defined(ENABLE_QASYMM8_SIGNED_KERNELS) */
65
66#if defined(ENABLE_QASYMM8_KERNELS)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000067#if defined(__ARM_FEATURE_SVE)
68#define REGISTER_QASYMM8_SVE(func_name) &(func_name)
69#endif /* defined(__ARM_FEATURE_SVE) */
Michalis Spyrouc4d45552020-10-19 12:41:30 +010070#define REGISTER_QASYMM8_NEON(func_name) &(func_name)
71#else /* defined(ENABLE_QASYMM8_KERNELS) */
72#define REGISTER_QASYMM8_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000073#define REGISTER_QASYMM8_SVE(func_name) nullptr
Michalis Spyrouc4d45552020-10-19 12:41:30 +010074#endif /* defined(ENABLE_QASYMM8_KERNELS) */
75
76#if defined(ENABLE_QSYMM16_KERNELS)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000077#if defined(__ARM_FEATURE_SVE)
78#define REGISTER_QSYMM16_SVE(func_name) &(func_name)
79#endif /* defined(__ARM_FEATURE_SVE) */
Michalis Spyrouc4d45552020-10-19 12:41:30 +010080#define REGISTER_QSYMM16_NEON(func_name) &(func_name)
81#else /* defined(ENABLE_QSYMM16_KERNELS) */
82#define REGISTER_QSYMM16_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000083#define REGISTER_QSYMM16_SVE(func_name) nullptr
Michalis Spyrouc4d45552020-10-19 12:41:30 +010084#endif /* defined(ENABLE_QSYMM16_KERNELS) */
85
Georgios Pinitasff4fca02020-10-02 21:00:00 +010086#endif /* SRC_CORE_COMMON_REGISTRARS_H */