Skip to content

Commit

Permalink
MSVC: add non-GNU-asm variant of BSF masked gather
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kretz <kretz@kde.org>
  • Loading branch information
mattkretz committed Sep 20, 2016
1 parent 9c53181 commit 05eb438
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions common/gatherimplementation.h
Expand Up @@ -82,6 +82,7 @@ Vc_ALWAYS_INLINE void executeGather(BitScanLoopT,
const IT &indexes,
typename V::MaskArgument mask)
{
#ifdef Vc_GNU_ASM
size_t bits = mask.toInt();
while (Vc_IS_LIKELY(bits > 0)) {
size_t i, j;
Expand All @@ -93,15 +94,15 @@ Vc_ALWAYS_INLINE void executeGather(BitScanLoopT,
v[i] = mem[indexes[i]];
v[j] = mem[indexes[j]];
}

/* Alternative from Vc::SSE (0.7)
#else
// Alternative from Vc::SSE (0.7)
int bits = mask.toInt();
while (bits) {
const int i = _bit_scan_forward(bits);
bits &= ~(1 << i); // btr?
d.set(i, ith_value(i));
bits &= bits - 1;
v[i] = mem[indexes[i]];
}
*/
#endif // Vc_GNU_ASM
}

template <typename V, typename MT, typename IT>
Expand Down

0 comments on commit 05eb438

Please sign in to comment.