Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

bug report for XE 15: unaligned access in _mm256_cvtepi16_epi32()

$
0
0

Hi,
I found a crash because of unaligned memory access for intrinsic _mm256_cvtepi16_epi32(*ptr)
This looks strange because CPU support unaligned source operand for VPMOVSXWD(*mem),
but Intel's Compiler XE 15 generates two instructions for this intrinsic:
VMOWDQA(*mem) - load to xmm register first, then:
VPMOVSXWD(xmm)

This happens in Debug - mode only, for x86 and x64.
MSVC 2013 works fine in Debug / Release / x86 / x64

Sample code :
__m256i p = _mm256_cvtepi16_epi32(*((const __m128i *)&buff[i])); // <-- unaligned memory access

Solution:
__m256i p = _mm256_cvtepi16_epi32(_mm_loadu_si128((const __m128i *)&buff[i]));

Thanks

Zone: 

Thread Topic: 

Bug Report

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>