[PATCH] D121815: [X86] Use the unaligned vector typedefs for the lddqu intrinsics pointer arguments (PR20670)
Simon Pilgrim via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 16 08:54:33 PDT 2022
RKSimon created this revision.
RKSimon added reviewers: craig.topper, pengfei.
Herald added a project: All.
RKSimon requested review of this revision.
Herald added a project: clang.
Extension to rG4390c721cba09597037578100948bbc83cc41b16 <https://reviews.llvm.org/rG4390c721cba09597037578100948bbc83cc41b16>, similar to the vanilla load/store intrinsics, _mm_lddqu_si128/_mm256_lddqu_si256 should take an unaligned pointer, but were using the aligned __m128i/__m256i types which can cause alignment warnings.
The existing sse3-builtins.c and avx-builtins.c tests in llvm-project\clang\test\CodeGen\X86 should cover this.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121815
Files:
clang/lib/Headers/avxintrin.h
clang/lib/Headers/pmmintrin.h
Index: clang/lib/Headers/pmmintrin.h
===================================================================
--- clang/lib/Headers/pmmintrin.h
+++ clang/lib/Headers/pmmintrin.h
@@ -35,7 +35,7 @@
/// A pointer to a 128-bit integer vector containing integer values.
/// \returns A 128-bit vector containing the moved values.
static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_lddqu_si128(__m128i const *__p)
+_mm_lddqu_si128(__m128i_u const *__p)
{
return (__m128i)__builtin_ia32_lddqu((char const *)__p);
}
Index: clang/lib/Headers/avxintrin.h
===================================================================
--- clang/lib/Headers/avxintrin.h
+++ clang/lib/Headers/avxintrin.h
@@ -3177,7 +3177,7 @@
/// A pointer to a 256-bit integer vector containing integer values.
/// \returns A 256-bit integer vector containing the moved values.
static __inline __m256i __DEFAULT_FN_ATTRS
-_mm256_lddqu_si256(__m256i const *__p)
+_mm256_lddqu_si256(__m256i_u const *__p)
{
return (__m256i)__builtin_ia32_lddqu256((char const *)__p);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121815.415852.patch
Type: text/x-patch
Size: 1043 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220316/ee64bc1a/attachment.bin>
More information about the cfe-commits
mailing list