Skip to content

[libcxx] <experimental/simd> Add _LIBCPP_HIDE_FROM_ABI to internal br… #66977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libcxx/include/experimental/__simd/scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ template <class _Tp>
struct __simd_storage<_Tp, simd_abi::__scalar> {
_Tp __data;

_Tp __get([[maybe_unused]] size_t __idx) const noexcept {
_LIBCPP_HIDE_FROM_ABI _Tp __get([[maybe_unused]] size_t __idx) const noexcept {
_LIBCPP_ASSERT_UNCATEGORIZED(__idx == 0, "Index is out of bounds");
return __data;
}
void __set([[maybe_unused]] size_t __idx, _Tp __v) noexcept {
_LIBCPP_HIDE_FROM_ABI void __set([[maybe_unused]] size_t __idx, _Tp __v) noexcept {
_LIBCPP_ASSERT_UNCATEGORIZED(__idx == 0, "Index is out of bounds");
__data = __v;
}
Expand All @@ -45,14 +45,14 @@ struct __simd_operations<_Tp, simd_abi::__scalar> {
using _SimdStorage = __simd_storage<_Tp, simd_abi::__scalar>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're also missing HIDE_FROM_ABI above. Same in vec_ext.h.

using _MaskStorage = __mask_storage<_Tp, simd_abi::__scalar>;

static _SimdStorage __broadcast(_Tp __v) noexcept { return {__v}; }
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __broadcast(_Tp __v) noexcept { return {__v}; }
};

template <class _Tp>
struct __mask_operations<_Tp, simd_abi::__scalar> {
using _MaskStorage = __mask_storage<_Tp, simd_abi::__scalar>;

static _MaskStorage __broadcast(bool __v) noexcept { return {__v}; }
static _LIBCPP_HIDE_FROM_ABI _MaskStorage __broadcast(bool __v) noexcept { return {__v}; }
};

} // namespace parallelism_v2
Expand Down
8 changes: 4 additions & 4 deletions libcxx/include/experimental/__simd/vec_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ template <class _Tp, int _Np>
struct __simd_storage<_Tp, simd_abi::__vec_ext<_Np>> {
_Tp __data __attribute__((__vector_size__(std::__bit_ceil((sizeof(_Tp) * _Np)))));

_Tp __get(size_t __idx) const noexcept {
_LIBCPP_HIDE_FROM_ABI _Tp __get(size_t __idx) const noexcept {
_LIBCPP_ASSERT_UNCATEGORIZED(__idx >= 0 && __idx < _Np, "Index is out of bounds");
return __data[__idx];
}
void __set(size_t __idx, _Tp __v) noexcept {
_LIBCPP_HIDE_FROM_ABI void __set(size_t __idx, _Tp __v) noexcept {
_LIBCPP_ASSERT_UNCATEGORIZED(__idx >= 0 && __idx < _Np, "Index is out of bounds");
__data[__idx] = __v;
}
Expand All @@ -49,7 +49,7 @@ struct __simd_operations<_Tp, simd_abi::__vec_ext<_Np>> {
using _SimdStorage = __simd_storage<_Tp, simd_abi::__vec_ext<_Np>>;
using _MaskStorage = __mask_storage<_Tp, simd_abi::__vec_ext<_Np>>;

static _SimdStorage __broadcast(_Tp __v) noexcept {
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __broadcast(_Tp __v) noexcept {
_SimdStorage __result;
for (int __i = 0; __i < _Np; ++__i) {
__result.__set(__i, __v);
Expand All @@ -62,7 +62,7 @@ template <class _Tp, int _Np>
struct __mask_operations<_Tp, simd_abi::__vec_ext<_Np>> {
using _MaskStorage = __mask_storage<_Tp, simd_abi::__vec_ext<_Np>>;

static _MaskStorage __broadcast(bool __v) noexcept {
static _LIBCPP_HIDE_FROM_ABI _MaskStorage __broadcast(bool __v) noexcept {
_MaskStorage __result;
auto __all_bits_v = experimental::__set_all_bits<_Tp>(__v);
for (int __i = 0; __i < _Np; ++__i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
// [simd.class]
// template<class U> simd(U&& value) noexcept;

// GCC returns __int128 unsigned with garbled data in higher 64 bits.
// This is likely a bug in GCC implementation. Investigation needed.
// XFAIL: gcc-13

#include "../test_utils.h"

namespace ex = std::experimental::parallelism_v2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
// [simd.mask.class]
// explicit simd_mask(value_type) noexcept;

// GCC returns __int128 unsigned with garbled data in higher 64 bits.
// This is likely a bug in GCC implementation. Investigation needed.
// XFAIL: gcc-13

#include "../test_utils.h"
#include <experimental/simd>

Expand Down