From 5b9cf5881ef53fac5f1d8376f687dbadf9d3cf2b Mon Sep 17 00:00:00 2001 From: dante Date: Sun, 16 May 2021 16:04:20 +0200 Subject: tdf#142307 - Upgrade SSE2 sum to AVX512 sum with Neumaier 1 This part focuses on allowing it on replacing arrayfunctor By thefault it will try AVX512F (1,17%) If not available will use AVX (94,77%) Use of AVX2 (82,28%) has been avoided even if the code could been more compact Source of hardware statistics: https://store.steampowered.com/hwsurvey Change-Id: Iae737a565379e82c5f84f3fdee6321ac74f59d40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115675 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- tools/source/misc/cpuid.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/source/misc') diff --git a/tools/source/misc/cpuid.cxx b/tools/source/misc/cpuid.cxx index 0395d0e0f001..855b87e6da63 100644 --- a/tools/source/misc/cpuid.cxx +++ b/tools/source/misc/cpuid.cxx @@ -56,6 +56,7 @@ bool checkAVXSupportInOS() #define XSAVE_bit (1 << 27) #define AVX_bit (1 << 28) #define AVX2_bit (1 << 5) +#define AVX512F_bit (1 << 16) InstructionSetFlags getCpuInstructionSetFlags() { @@ -98,6 +99,8 @@ InstructionSetFlags getCpuInstructionSetFlags() if ((aExtendedInfo[1] & AVX2_bit) != 0) eInstructions |= InstructionSetFlags::AVX2; + if ((aExtendedInfo[1] & AVX512F_bit) != 0) + eInstructions |= InstructionSetFlags::AVX512F; } } } @@ -127,6 +130,8 @@ OUString instructionSetSupportedString() aString += "AVX "; if (isCpuInstructionSetSupported(InstructionSetFlags::AVX2)) aString += "AVX2 "; + if (isCpuInstructionSetSupported(InstructionSetFlags::AVX512F)) + aString += "AVX512F "; return aString; } -- cgit