http://llvm.org/bugs/show_bug.cgi?id=22010

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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
*)zz));

    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to