properly separate code built with different CPU settings

Desktop / LibreOffice - Luboš Luňák [collabora.com] - 13 September 2021 09:08 UTC

Trying to write smart code and mixing different CPU flags doesn't play nice together. Those global variables are not runtime-protected by a CPU check, and so may crash with illegal instruction error. And those inline functions may not get inlined and the compiler is free to choose just one copy, any of them, so it may be the one requiring the most demanding CPU settings. So use only dumb code in files compiled with CPU intrinsics.

Change-Id: I8200fd4d9f991fab6fdc741120e7aa96ff9b470d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121929

26072b8db7ba properly separate code built with different CPU settings
sc/inc/arraysumfunctor.hxx | 25 +---------------
sc/inc/arraysumfunctorinternal.hxx | 34 ++++++++++++++++++++++
sc/inc/kahan.hxx | 8 ++++++
sc/qa/unit/functions_statistical.cxx | 6 ++--
sc/source/core/tool/arraysum.hxx | 52 ++++++++++++++++++++++++++++++++++
sc/source/core/tool/arraysumAVX.cxx | 22 ++++++++------
sc/source/core/tool/arraysumAVX512.cxx | 33 ++++++++++++---------
sc/source/core/tool/arraysumSSE2.cxx | 23 ++++++++-------
8 files changed, 144 insertions(+), 59 deletions(-)

Upstream: cgit.freedesktop.org


  • Share