This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Build 32bit Python on Windows with SSE2 instruction set
Type: Stage: resolved
Components: Build, Windows Versions: Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: malin, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-03-19 04:36 by malin, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (1)
msg338317 - (view) Author: Ma Lin (malin) * Date: 2019-03-19 04:36
On windows, it seems 32bit builds (3.7.2/3.8.0a2) don't using SSE2 sufficiently.

I test on 3.8 branch, python38.dll only uses XMM register 28 times. The official build is the same.
After enable this option, python38.dll uses XMM register 11,704 times.

--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -88,6 +88,7 @@
       <AdditionalIncludeDirectories Condition="$(IncludeExternals)">$(zlibDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
     </ClCompile>
     <Link>
       <AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>

x86 instruction set has only a few number of registers.
In my understanding, using XMM registers on 32bit build will brings a small speed up.
I'm not an expert of this kind knowledge, sorry if I'm wrong.
History
Date User Action Args
2022-04-11 14:59:12adminsetgithub: 80538
2019-03-19 14:03:14malinsetstatus: open -> closed
stage: resolved
2019-03-19 04:36:08malincreate