Skip to content

Commit

Permalink
Remove VQSORT_SKIP workaround for compiler bug
Browse files Browse the repository at this point in the history
The test passes with the most recent clang.

PiperOrigin-RevId: 700385250
  • Loading branch information
ZequanWu authored and copybara-github committed Nov 26, 2024
1 parent 2b565e8 commit 02253c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
11 changes: 1 addition & 10 deletions hwy/contrib/sort/sort_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@
#include "hwy/print-inl.h"
#include "hwy/tests/test_util-inl.h"

// TODO(b/314758657): Compiler bug causes incorrect results on SSE2/S-SSE3.
#undef VQSORT_SKIP
#if !defined(VQSORT_DO_NOT_SKIP) && HWY_COMPILER_CLANG && HWY_ARCH_X86 && \
HWY_TARGET >= HWY_SSSE3
#define VQSORT_SKIP 1
#else
#define VQSORT_SKIP 0
#endif

HWY_BEFORE_NAMESPACE();
namespace hwy {
namespace HWY_NAMESPACE {
Expand Down Expand Up @@ -124,7 +115,7 @@ void TestAnySort(const std::vector<Algo>& algos, size_t num_lanes) {
HWY_ASSERT(aligned);

for (Algo algo : algos) {
if (IsVQ(algo) && (!VQSORT_ENABLED || VQSORT_SKIP)) continue;
if (IsVQ(algo) && !VQSORT_ENABLED) continue;

for (Dist dist : AllDist()) {
for (size_t misalign :
Expand Down
11 changes: 1 addition & 10 deletions hwy/contrib/sort/sort_unit_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@
#include "hwy/print-inl.h"
#include "hwy/tests/test_util-inl.h"

// TODO(b/314758657): Compiler bug causes incorrect results on SSE2/S-SSE3.
#undef VQSORT_SKIP
#if !defined(VQSORT_DO_NOT_SKIP) && HWY_COMPILER_CLANG && HWY_ARCH_X86 && \
HWY_TARGET >= HWY_SSSE3
#define VQSORT_SKIP 1
#else
#define VQSORT_SKIP 0
#endif

HWY_BEFORE_NAMESPACE();
namespace hwy {
namespace HWY_NAMESPACE {
Expand Down Expand Up @@ -310,7 +301,7 @@ static HWY_NOINLINE void TestBaseCase() {

HWY_NOINLINE void TestAllBaseCase() {
// Workaround for stack overflow on MSVC debug.
#if defined(_MSC_VER) || VQSORT_SKIP
#if defined(_MSC_VER)
return;
#endif

Expand Down

0 comments on commit 02253c8

Please sign in to comment.