Skip to content

Commit eade5a4

Browse files
committed
Merge branch 'avx512' into devel
* Implemented AVX-512 optimized minimum and maximum search functions.
2 parents 30eab07 + 0370f66 commit eade5a4

File tree

19 files changed

+1046
-16
lines changed

19 files changed

+1046
-16
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*******************************************************************************
44

55
=== 1.0.25 ===
6+
* Implemented AVX-512 optimized minimum and maximum search functions.
67
* Implemented AVX-512 optimized direct convolution function.
78
* Updated build scripts.
89

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 29 июл. 2024 г.
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_X86_AVX512_SEARCH_H_
23+
#define PRIVATE_DSP_ARCH_X86_AVX512_SEARCH_H_
24+
25+
#include <lsp-plug.in/dsp/common/types.h>
26+
27+
#include <private/dsp/arch/x86/avx512/search/minmax.h>
28+
#include <private/dsp/arch/x86/avx512/search/iminmax.h>
29+
30+
#endif /* PRIVATE_DSP_ARCH_X86_AVX512_SEARCH_H_ */

include/private/dsp/arch/x86/avx512/search/iminmax.h

Lines changed: 384 additions & 0 deletions
Large diffs are not rendered by default.

include/private/dsp/arch/x86/avx512/search/minmax.h

Lines changed: 499 additions & 0 deletions
Large diffs are not rendered by default.

src/main/x86/avx512.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <private/dsp/arch/x86/avx512/msmatrix.h>
5151
#include <private/dsp/arch/x86/avx512/pcomplex.h>
5252
#include <private/dsp/arch/x86/avx512/pmath.h>
53+
#include <private/dsp/arch/x86/avx512/search.h>
5354

5455
#include <private/dsp/arch/x86/avx512/correlation.h>
5556
#undef PRIVATE_DSP_ARCH_X86_AVX512_IMPL
@@ -260,6 +261,20 @@
260261
CEXPORT1(vl, pcomplex_r2c_div2);
261262
CEXPORT1(vl, pcomplex_c2r);
262263

264+
CEXPORT1(vl, min);
265+
CEXPORT1(vl, max);
266+
CEXPORT1(vl, minmax);
267+
CEXPORT1(vl, abs_min);
268+
CEXPORT1(vl, abs_max);
269+
CEXPORT1(vl, abs_minmax);
270+
271+
CEXPORT1(vl, min_index);
272+
CEXPORT1(vl, max_index);
273+
CEXPORT1(vl, minmax_index);
274+
CEXPORT1(vl, abs_min_index);
275+
CEXPORT1(vl, abs_max_index);
276+
CEXPORT1(vl, abs_minmax_index);
277+
263278
CEXPORT1(vl, lr_to_ms);
264279
CEXPORT1(vl, lr_to_mid);
265280
CEXPORT1(vl, lr_to_side);

src/test/ptest/search/abs_max_index.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ namespace lsp
4444
{
4545
size_t abs_max_index(const float *src, size_t count);
4646
}
47+
48+
namespace avx512
49+
{
50+
size_t abs_max_index(const float *src, size_t count);
51+
}
4752
)
4853

4954
IF_ARCH_ARM(
@@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", abs_max_index, 5, 1000)
101106
CALL(generic::abs_max_index);
102107
IF_ARCH_X86(CALL(sse2::abs_max_index));
103108
IF_ARCH_X86(CALL(avx2::abs_max_index));
109+
IF_ARCH_X86(CALL(avx512::abs_max_index));
104110
IF_ARCH_ARM(CALL(neon_d32::abs_max_index));
105111
IF_ARCH_AARCH64(CALL(asimd::abs_max_index));
106112
PTEST_SEPARATOR;

src/test/ptest/search/abs_min_index.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ namespace lsp
4444
{
4545
size_t abs_min_index(const float *src, size_t count);
4646
}
47+
48+
namespace avx512
49+
{
50+
size_t abs_min_index(const float *src, size_t count);
51+
}
4752
)
4853

4954
IF_ARCH_ARM(
@@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", abs_min_index, 5, 1000)
101106
CALL(generic::abs_min_index);
102107
IF_ARCH_X86(CALL(sse2::abs_min_index));
103108
IF_ARCH_X86(CALL(avx2::abs_min_index));
109+
IF_ARCH_X86(CALL(avx512::abs_min_index));
104110
IF_ARCH_ARM(CALL(neon_d32::abs_min_index));
105111
IF_ARCH_AARCH64(CALL(asimd::abs_min_index));
106112
PTEST_SEPARATOR;

src/test/ptest/search/abs_minmax_index.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ namespace lsp
4444
{
4545
void abs_minmax_index(const float *src, size_t count, size_t *min, size_t *max);
4646
}
47+
48+
namespace avx512
49+
{
50+
void abs_minmax_index(const float *src, size_t count, size_t *min, size_t *max);
51+
}
4752
)
4853

4954
IF_ARCH_ARM(
@@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", abs_minmax_index, 5, 1000)
101106
CALL(generic::abs_minmax_index);
102107
IF_ARCH_X86(CALL(sse2::abs_minmax_index));
103108
IF_ARCH_X86(CALL(avx2::abs_minmax_index));
109+
IF_ARCH_X86(CALL(avx512::abs_minmax_index));
104110
IF_ARCH_ARM(CALL(neon_d32::abs_minmax_index));
105111
IF_ARCH_AARCH64(CALL(asimd::abs_minmax_index));
106112
PTEST_SEPARATOR;

src/test/ptest/search/max_index.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ namespace lsp
4444
{
4545
size_t max_index(const float *src, size_t count);
4646
}
47+
48+
namespace avx512
49+
{
50+
size_t max_index(const float *src, size_t count);
51+
}
4752
)
4853

4954
IF_ARCH_ARM(
@@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", max_index, 5, 1000)
101106
CALL(generic::max_index);
102107
IF_ARCH_X86(CALL(sse2::max_index));
103108
IF_ARCH_X86(CALL(avx2::max_index));
109+
IF_ARCH_X86(CALL(avx512::max_index));
104110
IF_ARCH_ARM(CALL(neon_d32::max_index));
105111
IF_ARCH_AARCH64(CALL(asimd::max_index));
106112
PTEST_SEPARATOR;

src/test/ptest/search/min_index.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ namespace lsp
4444
{
4545
size_t min_index(const float *src, size_t count);
4646
}
47+
48+
namespace avx512
49+
{
50+
size_t min_index(const float *src, size_t count);
51+
}
4752
)
4853

4954
IF_ARCH_ARM(
@@ -101,6 +106,7 @@ PTEST_BEGIN("dsp.search", min_index, 5, 1000)
101106
CALL(generic::min_index);
102107
IF_ARCH_X86(CALL(sse2::min_index));
103108
IF_ARCH_X86(CALL(avx2::min_index));
109+
IF_ARCH_X86(CALL(avx512::min_index));
104110
IF_ARCH_ARM(CALL(neon_d32::min_index));
105111
IF_ARCH_AARCH64(CALL(asimd::min_index));
106112
PTEST_SEPARATOR;

0 commit comments

Comments
 (0)