Skip to content

Commit bd4c6d3

Browse files
committed
Reset MMX state after argsort/argselect
1 parent 9ab7d47 commit bd4c6d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/xss-common-argsort.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,11 @@ X86_SIMD_SORT_INLINE void xss_argsort(T *arr,
575575

576576
if (descending) { std::reverse(arg, arg + arrsize); }
577577
}
578+
579+
#ifdef __MMX__
580+
// Workaround for compiler bug generating MMX instructions without emms
581+
_mm_empty();
582+
#endif
578583
}
579584

580585
template <typename T>
@@ -632,6 +637,11 @@ X86_SIMD_SORT_INLINE void xss_argselect(T *arr,
632637
argselect_<vectype, argtype>(
633638
arr, arg, k, 0, arrsize - 1, 2 * (arrsize_t)log2(arrsize));
634639
}
640+
641+
#ifdef __MMX__
642+
// Workaround for compiler bug generating MMX instructions without emms
643+
_mm_empty();
644+
#endif
635645
}
636646

637647
template <typename T>

0 commit comments

Comments
 (0)