remove AVX and AVX512 code from Calc
commitd7a727334b50253e86f21e5ff34ac361e13c3b37
authorLuboš Luňák <l.lunak@collabora.com>
Wed, 9 Feb 2022 15:23:33 +0000 (9 16:23 +0100)
committerEike Rathke <erack@redhat.com>
Thu, 10 Feb 2022 19:56:06 +0000 (10 20:56 +0100)
tree0558b42c3a216da5736a72a4e4608e67b481c0a5
parent7cddf9609df427c0a87d759cfeab2a6a34ef211b
remove AVX and AVX512 code from Calc

It's been a source of numerous problems since the beginning.
Poor separation of C++ code causing the compiler to emit some generic
code as CPU-specific, compiler optimizations moving CPU-specific
code out of #ifdef to unguarded static initialization, etc.

And it doesn't seem to even particularly improve performance,
on my Ryzen2500U for one full column (1m cells) sumArray() takes
about 1.6ms with AVX, 1.9ms with SSE2 and 4.6ms with generic code.
So SSE2 code is perhaps worth it, especially given that SSE2 is our
baseline requirement on x86_64 everywhere and x86 on Windows,
but AVX+ is nowhere near worth the trouble.

So this code removes all AVX+ code from Calc, and makes SSE2
a hardcoded option on where it's guaranteed. If we raise the baseline
to AVX, the SSE2 code may be replaced by the one removed by this
commit. Generic code is there for other platforms, if other platforms
add CPU-specific code, they should preferably follow the same rules.

This does not necessarily mean that CPU-specific code cannot
be used at all. Some externals use them, for example. It just
needs to be working, maintained, and worth the trouble.

Change-Id: I5ab919930df9d0223db68a94bf84947984d313ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129733
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129792
include/tools/cpuid.hxx
include/tools/simdsupport.hxx
sc/Library_sc.mk
sc/inc/arraysumfunctor.hxx
sc/inc/arraysumfunctorinternal.hxx [deleted file]
sc/inc/kahan.hxx
sc/qa/unit/functions_statistical.cxx
sc/source/core/tool/arraysum.hxx
sc/source/core/tool/arraysumAVX.cxx [deleted file]
sc/source/core/tool/arraysumAVX512.cxx [deleted file]
sc/source/core/tool/arraysumSSE2.cxx