[libcxx-commits] [PATCH] D144362: [libcxx] Updated <experimental/simd> based on Parallelism-TS N4808

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 27 10:15:53 PST 2023


philnik added inline comments.


================
Comment at: libcxx/include/experimental/__simd/scalar.h:16
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI
+
----------------
ldionne wrote:
> philnik wrote:
> > Mordante wrote:
> > > philnik wrote:
> > > > IMO it would be a lot nicer to just use
> > > > ```lang=c++
> > > > namespace std::experimental {
> > > > inline namespace parallelism_v2 {
> > > > 
> > > > } // namespace parallelism_v2
> > > > } // namespace std::experimental
> > > > ```
> > > > While it's marginally more verbose, it's a lot easier to read. (`namespace std::experimental::inline parallelism_v2` doesn't work because that's C++20)
> > > > @ldionne @Mordante any thoughts here?
> > > > 
> > > > (Don't apply this before others have commented, this is a more general discussion)
> > > I don't have a real preference. IIRC `_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI` is the more typical way in libc++.
> > Yes, it's the more typical way, but AFAICT mostly for symmetry with `_LIBCPP_BEGIN_NAMESPACE_STD`. There it makes a lot more sense IMO, since that namespace actually changes depending on the configuration. That's not the case for experimental stuff. We also don't have `_LIBCPP_BEGIN_NAMESPACE_STD_RANGES/FORMAT/etc.`.
> Is there any reason for not doing (formatted however you prefer):
> 
> ```
> _LIBCPP_BEGIN_NAMESPACE_STD
> namespace experimental { inline namespace parallelism_v2 {
>   ....
> }}
> _LIBCPP_END_NAMESPACE_STD
> ```
> 
> ? Then we could get rid of `_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI` altogether.
That was basically the idea, just that I wouldn't bother with the versioned namespace, since it's unstable anyways.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144362



More information about the libcxx-commits mailing list