Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this? #69548

Closed
lac mannequin opened this issue Oct 10, 2015 · 16 comments
Closed

Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this? #69548

lac mannequin opened this issue Oct 10, 2015 · 16 comments
Assignees
Labels
3.8 only security fixes build The build process and cross-build OS-windows stdlib Python modules in the Lib dir

Comments

@lac
Copy link
Mannequin

lac mannequin commented Oct 10, 2015

BPO 25361
Nosy @pfmoore, @tjguk, @merwok, @zware, @eryksun, @zooba, @dstufft, @animalize
PRs
  • bpo-25361: enables use of SSE2 instructions in Windows 32-bit build. #12438
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2015-10-11.22:17:40.590>
    created_at = <Date 2015-10-10.10:43:24.294>
    labels = ['3.8', 'build', 'library', 'OS-windows']
    title = 'Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this?'
    updated_at = <Date 2019-06-24.23:43:29.576>
    user = 'https://bugs.python.org/lac'

    bugs.python.org fields:

    activity = <Date 2019-06-24.23:43:29.576>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2015-10-11.22:17:40.590>
    closer = 'steve.dower'
    components = ['Build', 'Distutils', 'Windows']
    creation = <Date 2015-10-10.10:43:24.294>
    creator = 'lac'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 25361
    keywords = ['3.5regression']
    message_count = 16.0
    messages = ['252703', '252710', '252712', '252714', '252729', '252730', '252741', '252742', '252746', '252747', '252806', '252822', '252826', '338359', '340094', '346452']
    nosy_count = 11.0
    nosy_names = ['paul.moore', 'tim.golden', 'eric.araujo', 'docs@python', 'python-dev', 'zach.ware', 'eryksun', 'steve.dower', 'dstufft', 'malin', 'lac']
    pr_nums = ['12438']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue25361'
    versions = ['Python 3.8']

    @lac
    Copy link
    Mannequin Author

    lac mannequin commented Oct 10, 2015

    Another report in to webmaster:
    I tried to install Python 3.5.0 from [1]https://www.python.org/ftp/python/
    3.5.0/python-3.5.0.exe but I get an error and I'm not able to install, is
    this exe compiled with SSE2 instructions? Apparently no msi available

    Does this need a mention somewhere?

    @lac lac mannequin assigned docspython Oct 10, 2015
    @lac lac mannequin added docs Documentation in the Doc dir topic-installation OS-windows labels Oct 10, 2015
    @eryksun
    Copy link
    Contributor

    eryksun commented Oct 10, 2015

    With Visual Studio 2010 and earlier, SSE support had to be explicitly enabled. Starting with VS2012 it's on by default 1:

    Because the x86 compiler generates code that uses SSE2 
    instructions by default, you must specify /arch:IA32 to 
    disable generation of SSE and SSE2 instructions for x86 
    processors.
    

    For 3.5, the 32-bit build does use SSE2 instructions. For example, float_add uses the addsd instruction (opcode F2 0F 58):

    0:000> s python35!float_add l100 f2 0f 58
    71f6c5d8  f2 0f 58 44 24 08 8b 0d-84 11 18 72 f2 0f 11 44  ..XD$......r...D
    0:000> u 71f6c5d8 l3
    python35!float_add+0x98:
    71f6c5d8 f20f58442408    addsd   xmm0,mmword ptr [esp+8]
    71f6c5de 8b0d84111872    mov     ecx,dword ptr [python35!free_list (72181184)]
    71f6c5e4 f20f11442410    movsd   mmword ptr [esp+10h],xmm0
    

    Thus 3.5 doesn't support older CPUs that lack SSE2, such as the AMD Athlon XP. I didn't check the installer itself, but that would be a pointless exercise.

    @lac
    Copy link
    Mannequin Author

    lac mannequin commented Oct 10, 2015

    Okay then, wherever we put the -- Beginning with 3.5 we are not
    supporting 3.5 we need to also tell people whose CPUs lack SSE2
    that they are out of luck, as well.

    @zooba
    Copy link
    Member

    zooba commented Oct 10, 2015

    Did that report come with any reason for SSE to be relevant, such as an error message or log file?

    Windows requires SSE these days, since Vista IIRC, so the problem is probably someone on XP.

    @lac
    Copy link
    Mannequin Author

    lac mannequin commented Oct 10, 2015

    Further conversation has confirmed that the person is on XP.

    @lac
    Copy link
    Mannequin Author

    lac mannequin commented Oct 10, 2015

    He says that he got an error saying something was compiled SSE2 and needed to be SSE, but if we are going to detect XP then that will be
    a better error message.

    @eryksun
    Copy link
    Contributor

    eryksun commented Oct 10, 2015

    Windows requires SSE these days, since Vista IIRC, so the problem
    is probably someone on XP.

    Windows 8 is the first to require SSE2 1. I'm sure it's no coincidence that this became the default in VS 2012.

    There is probably a small minority of users that upgraded to 32-bit Windows 7 on old hardware. Python 3.5 excludes them, but I don't think the build should switch to using /arch:IA32 just to support them. If a user on such a system really needs 3.5, it's possible to create a private build without SSE2. Most packages that have extension modules will also have to be built from source instead of using prebuilt wheels.

    @lac
    Copy link
    Mannequin Author

    lac mannequin commented Oct 10, 2015

    Ok, where do we put the info about how to create a private build? And
    who will write it? (I lack the understanding.) Does it belong in:
    https://docs.python.org/3/using/windows.html

    or some place else?

    @eryksun
    Copy link
    Contributor

    eryksun commented Oct 10, 2015

    Building Python 3.5 requires Visual Studio 2015 and Windows 8.1, so this would be a vanishingly small audience that's building to deploy on old 32-bit Windows 7 machines. I don't think the PSF needs to worry about this. Anyway, the "/arch (x86)" docs 1 explain how to configure a project to use IA32, and PCBuild/readme.txt [2] explains how to build Python using Visual Studio 2015. I know this doesn't really help a novice user; just tell them to install Python 3.4!

    @eryksun
    Copy link
    Contributor

    eryksun commented Oct 10, 2015

    Sorry, I forgot to include the link to readme.txt:

    @zooba
    Copy link
    Member

    zooba commented Oct 11, 2015

    Since we officially support platforms that don't require SSE, I'll disable those instructions for 3.5.1.

    As eryksun points out, this doesn't affect 64-bit builds, which are the standard for most performance critical uses anyway.

    @zooba zooba added build The build process and cross-build stdlib Python modules in the Lib dir and removed docs Documentation in the Doc dir topic-installation labels Oct 11, 2015
    @zooba zooba assigned zooba and unassigned docspython Oct 11, 2015
    @lac
    Copy link
    Mannequin Author

    lac mannequin commented Oct 11, 2015

    Another 2 bits of data:

    I now know of 2 separate users from a Swedish teenager mailing list, whose machines (in each case 'my father's old laptop') didn't have SSE2. One youth was running XP but spent today successfully migrating to windows 7 with help from her father. The other was already running windows 7.

    Neither of them had ever used Python before. They are now running
    3.4.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 11, 2015

    New changeset 15f6bbe944fa by Steve Dower in branch '3.5':
    Issue bpo-25361: Disables use of SSE2 instructions in Windows 32-bit build
    https://hg.python.org/cpython/rev/15f6bbe944fa

    New changeset 3cf8c2930373 by Steve Dower in branch 'default':
    Issue bpo-25361: Disables use of SSE2 instructions in Windows 32-bit build
    https://hg.python.org/cpython/rev/3cf8c2930373

    @zooba zooba closed this as completed Oct 11, 2015
    @animalize
    Copy link
    Mannequin

    animalize mannequin commented Mar 19, 2019

    It seems SSE2 can be re-enabled for 3.8 branch.

    Starting with the March 2018 Windows 7 updates,
    security patches will only install on SSE2 or higher
    computing devices. This change only affects a small #
    of users on 15-20 year old legacy PCs.

    https://blogs.msmvps.com/harrywaldron/2018/06/25/windows-7-sse2-compliance-required-for-security-updates/

    @animalize animalize mannequin added the 3.8 only security fixes label Mar 19, 2019
    @zooba
    Copy link
    Member

    zooba commented Apr 12, 2019

    For 3.8 we support as far back as Win7 SP1 with the update for secure DLL loading, neither of which require SSE2. So we should hold this for 3.9 when we drop Win7 completely.

    @zooba
    Copy link
    Member

    zooba commented Jun 24, 2019

    New changeset 8bd2872 by Steve Dower (animalize) in branch 'master':
    bpo-25361: Enable SSE2 instructions for Windows 32-bit build (GH-12438)
    8bd2872

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes build The build process and cross-build OS-windows stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants