<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [x86] _mm_cmp_ps (and related FP compare intrinsics) should not be available without AVX"
href="https://llvm.org/bugs/show_bug.cgi?id=28112">28112</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[x86] _mm_cmp_ps (and related FP compare intrinsics) should not be available without AVX
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>spatel+llvm@rotateright.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Taking the example from <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [x86, AVX] conflicting definitions for FP compare intrinsics"
href="show_bug.cgi?id=28110">bug 28110</a>:
$ cat avx_oeq.c
#include <immintrin.h>
#include <stdio.h>
int main() {
// Init to NAN vals.
__m128i a = _mm_set1_epi32(0x7f800001);
__m128i b = _mm_set1_epi32(0x7f800001);
__m128 cmp = _mm_cmp_ps((__m128)a, (__m128)b, 0);
printf("cmpeq nan: %d\n", _mm_movemask_ps(cmp));
cmp = _mm_cmp_ps((__m128)a, (__m128)b, 8);
printf("cmpeq8 nan: %d\n", _mm_movemask_ps(cmp));
return 0;
}
The general FP compare intrinsics probably should not be accepted without AVX.
Currently, we can get subtly strange/wrong behavior:
$ ./clang -v
clang version 3.9.0 (trunk 272510)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Users/spatel/myllvm/build/bin/.
$ ./clang avx_oeq.c ; ./a.out
cmpeq nan: 0
cmpeq8 nan: 0
$ ./clang avx_oeq.c -mavx ; ./a.out
cmpeq nan: 0
cmpeq8 nan: 15</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>