diff --git a/Libraries/crunch-r319/crnlib/crn_platform.h b/Libraries/crunch-r319/crnlib/crn_platform.h index 352c78260..31434f994 100644 --- a/Libraries/crunch-r319/crnlib/crn_platform.h +++ b/Libraries/crunch-r319/crnlib/crn_platform.h @@ -36,7 +36,11 @@ const bool c_crnlib_big_endian_platform = !c_crnlib_little_endian_platform; #define CRNLIB_BREAKPOINT DebugBreak(); #define CRNLIB_BUILTIN_EXPECT(c, v) c #elif defined(__GNUC__) - #define CRNLIB_BREAKPOINT asm("int $3"); + #if defined(__i386__) || defined(__x86_64__) + #define CRNLIB_BREAKPOINT asm("int $3"); + #else + #define CRNLIB_BREAKPOINT abort(); + #endif #define CRNLIB_BUILTIN_EXPECT(c, v) __builtin_expect(c, v) #else #define CRNLIB_BREAKPOINT diff --git a/Libraries/zstd-1.5.0/lib/common/compiler.h b/Libraries/zstd-1.5.0/lib/common/compiler.h index a951d0ade..c388acc10 100644 --- a/Libraries/zstd-1.5.0/lib/common/compiler.h +++ b/Libraries/zstd-1.5.0/lib/common/compiler.h @@ -151,7 +151,7 @@ /* vectorization * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */ -#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) +#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && !defined(__MCST__) # if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5) # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) # else diff --git a/Source/Timing/timestamp.h b/Source/Timing/timestamp.h index 598b1274c..cdd3bc954 100644 --- a/Source/Timing/timestamp.h +++ b/Source/Timing/timestamp.h @@ -26,11 +26,18 @@ inline uint64_t GetTimestamp() { // Use rdtsc instruction to get the tsc or Time Stamp Counter -#if (defined(PLATFORM_LINUX) || defined(PLATFORM_MACOSX)) && (defined(__i386__) || defined(__x86_64__)) +#if (defined(PLATFORM_LINUX) || defined(PLATFORM_MACOSX)) +#if (defined(__i386__) || defined(__x86_64__)) uint32_t rax, rdx; asm volatile ( "lfence" ::: "memory" ); //Fence memory load to everything is executed up to this point. asm volatile ( "rdtsc\n" : "=a" (rax), "=d" (rdx) : : ); return ((uint64_t)rdx << 32) + rax; +#elif defined(__e2k__) + uint64_t clk; +#pragma asm_inline + __asm__ ( "rrd %%clkr, %0" : "=r" (clk)); + return clk; +#endif #elif defined(PLATFORM_WINDOWS) && _MSC_VER >= 1600 unsigned __int64 i; _ReadBarrier(); diff --git a/Source/Utility/timing.h b/Source/Utility/timing.h index 55363140b..aedae0e60 100644 --- a/Source/Utility/timing.h +++ b/Source/Utility/timing.h @@ -28,11 +28,18 @@ inline uint64_t getCPUTSC() { // Use rdtsc instruction to get the tsc or Time Stamp Counter -#if (defined(PLATFORM_LINUX) || defined(PLATFORM_MACOSX)) && (defined(__i386__) || defined(__x86_64__)) +#if (defined(PLATFORM_LINUX) || defined(PLATFORM_MACOSX)) +#if (defined(__i386__) || defined(__x86_64__)) uint32_t rax, rdx; asm volatile ( "lfence" ::: "memory" ); //Fence memory load to everything is executed up to this point. asm volatile ( "rdtsc\n" : "=a" (rax), "=d" (rdx) : : ); return ((uint64_t)rdx << 32) + rax; +#elif defined(__e2k__) + uint64_t clk; +#pragma asm_inline + __asm__ ("rrd %%clkr, %0": "=r" (clk)); + return clk; +#endif #elif defined(PLATFORM_WINDOWS) && _MSC_VER >= 1600 unsigned __int64 i; _ReadBarrier();