<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/91247>91247</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ppc64] SSE/VSX wrapper missing _mm_loadu_si64 function
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
madscientist159
</td>
</tr>
</table>
<pre>
The SSE/VSX wrappers for ppc64[el] are missing the `_mm_loadu_si64()` function. This function appears to largely be an alias of `_mm_set_epi64()`, with an explicit unaligned load capability. However, `_mm_set_epi64()` also allows unaligned load in practice, and the ppc64[el] wrapper function for `_mm_set_epi64()` already enabled unaligned loads on POWER7+.
It appears the needed function is as follows -- this was tested on a Talos II workstation (POWER9) in Skia and functions correctly:
```
/* Load signed 64-bit integer from P into vector element 0. The address need not be 16-byte aligned. */
extern __inline __m128i
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_loadu_si64 (void const *__P)
{
return _mm_set_epi64((__m64)0LL, *(__m64 *)__P);
}
```
If desired I can create a merge request to add this function in to `emmintrin.h`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VMFu4zYQ_Rr6MrAg05IsHXRINms0QIAGTdD2JozEscUuRarkKF7_fUHJjrPZtoBhiRTnzbw3j4Mh6KMlqkV-L_KHFU7cO18PqEKnybIOvMmrVevUuX7tCV5evgq5__3lTzh5HEfyAQ7Owzh2RSbyezIifwD0BIMOQdsjcE8girQZhsY4VFMTdJEJWQpZiSKFw2Q71s4mAK-9Du9riODoA7ADg_5I5gwtAVpAozGAO1xRA3FD40dQIb_ASXMfT9P30ehOM0wWTWSqIJYBHY7YaqP5nMAv7kRv5GPYf2ICmuAAjXGn8BlLWxg9dqw7ihho1cz6R00uct0IRtn-L50nVGcgi60h9SllAGfh-dc_vv62E_I-EemDSO-W_0e-SdcTWCJF6pZVB8DYsoXIeg0cVT9hAKbApCIwwisaF-DxEU7OfwuMc6iQ5ZyyErKKnF--aZzJXsEDdM576ticxfbuY1GxKctvWcq9kHfwFMULC6siW7eaQVumY1TJuwGe49LBG3XsPJChgSxDOluFAJXyFMLMEKzjaI9NsW7PTHDRKgEQcs42p6XvTN5C02hrtCVommEjS718BABoGmT2up2YmmbuRdk0RztdAuLel3jInPAcPm961gfdaTRxJ2r0AfcH80ch35xW0DkbOFbYNM_v58Xu_hroiadY708OKZtmiK9V-vQ0uzaSXDaX9-qCuL2_gj78eyMWyxxAUdCeFDxChxY6TxhVhIH8kcDT3xMFjlcRlVocczOUjfuiSGkYtGWvbdKLIk1Wqt6qalvhiurNbpOnm12xLVZ9XR2KrawoL7BUVV4gFrv0IMtsq7K0OuxopWuZyizN02Kzy3abIlFlmlZViYdtjnlBpchSGlCbxJi3IXH-uNIhTFRXG5ntVgZbMmGeZ1JaOsH8UUgZx5uvY8y6nY5BZKnRgcMNhTWbeRBebu7Dz9Pufax9aulVjtXkTd0zjyHegGjz_VFzP7VJ5wYh9zHX5bEevfuLOhZyP1cYhNzPDP4JAAD__9tPxm4">