| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-FileCopyrightText: 2023 - 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> | ||
| 2 | // | ||
| 3 | // SPDX-License-Identifier: Apache-2.0 | ||
| 4 | |||
| 5 | #include "kleidicv/dispatch.h" | ||
| 6 | #include "kleidicv/kleidicv.h" | ||
| 7 | |||
| 8 | namespace kleidicv { | ||
| 9 | |||
| 10 | namespace neon { | ||
| 11 | |||
| 12 | template <typename T> | ||
| 13 | kleidicv_error_t saturating_sub(const T *src_a, size_t src_a_stride, | ||
| 14 | const T *src_b, size_t src_b_stride, T *dst, | ||
| 15 | size_t dst_stride, size_t width, size_t height); | ||
| 16 | |||
| 17 | } // namespace neon | ||
| 18 | |||
| 19 | namespace sve2 { | ||
| 20 | |||
| 21 | template <typename T> | ||
| 22 | kleidicv_error_t saturating_sub(const T *src_a, size_t src_a_stride, | ||
| 23 | const T *src_b, size_t src_b_stride, T *dst, | ||
| 24 | size_t dst_stride, size_t width, size_t height); | ||
| 25 | |||
| 26 | } // namespace sve2 | ||
| 27 | |||
| 28 | namespace sme { | ||
| 29 | template <typename T> | ||
| 30 | kleidicv_error_t saturating_sub(const T *src_a, size_t src_a_stride, | ||
| 31 | const T *src_b, size_t src_b_stride, T *dst, | ||
| 32 | size_t dst_stride, size_t width, size_t height); | ||
| 33 | |||
| 34 | } // namespace sme | ||
| 35 | |||
| 36 | namespace sme2 { | ||
| 37 | template <typename T> | ||
| 38 | kleidicv_error_t saturating_sub(const T *src_a, size_t src_a_stride, | ||
| 39 | const T *src_b, size_t src_b_stride, T *dst, | ||
| 40 | size_t dst_stride, size_t width, size_t height); | ||
| 41 | |||
| 42 | } // namespace sme2 | ||
| 43 | |||
| 44 | } // namespace kleidicv | ||
| 45 | |||
| 46 | #define KLEIDICV_DEFINE_C_API(name, type) \ | ||
| 47 | KLEIDICV_MULTIVERSION_C_API( \ | ||
| 48 | name, &kleidicv::neon::saturating_sub<type>, \ | ||
| 49 | KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::saturating_sub<type>), \ | ||
| 50 | KLEIDICV_SME_IMPL_IF(&kleidicv::sme::saturating_sub<type>), \ | ||
| 51 | KLEIDICV_SME2_IMPL_IF(&kleidicv::sme2::saturating_sub<type>)) | ||
| 52 | |||
| 53 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s8, int8_t); |
| 54 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u8, uint8_t); |
| 55 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s16, int16_t); |
| 56 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u16, uint16_t); |
| 57 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s32, int32_t); |
| 58 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u32, uint32_t); |
| 59 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s64, int64_t); |
| 60 |
6/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
|
10 | KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u64, uint64_t); |
| 61 |