Skip to content

Commit 429da70

Browse files
Generate a swizzle-friendly mask during generic reduction
It changes nothing for clang which has a nice shuffle optimizer, but it does help gcc a lot. Somehow related to #1132
1 parent 0658f77 commit 429da70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/xsimd/arch/common/xsimd_common_math.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ namespace xsimd
21102110
{
21112111
static constexpr T get(T i, T)
21122112
{
2113-
return i >= N ? (i % 2) : i + N;
2113+
return i < N ? (i + N) : ((i % N) + N);
21142114
}
21152115
};
21162116

0 commit comments

Comments
 (0)