Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: MCST Elbrus initial port #37

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Libraries/crunch-r319/crnlib/crn_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Libraries/zstd-1.5.0/lib/common/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion Source/Timing/timestamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 8 additions & 1 deletion Source/Utility/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down