Add CPU "pause" intrinsic for MSVC

This commit is contained in:
rustyx 2016-01-30 13:41:09 +01:00 committed by Jason Evans
parent bc49863fb5
commit 90c7269c05

View File

@ -218,12 +218,22 @@ dnl CPU-specific settings.
CPU_SPINWAIT="" CPU_SPINWAIT=""
case "${host_cpu}" in case "${host_cpu}" in
i686|x86_64) i686|x86_64)
AC_CACHE_VAL([je_cv_pause], if test "x${je_cv_msvc}" = "xyes" ; then
[JE_COMPILABLE([pause instruction], [], AC_CACHE_VAL([je_cv_pause_msvc],
[[__asm__ volatile("pause"); return 0;]], [JE_COMPILABLE([pause instruction MSVC], [],
[je_cv_pause])]) [[_mm_pause(); return 0;]],
if test "x${je_cv_pause}" = "xyes" ; then [je_cv_pause_msvc])])
CPU_SPINWAIT='__asm__ volatile("pause")' if test "x${je_cv_pause_msvc}" = "xyes" ; then
CPU_SPINWAIT='_mm_pause()'
fi
else
AC_CACHE_VAL([je_cv_pause],
[JE_COMPILABLE([pause instruction], [],
[[__asm__ volatile("pause"); return 0;]],
[je_cv_pause])])
if test "x${je_cv_pause}" = "xyes" ; then
CPU_SPINWAIT='__asm__ volatile("pause")'
fi
fi fi
;; ;;
powerpc) powerpc)