Skip to content

Commit

Permalink
let ignore_extra have convenience setters for C++17
Browse files Browse the repository at this point in the history
Summary: Designated initializers are a feature of C++20.

Differential Revision: D64643988

fbshipit-source-id: 0d3e772bc2095e791a4030985e038efd18f2e226
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Oct 20, 2024
1 parent a8efe05 commit 9b8e04f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions folly/algorithm/simd/test/MovemaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,18 @@ TEST(Movemask, Sse2Example) {
// This is a common thing during tail handling.
// This is where ignore comes in.

simd::ignore_extrema ignore{};

// Example: first 2 elements are irrelevant
bits = folly::simd::movemask<std::uint16_t>(
test, simd::ignore_extrema{.first = 2})
.first;
ignore = {};
ignore.first = 2;
bits = folly::simd::movemask<std::uint16_t>(test, ignore).first;
ASSERT_EQ(0b00'00'11'00'00'00'00'00, bits);

// Example: last 3 elements are irrelevant
bits = folly::simd::movemask<std::uint16_t>(
test, simd::ignore_extrema{.last = 3})
.first;
ignore = {};
ignore.last = 3;
bits = folly::simd::movemask<std::uint16_t>(test, ignore).first;
ASSERT_EQ(0b00'00'00'00'00'00'11'00, bits);
}

Expand Down

0 comments on commit 9b8e04f

Please sign in to comment.