bloomberg/bde

SSE cpuid bad bad

seanbaxter opened this issue · 3 comments

bsls_platform.t fails in case 5 here

        int info[4];
        cpuid(info, 0);
        if (info[0] >= 0x00000001) {
            cpuid(info, 0x00000001);
        }
        #ifdef BSLS_PLATFORM_CPU_SSE3
            ASSERT(1 == ((info[2] >>  0) & 0x1));
        #else
            ASSERT(0 == ((info[2] >>  0) & 0x1));
        #endif

When you compile without BSLS_PLATFORM_CPU_SSE3, the assert fails. Because, of course, compiling without a macro won't disable the feature on the processor!

Is cmake_build.py configure supposed to add the SSE3 flag? It doesn't on my system, which is why I get this test failure.

cmake/toolchains/linux/gcc-default.cmake:32: "-mfpmath=sse "
cmake/toolchains/linux/gcc-default.cmake:37: "-mfpmath=sse "

This is the flag passed by default to gcc (only). You probably need this for clang-based toolchain.
I'll look into it tomorrow.