Skip to content

Commit 4d4d2a9

Browse files
committed
Optimization of clamp functions for AArch64
1 parent 08515b7 commit 4d4d2a9

File tree

12 files changed

+562
-8
lines changed

12 files changed

+562
-8
lines changed

include/private/dsp/arch/aarch64/asimd/pmath.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL */
2828

2929
#include <private/dsp/arch/aarch64/asimd/pmath/abs_vv.h>
30+
#include <private/dsp/arch/aarch64/asimd/pmath/clamp.h>
3031
#include <private/dsp/arch/aarch64/asimd/pmath/cos.h>
3132
#include <private/dsp/arch/aarch64/asimd/pmath/exp.h>
3233
#include <private/dsp/arch/aarch64/asimd/pmath/fmop_kx.h>
@@ -37,6 +38,7 @@
3738
#include <private/dsp/arch/aarch64/asimd/pmath/minmax.h>
3839
#include <private/dsp/arch/aarch64/asimd/pmath/op_kx.h>
3940
#include <private/dsp/arch/aarch64/asimd/pmath/op_vv.h>
41+
#include <private/dsp/arch/aarch64/asimd/pmath/pmix.h>
4042
#include <private/dsp/arch/aarch64/asimd/pmath/pow.h>
4143
#include <private/dsp/arch/aarch64/asimd/pmath/sin.h>
4244
#include <private/dsp/arch/aarch64/asimd/pmath/sqr.h>

include/private/dsp/arch/aarch64/asimd/pmath/clamp.h

Lines changed: 506 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <sadko4u@gmail.com>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 27 нояб. 2025 г.
7+
*
8+
* lsp-dsp-lib is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* any later version.
12+
*
13+
* lsp-dsp-lib is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef PRIVATE_DSP_ARCH_AARCH64_ASIMD_PMATH_PMIX_H_
23+
#define PRIVATE_DSP_ARCH_AARCH64_ASIMD_PMATH_PMIX_H_
24+
25+
#ifndef PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL
26+
#error "This header should not be included directly"
27+
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL */
28+
29+
#include <private/dsp/arch/aarch64/asimd/pmath/sin.h>
30+
31+
namespace lsp
32+
{
33+
namespace asimd
34+
{
35+
36+
} /* namespace asimd */
37+
} /* namespace lsp */
38+
39+
40+
41+
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_PMATH_PMIX_H_ */

src/main/aarch64/asimd.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@
480480
EXPORT1(uexpander_x1_curve);
481481
EXPORT1(dexpander_x1_gain);
482482
EXPORT1(dexpander_x1_curve);
483+
484+
EXPORT1(clamp_vv1);
485+
EXPORT1(clamp_vv2);
486+
EXPORT1(clamp_kk1);
487+
EXPORT1(clamp_kk2);
483488
}
484489
} /* namespace asimd */
485490
} /* namespace lsp */

src/test/ptest/pmath/clamp_kk1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ PTEST_BEGIN("dsp.pmath", clamp_kk1, 5, 1000)
110110
IF_ARCH_X86(CALL(avx::clamp_kk1));
111111
IF_ARCH_X86(CALL(avx512::clamp_kk1));
112112
IF_ARCH_ARM(CALL(neon_d32::clamp_kk1));
113-
// IF_ARCH_AARCH64(CALL(asimd::clamp_kk1));
113+
IF_ARCH_AARCH64(CALL(asimd::clamp_kk1));
114114
PTEST_SEPARATOR;
115115
}
116116

src/test/ptest/pmath/clamp_kk2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ PTEST_BEGIN("dsp.pmath", clamp_kk2, 5, 1000)
110110
IF_ARCH_X86(CALL(avx::clamp_kk2));
111111
IF_ARCH_X86(CALL(avx512::clamp_kk2));
112112
IF_ARCH_ARM(CALL(neon_d32::clamp_kk2));
113-
// IF_ARCH_AARCH64(CALL(asimd::clamp_kk2));
113+
IF_ARCH_AARCH64(CALL(asimd::clamp_kk2));
114114
PTEST_SEPARATOR;
115115
}
116116

src/test/ptest/pmath/clamp_vv1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ PTEST_BEGIN("dsp.pmath", clamp_vv2, 5, 1000)
114114
IF_ARCH_X86(CALL(avx::clamp_vv2));
115115
IF_ARCH_X86(CALL(avx512::clamp_vv2));
116116
IF_ARCH_ARM(CALL(neon_d32::clamp_vv2));
117-
// IF_ARCH_AARCH64(CALL(asimd::clamp_vv2));
117+
IF_ARCH_AARCH64(CALL(asimd::clamp_vv2));
118118
PTEST_SEPARATOR;
119119
}
120120

src/test/ptest/pmath/clamp_vv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ PTEST_BEGIN("dsp.pmath", clamp_vv1, 5, 1000)
114114
IF_ARCH_X86(CALL(avx::clamp_vv1));
115115
IF_ARCH_X86(CALL(avx512::clamp_vv1));
116116
IF_ARCH_ARM(CALL(neon_d32::clamp_vv1));
117-
// IF_ARCH_AARCH64(CALL(asimd::clamp_vv1));
117+
IF_ARCH_AARCH64(CALL(asimd::clamp_vv1));
118118
PTEST_SEPARATOR;
119119
}
120120

src/test/utest/pmath/clamp_kk1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ UTEST_BEGIN("dsp.pmath", clamp_kk1)
119119
IF_ARCH_X86(CALL(generic::clamp_kk1, avx::clamp_kk1, 32));
120120
IF_ARCH_X86(CALL(generic::clamp_kk1, avx512::clamp_kk1, 32));
121121
IF_ARCH_ARM(CALL(generic::clamp_kk1, neon_d32::clamp_kk1, 16));
122-
// IF_ARCH_AARCH64(CALL(generic::clamp_kk1, asimd::clamp_kk1, 16));
122+
IF_ARCH_AARCH64(CALL(generic::clamp_kk1, asimd::clamp_kk1, 16));
123123
}
124124
UTEST_END
125125

src/test/utest/pmath/clamp_kk2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ UTEST_BEGIN("dsp.pmath", clamp_kk2)
119119
IF_ARCH_X86(CALL(generic::clamp_kk2, avx::clamp_kk2, 32));
120120
IF_ARCH_X86(CALL(generic::clamp_kk2, avx512::clamp_kk2, 32));
121121
IF_ARCH_ARM(CALL(generic::clamp_kk2, neon_d32::clamp_kk2, 16));
122-
// IF_ARCH_AARCH64(CALL(generic::clamp_kk2, asimd::clamp_kk2, 16));
122+
IF_ARCH_AARCH64(CALL(generic::clamp_kk2, asimd::clamp_kk2, 16));
123123
}
124124
UTEST_END
125125

0 commit comments

Comments
 (0)