Explorar o código

Support Windows on ARM and ARM64 (#250)

* Support Windows on ARM and ARM64

* Update cpu.inl
Wencey Wang %!s(int64=5) %!d(string=hai) anos
pai
achega
1477cd1ee8
Modificáronse 1 ficheiros con 9 adicións e 7 borrados
  1. 9 7
      include/bx/inline/cpu.inl

+ 9 - 7
include/bx/inline/cpu.inl

@@ -8,9 +8,9 @@
 #endif // BX_CPU_H_HEADER_GUARD
 #endif // BX_CPU_H_HEADER_GUARD
 
 
 #if BX_COMPILER_MSVC
 #if BX_COMPILER_MSVC
-#	if BX_PLATFORM_WINRT
+#	if BX_PLATFORM_WINRT || (BX_PLATFORM_WINDOWS && (!BX_CPU_X86))
 #		include <windows.h>
 #		include <windows.h>
-#	endif // BX_PLATFORM_WINRT
+#	endif // BX_PLATFORM_WINRT || (BX_PLATFORM_WINDOWS && (!BX_CPU_X86))
 
 
 #	if BX_CPU_X86
 #	if BX_CPU_X86
 #		include <emmintrin.h> // _mm_fence
 #		include <emmintrin.h> // _mm_fence
@@ -88,16 +88,18 @@ namespace bx
 		asm volatile("":::"memory");
 		asm volatile("":::"memory");
 #endif // BX_COMPILER
 #endif // BX_COMPILER
 	}
 	}
-
+	
 	inline void memoryBarrier()
 	inline void memoryBarrier()
 	{
 	{
-#if BX_PLATFORM_WINRT
-		MemoryBarrier();
-#elif BX_COMPILER_MSVC
+#if BX_COMPILER_MSVC
+#   if BX_CPU_X86
 		_mm_mfence();
 		_mm_mfence();
+#   else
+		MemoryBarrier();
+#   endif // BX_CPU_X86
 #else
 #else
 		__sync_synchronize();
 		__sync_synchronize();
-#endif // BX_COMPILER
+#endif // BX_COMPILER_MSVC
 	}
 	}
 
 
 	template<>
 	template<>