<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - [X86][AVX] _mm256_loadu2* intrinsic wrappers contain unnecessary bitcasts"
href="https://bugs.llvm.org/show_bug.cgi?id=51796">51796</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[X86][AVX] _mm256_loadu2* intrinsic wrappers contain unnecessary bitcasts
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Headers
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>llvm-dev@redking.me.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>craig.topper@gmail.com, lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org, pengfei.wang@intel.com, richard-llvm@metafoo.co.uk, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>__m256 _mm256_loadu2_m128 (float const* hiaddr, float const* loaddr)
__m256d _mm256_loadu2_m128d (double const* hiaddr, double const* loaddr)
__m256i _mm256_loadu2_m128i (__m128i const* hiaddr, __m128i const* loaddr)
<a href="https://simd.godbolt.org/z/rG5s6M9bW">https://simd.godbolt.org/z/rG5s6M9bW</a>
The _mm256_loadu2 load-concatenate wrappers end up with bitcasts between
various vector types. This makes it trickier for various vector combines -
using the _mm256_set_m128/_mm256_setr_m128* concatenation wrappers instead
seems to avoid this.
__m256i load2(const __m128i *lo, const __m128i *hi) {
return _mm256_loadu2_m128i(hi, lo);
}
__m256i load2x(const __m128i *lo, const __m128i *hi) {
return _mm256_setr_m128i(_mm_loadu_si128(lo), _mm_loadu_si128(hi));
}
define <4 x i64> @load2(<2 x i64>* %lo, <2 x i64>* %hi) {
entry:
%0 = bitcast <2 x i64>* %hi to <4 x i32>*
%hi.val1 = load <4 x i32>, <4 x i32>* %0, align 1
%lo.val = load <2 x i64>, <2 x i64>* %lo, align 1
%shuffle.i.i = shufflevector <2 x i64> %lo.val, <2 x i64> undef, <4 x i32>
<i32 0, i32 1, i32 undef, i32 undef>
%1 = bitcast <4 x i64> %shuffle.i.i to <8 x i32>
%widen.i = shufflevector <4 x i32> %hi.val1, <4 x i32> poison, <8 x i32> <i32
0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
%insert.i = shufflevector <8 x i32> %1, <8 x i32> %widen.i, <8 x i32> <i32 0,
i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
%2 = bitcast <8 x i32> %insert.i to <4 x i64>
ret <4 x i64> %2
}
define <4 x i64> @load2x(<2 x i64>* %lo, <2 x i64>* %hi) {
entry:
%lo.val = load <2 x i64>, <2 x i64>* %lo, align 1
%hi.val = load <2 x i64>, <2 x i64>* %hi, align 1
%shuffle.i.i = shufflevector <2 x i64> %lo.val, <2 x i64> %hi.val, <4 x i32>
<i32 0, i32 1, i32 2, i32 3>
ret <4 x i64> %shuffle.i.i
}</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>