audioconvert: add avx2 optimized s32_to f32d

Add an alternative avx2 s32_to_f32d implementation that doesn't use the
gather function for when gather is slow.

Don't overwrite the orinal cpu_flags but store the selected flags in a
new variable. Use this to debug the selected function cpu flags.

Build libraries with defines from previous libraries so that we can
reuse functions from them.

We can then remove the SSE2 | SLOW_GATHER function selection from the
list. We will now select avx2 and it will then switch implementations
based on the CPU flags.
This commit is contained in:
Wim Taymans 2026-03-20 17:53:00 +01:00
parent 3dff64364f
commit c02cdcb5ce
13 changed files with 218 additions and 38 deletions

View file

@ -44,7 +44,7 @@ endif
if have_sse2
audioconvert_sse2 = static_library('audioconvert_sse2',
['fmt-ops-sse2.c' ],
c_args : [sse2_args, '-O3', '-DHAVE_SSE2'],
c_args : [sse2_args, '-O3', '-DHAVE_SSE2', simd_cargs],
dependencies : [ spa_dep ],
install : false
)
@ -55,7 +55,7 @@ if have_ssse3
audioconvert_ssse3 = static_library('audioconvert_ssse3',
['fmt-ops-ssse3.c',
'resample-native-ssse3.c' ],
c_args : [ssse3_args, '-O3', '-DHAVE_SSSE3'],
c_args : [ssse3_args, '-O3', '-DHAVE_SSSE3', simd_cargs],
dependencies : [ spa_dep ],
install : false
)
@ -65,7 +65,7 @@ endif
if have_sse41
audioconvert_sse41 = static_library('audioconvert_sse41',
['fmt-ops-sse41.c'],
c_args : [sse41_args, '-O3', '-DHAVE_SSE41'],
c_args : [sse41_args, '-O3', '-DHAVE_SSE41', simd_cargs],
dependencies : [ spa_dep ],
install : false
)
@ -75,7 +75,7 @@ endif
if have_avx2 and have_fma
audioconvert_avx2_fma = static_library('audioconvert_avx2_fma',
['resample-native-avx2.c'],
c_args : [avx2_args, fma_args, '-O3', '-DHAVE_AVX2', '-DHAVE_FMA'],
c_args : [avx2_args, fma_args, '-O3', '-DHAVE_AVX2', '-DHAVE_FMA', simd_cargs],
dependencies : [ spa_dep ],
install : false
)
@ -85,7 +85,7 @@ endif
if have_avx2
audioconvert_avx2 = static_library('audioconvert_avx2',
['fmt-ops-avx2.c'],
c_args : [avx2_args, '-O3', '-DHAVE_AVX2'],
c_args : [avx2_args, '-O3', '-DHAVE_AVX2', simd_cargs],
dependencies : [ spa_dep ],
install : false
)