Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37789747
en ru br
ALT Linux repositórios
S:5.4.6-alt13

Group :: Desenvolvimento/C
RPM: cilk

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: cilk-e2k.patch
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
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009