From 9b8e04f0455a3cd78dbc15c14126a2ca0154be89 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Sun, 20 Oct 2024 13:31:52 -0700 Subject: [PATCH] let ignore_extra have convenience setters for C++17 Summary: Designated initializers are a feature of C++20. Differential Revision: D64643988 fbshipit-source-id: 0d3e772bc2095e791a4030985e038efd18f2e226 --- folly/algorithm/simd/test/MovemaskTest.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/folly/algorithm/simd/test/MovemaskTest.cpp b/folly/algorithm/simd/test/MovemaskTest.cpp index 97ccf4a755c..bc63206c807 100644 --- a/folly/algorithm/simd/test/MovemaskTest.cpp +++ b/folly/algorithm/simd/test/MovemaskTest.cpp @@ -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( - test, simd::ignore_extrema{.first = 2}) - .first; + ignore = {}; + ignore.first = 2; + bits = folly::simd::movemask(test, ignore).first; ASSERT_EQ(0b00'00'11'00'00'00'00'00, bits); // Example: last 3 elements are irrelevant - bits = folly::simd::movemask( - test, simd::ignore_extrema{.last = 3}) - .first; + ignore = {}; + ignore.last = 3; + bits = folly::simd::movemask(test, ignore).first; ASSERT_EQ(0b00'00'00'00'00'00'11'00, bits); }