Skip to content
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
6 changes: 6 additions & 0 deletions hwy/tests/compare_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Clang aarch64 OOM workaround: Not using AES, hence NEON_WITHOUT_AES is
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be GCC instead of Clang?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fair :) I copied from existing code, we've had the same problem on Clang, but this instance was indeed GCC.

// sufficient. SVE is mostly superseded by SVE2.
#ifndef HWY_DISABLED_TARGETS
#define HWY_DISABLED_TARGETS (HWY_NEON | HWY_SVE | HWY_SVE_256)
#endif // HWY_DISABLED_TARGETS

#undef HWY_TARGET_INCLUDE
#define HWY_TARGET_INCLUDE "tests/compare_test.cc"
#include "hwy/foreach_target.h" // IWYU pragma: keep
Expand Down
4 changes: 2 additions & 2 deletions hwy/tests/memory_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ struct TestLoadDup128 {
constexpr size_t N128 = 16 / sizeof(T);
alignas(16) T lanes[N128];
for (size_t i = 0; i < N128; ++i) {
lanes[i] = ConvertScalarTo<T>(1 + i);
lanes[i] = ConvertScalarTo<T>(hwy::Unpredictable1() + i);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This does not seem to fix the problem. It is likely a compiler bug specific to GCC 16 on ppc 64.
Code compiles fine on GCC15:
https://copr.fedorainfracloud.org/coprs/fed500/highway/build/10415978/

Initial report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125148

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hm :/ Thanks for filing the report. There is no harm in using Unpredictable1, this prevents test code from being optimized out and we're slowly moving toward that everywhere.

}

const size_t N = Lanes(d);
auto expected = AllocateAligned<T>(N);
HWY_ASSERT(expected);
for (size_t i = 0; i < N; ++i) {
expected[i] = ConvertScalarTo<T>(i % N128 + 1);
expected[i] = ConvertScalarTo<T>(i % N128 + hwy::Unpredictable1());
}

HWY_ASSERT_VEC_EQ(d, expected.get(), LoadDup128(d, lanes));
Expand Down
Loading