[libcxx-commits] [PATCH] D144363: [libcxx] <experimental/simd> Added simd width functions, simd_size traits and related tests

Yin Zhang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 16 22:27:12 PDT 2023


Joy12138 added a comment.

@philnik Hi! We found that the current implementation might have an unexpected behavior. Because we do not check the template parameter of `simd_size_v`, it gives value with invalid first parameter.

https://godbolt.org/z/o8o4fWe7n

In the document, `simd_size` is implemented first and using `simd_size_v` as value of `simd_size`. Therefore, the template parameters of `simd_size_v` are checked by `simd_size`. Here is the behavior with GCC implementation: https://godbolt.org/z/1vYTsnbsd

I implement in the current form because you told me earlier that implementing variable first can avoid instantiating a class every time. But it seems to have some minor issues at the moment.

By the way, `memory_alignment_v` will also have the same issue. Do you have any suggestions for solving this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144363



More information about the libcxx-commits mailing list