#ifndef ASSEMBLER
+#ifdef C_MSVC
+#include <intrin.h>
+#endif
+
#define MB
#define WMB
#if defined(_MSC_VER) && !defined(__clang__)
// use intrinsic instead of inline assembly
- ret = _InterlockedExchange(address, 1);
+ ret = _InterlockedExchange((volatile LONG *)address, 1);
// inline assembly
/*__asm {
mov eax, address
} while (ret);
}
+#define BLAS_LOCK_DEFINED
static __inline unsigned long long rpcc(void){
#if defined(_MSC_VER) && !defined(__clang__)
return ((unsigned long long)a + ((unsigned long long)d << 32));
#endif
};
+#define RPCC_DEFINED
static __inline unsigned long getstackaddr(void){
#if defined(_MSC_VER) && !defined(__clang__)
if (y <= 1) return x;
- y = blas_quick_divide_table[y];
-
#if defined(_MSC_VER) && !defined(__clang__)
- (void*)result;
- return x*y;
+ result = x/y;
+ return result;
#else
+
+ y = blas_quick_divide_table[y];
+
__asm__ __volatile__ ("mull %0" :"=d" (result) :"a"(x), "0" (y));
return result;