We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3565

Summary: CMake+GCC forces x86 FPU when it meant to force SSE.
Product: SDL Reporter: Ryan C. Gordon <icculus>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: All   

Description Ryan C. Gordon 2017-01-23 06:18:58 UTC
So this section here...

https://hg.libsdl.org/SDL/file/79e882826ed4/CMakeLists.txt#l519

...appears to be saying "if you have SSE support in your compiler, and you're running GCC, turn off SSE support and generate code that uses the FPU instead."

Am I reading this wrong?

Note that this won't stop the use of SSE compiler intrinsics, this is specifically for what the compiler will generate when doing floating point math in normal boring C code.

This might be a transcribing bug when the CMake file converted over from the configure script. Someone, possibly me, should double-check this when they're on a GCC-based system.

--ryan.
Comment 1 Sam Lantinga 2017-01-23 18:01:36 UTC
Maybe so the generated binary is compatible with systems without SSE support?
Comment 2 Ryan C. Gordon 2017-01-24 17:16:24 UTC
(In reply to Sam Lantinga from comment #1)
> Maybe so the generated binary is compatible with systems without SSE support?

I think it was a translation error when converting code from configure.in:

    if test x$enable_ssemath = xno; then
        if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then
            EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
        fi
    fi

So in CMakeLists.txt, that "if(SSEMATH)" was probably supposed to be "if(NOT SSEMATH)"

--ryan.
Comment 3 Ryan C. Gordon 2017-01-24 17:22:22 UTC
I just fixed this with https://hg.libsdl.org/SDL/rev/7764aba2f211

--ryan.