by kierank · 2y ago · 0 comments
v210_planar_pack_8_ssse3: 402.5
v210_planar_pack_8_avx: 413.0
v210_planar_pack_8_avx2: 206.0
v210_planar_pack_8_avx512: 193.0
v210_planar_pack_8_avx512icl: 100.0
23x speedup. The compiler isn't going to come up with some of the trickery to make this function 23x faster.
800% is nothing.
Based on the performance numbers, whoever was writing that test neglected to implement manual vectorization for the C version. Which is the only reason why assembly is 23x faster for that test. If they rework their C version with the focus on performance i.e. using SIMD intrinsics, pretty sure the performance difference between C and assembly versions gonna be very unimpressive, like couple percent.
The other ones aren't in asm merely because video codecs are "performance sensitive", it's because they're run in such specific contexts that optimizations work that can't be expressed portably in C+intrinsics across the supported compilers and OSes.
However, can’t you have 5 different non-portable optimized C versions, just like you do with the assembly code?
SIMD intrinsics are generally portable across compilers and OSes, because their C API is defined by Intel, not by compiler or OS vendors. When I want software optimized for multiple targets like SSE, AVX1, AVX2, I sometimes do that in C++.