Group :: Desenvolvimento/C
RPM: cilk
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: cilk-e2k.patch
Download
Download
diff --git a/runtime/cilk-sysdep.h b/runtime/cilk-sysdep.h
index 533fb2b..16164f4 100644
--- a/runtime/cilk-sysdep.h
+++ b/runtime/cilk-sysdep.h
@@ -411,6 +411,23 @@ FILE_IDENTITY(ident_cilk_sysdep_h,
}
#endif /* __alpha__ */
+/*------------------------
+ Elbrus 2000
+ ------------------------*/
+#ifdef __e2k__
+# include "x86intrin.h"
+# define CILK_CACHE_LINE 32
+# define CILK_MB() __builtin_ia32_mfence()
+# define CILK_RMB() __builtin_ia32_lfence()
+# define CILK_WMB() __builtin_ia32_sfence()
+
+ /* atomic swap operation */
+ static inline __attribute__((always_inline)) int Cilk_xchg(volatile int *ptr, int x)
+ {
+ return __sync_lock_test_and_set(ptr, x);
+ }
+#endif /* __e2k__ */
+
#ifndef CILK_CACHE_LINE
# error "Unsupported CPU"
#endif
diff --git a/runtime/cilk-sysdep.h.in b/runtime/cilk-sysdep.h.in
index b7c9173..aeacae4 100644
--- a/runtime/cilk-sysdep.h.in
+++ b/runtime/cilk-sysdep.h.in
@@ -410,6 +410,23 @@ FILE_IDENTITY(ident_cilk_sysdep_h,
}
#endif /* __alpha__ */
+/*------------------------
+ Elbrus 2000
+ ------------------------*/
+#ifdef __e2k__
+# include "x86intrin.h"
+# define CILK_CACHE_LINE 32
+# define CILK_MB() __builtin_ia32_mfence()
+# define CILK_RMB() __builtin_ia32_lfence()
+# define CILK_WMB() __builtin_ia32_sfence()
+
+ /* atomic swap operation */
+ static inline __attribute__((always_inline)) int Cilk_xchg(volatile int *ptr, int x)
+ {
+ return __sync_lock_test_and_set(ptr, x);
+ }
+#endif /* __e2k__ */
+
#ifndef CILK_CACHE_LINE
# error "Unsupported CPU"
#endif