Skip to content

Commit cf31d0e

Browse files
authored
[libcxx] <experimental/simd> Add _LIBCPP_HIDE_FROM_ABI to internal br… (#66977)
…oadcast functions
1 parent dd788af commit cf31d0e

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

libcxx/include/experimental/__simd/scalar.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ template <class _Tp>
2727
struct __simd_storage<_Tp, simd_abi::__scalar> {
2828
_Tp __data;
2929

30-
_Tp __get([[maybe_unused]] size_t __idx) const noexcept {
30+
_LIBCPP_HIDE_FROM_ABI _Tp __get([[maybe_unused]] size_t __idx) const noexcept {
3131
_LIBCPP_ASSERT_UNCATEGORIZED(__idx == 0, "Index is out of bounds");
3232
return __data;
3333
}
34-
void __set([[maybe_unused]] size_t __idx, _Tp __v) noexcept {
34+
_LIBCPP_HIDE_FROM_ABI void __set([[maybe_unused]] size_t __idx, _Tp __v) noexcept {
3535
_LIBCPP_ASSERT_UNCATEGORIZED(__idx == 0, "Index is out of bounds");
3636
__data = __v;
3737
}
@@ -45,14 +45,14 @@ struct __simd_operations<_Tp, simd_abi::__scalar> {
4545
using _SimdStorage = __simd_storage<_Tp, simd_abi::__scalar>;
4646
using _MaskStorage = __mask_storage<_Tp, simd_abi::__scalar>;
4747

48-
static _SimdStorage __broadcast(_Tp __v) noexcept { return {__v}; }
48+
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __broadcast(_Tp __v) noexcept { return {__v}; }
4949
};
5050

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

55-
static _MaskStorage __broadcast(bool __v) noexcept { return {__v}; }
55+
static _LIBCPP_HIDE_FROM_ABI _MaskStorage __broadcast(bool __v) noexcept { return {__v}; }
5656
};
5757

5858
} // namespace parallelism_v2

libcxx/include/experimental/__simd/vec_ext.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ template <class _Tp, int _Np>
3030
struct __simd_storage<_Tp, simd_abi::__vec_ext<_Np>> {
3131
_Tp __data __attribute__((__vector_size__(std::__bit_ceil((sizeof(_Tp) * _Np)))));
3232

33-
_Tp __get(size_t __idx) const noexcept {
33+
_LIBCPP_HIDE_FROM_ABI _Tp __get(size_t __idx) const noexcept {
3434
_LIBCPP_ASSERT_UNCATEGORIZED(__idx >= 0 && __idx < _Np, "Index is out of bounds");
3535
return __data[__idx];
3636
}
37-
void __set(size_t __idx, _Tp __v) noexcept {
37+
_LIBCPP_HIDE_FROM_ABI void __set(size_t __idx, _Tp __v) noexcept {
3838
_LIBCPP_ASSERT_UNCATEGORIZED(__idx >= 0 && __idx < _Np, "Index is out of bounds");
3939
__data[__idx] = __v;
4040
}
@@ -49,7 +49,7 @@ struct __simd_operations<_Tp, simd_abi::__vec_ext<_Np>> {
4949
using _SimdStorage = __simd_storage<_Tp, simd_abi::__vec_ext<_Np>>;
5050
using _MaskStorage = __mask_storage<_Tp, simd_abi::__vec_ext<_Np>>;
5151

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

65-
static _MaskStorage __broadcast(bool __v) noexcept {
65+
static _LIBCPP_HIDE_FROM_ABI _MaskStorage __broadcast(bool __v) noexcept {
6666
_MaskStorage __result;
6767
auto __all_bits_v = experimental::__set_all_bits<_Tp>(__v);
6868
for (int __i = 0; __i < _Np; ++__i) {

libcxx/test/std/experimental/simd/simd.class/simd_ctor_broadcast.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
// [simd.class]
1414
// template<class U> simd(U&& value) noexcept;
1515

16-
// GCC returns __int128 unsigned with garbled data in higher 64 bits.
17-
// This is likely a bug in GCC implementation. Investigation needed.
18-
// XFAIL: gcc-13
19-
2016
#include "../test_utils.h"
2117

2218
namespace ex = std::experimental::parallelism_v2;

libcxx/test/std/experimental/simd/simd.mask.class/simd_mask_ctor_broadcast.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
// [simd.mask.class]
1414
// explicit simd_mask(value_type) noexcept;
1515

16-
// GCC returns __int128 unsigned with garbled data in higher 64 bits.
17-
// This is likely a bug in GCC implementation. Investigation needed.
18-
// XFAIL: gcc-13
19-
2016
#include "../test_utils.h"
2117
#include <experimental/simd>
2218

0 commit comments

Comments
 (0)