[llvm-bugs] [Bug 28510] New: SSE compare float to integer _mm_comige_ss family of instructions has changed behavior

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 11 14:39:17 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28510

            Bug ID: 28510
           Summary: SSE compare float to integer _mm_comige_ss family of
                    instructions has changed behavior
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jujjyl at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

STR:

#include <xmmintrin.h>
#include <math.h>
#include <stdio.h>

int main()
{
    __m128 a = _mm_set1_ps(42.f);
    __m128 b = _mm_set1_ps(NAN);

    int equal = _mm_comieq_ss(a, b);
    printf("equal: %d\n", equal);
}

Clang/LLVM <= 3.8, GCCs and Visual Studios will print "equal: 1" as expected
(although unintuitive), but the current Clang trunk will print "equal: 0"
instead.

We are currently discussing this change in behavior in
https://github.com/kripken/emscripten/issues/4435 as well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160711/58303624/attachment-0001.html>


More information about the llvm-bugs mailing list