[libcxx-commits] [PATCH] D153319: [libcxx] <experimental/simd> Added aliagned flag types, traits is_simd_flag_type[_v], memory_alignment[_v] and related tests

Yin Zhang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 5 23:53:46 PDT 2023


Joy12138 added inline comments.


================
Comment at: libcxx/include/experimental/__simd/aligned_tag.h:36
+  static _LIBCPP_HIDE_FROM_ABI constexpr _Up* __apply(_Up* __ptr) {
+    return static_cast<_Up*>(__builtin_assume_aligned(__ptr, __alignment<_Tp, _Up>));
+  }
----------------
philnik wrote:
> Let's add `__assume_aligned` in `__memory/assume_aligned.h` to avoid using builtins randomly in the code. This lets us also assert if the alignment assumption isn't met (Please add a test for that!).
If I understand correctly, what you want is a false test when provides incorrect alignment. Then both tests in this patch do not involve alignment inputs. Can we add these false tests in subsequent patches about constructors and load/store that involved with alignment inputs?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153319/new/

https://reviews.llvm.org/D153319



More information about the libcxx-commits mailing list