[LLVMbugs] [Bug 22010] New: Wrong alignment with _mm_move_epi64()

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 23 02:31:15 PST 2014


            Bug ID: 22010
           Summary: Wrong alignment with _mm_move_epi64()
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vvsed at hotmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This program crashes due to wrong alignment.
_mm_move_epi64() translates to vmovapd instead of movq.
Similar _mm_loadl_epi64() intrinsic works well.
Tested it with -O2 -mavx2 options; perhaps that doesn't matter.

#include <stdlib.h>
#include <stdio.h>
#include <emmintrin.h>

__attribute__((aligned(16))) int    zz[8];

int main()
    __m128i r = _mm_move_epi64(*(__m128i *)(zz + 1));
    r = _mm_castpd_si128(_mm_loadh_pd(_mm_castsi128_pd(r), (const double

    printf("%d", _mm_cvtsi128_si32(r));
    return 0;

// 64-bit
vmovapd     xmm0,xmmword ptr [13F2422F4h]        //movq
vmovhpd     xmm0,xmm0,qword ptr [13F2422F0h]  

// 32-bit
vmovapd     xmm0,xmmword ptr ds:[0F13034h]        //movq
vmovhpd     xmm0,xmm0,qword ptr ds:[0F13030h]

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/20141223/7ba2df94/attachment.html>

More information about the llvm-bugs mailing list