Fix SIMD for x64 with MSVC

Issue #384 resolved
Phil created an issue

The SIMD settings https://bitbucket.org/blaze-lib/blaze/src/f8445b46a7ac1590d9760977055413d6134fbf85/blaze/system/Vectorization.h#lines-123,140 are not triggered on x64 for MSVC, since MSVC neither defines __SSE__ nor __SSE2__. And _M_IX86_FP is only defined with x86.

It seems MSVC enables SSE/SSE2 with x64 by default. So similarly to this commit https://github.com/cdwfs/mathfu/commit/16f8fa5e779e62f29c9b3f1f7c12942f195d860f?branch=16f8fa5e779e62f29c9b3f1f7c12942f195d860f&diff=split the solution is to simply change the checks to this:

#if BLAZE_USE_VECTORIZATION && ( defined(__SSE__) || ( _M_IX86_FP > 0 ) || defined(_M_AMD64) || defined(_M_X64) )
...
#if BLAZE_USE_VECTORIZATION && ( defined(__SSE2__) || ( _M_IX86_FP > 1 ) || defined(_M_AMD64) || defined(_M_X64) )

Comments (7)

  1. Klaus Iglberger

    Hi Phil!

    Thanks a lot for catching this problem. We’ll update the SSE flags immediately.

    Best regards,

    Klaus!

  2. Klaus Iglberger

    Commit 5fd8caa fixes the SSE and SSE2 mode for MSVC and x64. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9.

  3. Log in to comment