jgaeddert / liquid-dsp

digital signal processing library for software-defined radios
http://liquidsdr.org
MIT License
1.9k stars 443 forks source link

Add SIMD versions of scrambler and vector multiplication #361

Open vankxr opened 6 months ago

vankxr commented 6 months ago

Adds x86 SIMD implementations of scrambler and vectorcf_mul. Some consolidation of the configuration file which is ready for other vector* module SIMD implementations.

For now, I only implemented those two since it's what currently speeds up my application, given the modules I am utilizing. Attached is a text file with results of the included benchmark where the performance improvement can be seen. For the scrambler module, packetizer results are used to compare between implementations. For the vectorcf_mul module, qdetector is used. In the case of qdetector, the performance improvement is kind of negligible, since the vector multiplication is not where most of the time is spent. The packetizer, however greatly benefits from the scrambler SIMD implementation, showing about a 4x to 5x performance difference when comparing the portable version with the AVX2 version.

As for AVX512, the performance increase is in the error margin, and sometimes shows a degradation. Kind of expected, given past experiences with it, and maybe that's why Intel killed it on consumer CPUs. Nevertheless it is there, shall anyone find it useful.

Benchmark ran on an Intel 11th gen 11950H CPU liquid_perf.txt

As a sidenote, I have made some experiments with Manchester encoding using x86 SIMD instructions, which I think would fit in this library. https://github.com/vankxr/manchester-simd

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 72.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 78.010%. Comparing base (e56e4dd) to head (560678b). Report is 4 commits behind head on master.

Files Patch % Lines
src/vector/src/vectorcf_mul.avx.c 44.736% 21 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #361 +/- ## ============================================= - Coverage 78.040% 78.010% -0.030% ============================================= Files 207 208 +1 Lines 18967 19014 +47 Branches 2550 2555 +5 ============================================= + Hits 14802 14833 +31 - Misses 3260 3278 +18 + Partials 905 903 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.