[llvm-bugs] [Bug 28109] New: byte order in xmm clang assembly comments

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 13 05:19:03 PDT 2016


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

            Bug ID: 28109
           Summary: byte order in xmm clang assembly comments
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: albertnetymk at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

```
#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](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_set_epi&expand=4562,4565,4567),
`%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
http://stackoverflow.com/questions/37773274/byte-order-in-xmm-clang-assembly-comments

-- 
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/20160613/e490e635/attachment.html>


More information about the llvm-bugs mailing list