<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 --- - byte order in xmm clang assembly comments"
href="https://llvm.org/bugs/show_bug.cgi?id=28109">28109</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>byte order in xmm clang assembly comments
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>albertnetymk@gmail.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>```
#include "emmintrin.h"
int main(int argc, char *argv[])
{
volatile __m128i x = _mm_set_epi64x(1, 0);
return 0;
}
```
Give above program, I could get the assembly using `clang -O -S test.c`:
```
...
movl $1, %eax
movd %rax, %xmm0
pslldq $8, %xmm0 # xmm0 =
zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
...
```
According to the manual of
[_mm_set_epi64x](<a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_epi&expand=4562,4565,4567">https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_epi&expand=4562,4565,4567</a>),
`%xmm0` should be `[0, 1, 0, 0]`, with each element being an integer (32 bits).
However, according to the comment, `%xmm0` holds `[0, 0, 0, 1]`. I don't think
endianness is relevant here, for I am only looking at a register.
I suspect that it's sth related to the notation used by clang assembly comment,
but I can't find any useful info on it on the internet.
Reprinted from
<a href="http://stackoverflow.com/questions/37773274/byte-order-in-xmm-clang-assembly-comments">http://stackoverflow.com/questions/37773274/byte-order-in-xmm-clang-assembly-comments</a></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>