| 1 |
/* |
| 2 |
* Copyright (C) 2026 Linux Studio Plugins Project <https://lsp-plug.in/> |
| 3 |
* (C) 2026 Vladimir Sadovnikov <[email protected]> |
| 4 |
* |
| 5 |
* This file is part of lsp-dsp-lib |
| 6 |
* Created on: 2 авг. 2026 г. |
| 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_AVX_EXPORT_H_ |
| 23 |
#define PRIVATE_DSP_ARCH_X86_AVX_EXPORT_H_ |
| 24 |
|
| 25 |
#ifndef PRIVATE_DSP_ARCH_X86_AVX_IMPL |
| 26 |
#error "This header should not be included directly" |
| 27 |
#endif /* PRIVATE_DSP_ARCH_X86_AVX_IMPL */ |
| 28 |
|
| 29 |
#define EXPORT2(function, export) \ |
| 30 |
{ \ |
| 31 |
dsp::function = avx::export; \ |
| 32 |
dsp::LSP_DSP_LIB_MANGLE(function) = avx::export; \ |
| 33 |
TEST_EXPORT(avx::export); \ |
| 34 |
} |
| 35 |
#define EXPORT1(function) EXPORT2(function, function) |
| 36 |
|
| 37 |
#define EXPORT2_X64(function, export) IF_ARCH_X86_64(EXPORT2(function, export)); |
| 38 |
#define SUPPORT_X64(function) IF_ARCH_X86_64(TEST_EXPORT(avx::function)) |
| 39 |
|
| 40 |
#define CEXPORT2(cond, function, export) \ |
| 41 |
IF_ARCH_X86( \ |
| 42 |
TEST_EXPORT(avx::export); \ |
| 43 |
if (cond) \ |
| 44 |
dsp::function = avx::export; \ |
| 45 |
); |
| 46 |
|
| 47 |
#define CEXPORT1(cond, export) \ |
| 48 |
IF_ARCH_X86( \ |
| 49 |
TEST_EXPORT(avx::export); \ |
| 50 |
if (cond) \ |
| 51 |
dsp::export = avx::export; \ |
| 52 |
); |
| 53 |
|
| 54 |
#define CEXPORT2_X64(cond, function, export) \ |
| 55 |
IF_ARCH_X86_64( \ |
| 56 |
TEST_EXPORT(avx::export); \ |
| 57 |
if (cond) \ |
| 58 |
dsp::function = avx::export; \ |
| 59 |
); |
| 60 |
|
| 61 |
#define CEXPORT1_X64(cond, export) \ |
| 62 |
IF_ARCH_X86_64( \ |
| 63 |
TEST_EXPORT(avx::export); \ |
| 64 |
if (cond) \ |
| 65 |
dsp::export = avx::export; \ |
| 66 |
); |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
#endif /* PRIVATE_DSP_ARCH_X86_AVX_EXPORT_H_ */ |