jgaeddert / liquid-dsp

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

Add AVX SIMD implementations #307

Closed vankxr closed 1 year ago

vankxr commented 1 year ago

Added AVX implementations of the existent SIMD accelerated modules (dotprod and sumsq). Also updated the autoconf script which detects CPU features, to be able to detect more recent features.

Benchmark results are attached, both for the current HEAD (SSE4.1) and my AVX implementation. A quick comparation of the results (benchmarks whose performance increase is below 1.2x are ommited).

dotprod_cccf_256: 1.798x
dotprod_crcf_16: 1.312x
dotprod_rrrf_16: 1.385x
dotprod_rrrf_64: 1.682x
dotprod_rrrf_256: 1.786x
sumsqf_64: 1.319x
sumsqf_256: 1.741x
sumsqcf_64: 1.586x
sumsqcf_256: 2.042x
fec_enc_hamming84_n64: 1.689x
fecsoft_dec_rep3_n64: 1.367x
interleaver_1024: 1.210x
fft_138: 1.274x
fft_271: 1.230x
fftfilt_crcf_16: 1.333x
firhilbf_decim_m13: 1.217x
irfilt_crcf_dcblock: 1.347x
presync_cccf_128: 1.241x
presync_cccf_256: 1.516x
detector_cccf_128: 1.381x
detector_cccf_256: 1.586x
polyf_fit_q3_n8: 1.494x
matrixf_linsolve_n2: 1.200x
fskdem_misc_M4: 1.201x
fskdem_misc_M256: 1.348x
modulate_dpsk8: 1.240x
firpfbch2_crcf_a1024: 1.282x
firpfbch2_crcf_s512: 1.688x

Benchmarked on an i7-8750H.

AVX-512 should also be possible this way, but may have to look deeper into it, since there is no such thing as __mm512_dp_ps, for example.

codecov[bot] commented 1 year ago

Codecov Report

Base: 80.88% // Head: 80.87% // Decreases project coverage by -0.00% :warning:

Coverage data is based on head (268fee4) compared to base (2dfe2ef). Patch coverage: 97.77% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #307 +/- ## ========================================== - Coverage 80.88% 80.87% -0.01% ========================================== Files 359 359 Lines 27093 27093 ========================================== - Hits 21913 21912 -1 - Misses 5180 5181 +1 ``` | [Impacted Files](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert) | Coverage Δ | | |---|---|---| | [src/dotprod/src/dotprod\_cccf.avx.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL2RvdHByb2RfY2NjZi5hdnguYw==) | `95.23% <95.23%> (ø)` | | | [src/dotprod/src/dotprod\_rrrf.avx.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL2RvdHByb2RfcnJyZi5hdnguYw==) | `99.09% <99.09%> (ø)` | | | [src/dotprod/src/dotprod\_crcf.avx.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL2RvdHByb2RfY3JjZi5hdnguYw==) | `99.20% <99.20%> (ø)` | | | [src/dotprod/src/sumsq.avx.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL3N1bXNxLmF2eC5j) | `100.00% <100.00%> (ø)` | | | [src/modem/src/modem\_dpsk.proto.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL21vZGVtL3NyYy9tb2RlbV9kcHNrLnByb3RvLmM=) | `93.61% <0.00%> (-2.13%)` | :arrow_down: | | [src/dotprod/src/dotprod\_cccf.mmx.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL2RvdHByb2RfY2NjZi5tbXguYw==) | | | | [src/dotprod/src/sumsq.mmx.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL3N1bXNxLm1teC5j) | | | | [src/dotprod/src/dotprod\_crcf.mmx.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL2RvdHByb2RfY3JjZi5tbXguYw==) | | | | [src/dotprod/src/dotprod\_rrrf.sse4.c](https://codecov.io/gh/jgaeddert/liquid-dsp/pull/307/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert#diff-c3JjL2RvdHByb2Qvc3JjL2RvdHByb2RfcnJyZi5zc2U0LmM=) | | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Joseph+D.+Gaeddert)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.