summaryrefslogtreecommitdiff
path: root/src/atomic_ops
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@mellanox.com>2016-05-11 22:19:57 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-05-11 22:19:57 +0300
commit04a286421802a503b58d804d0d673dd5a28c9e9b (patch)
tree4ac60ca23e75a41426d010bdb5ae77ff6e94a03d /src/atomic_ops
parentbe07a901e8ffd7951102b987bf2c9c482f6c8cda (diff)
downloadlibatomic_ops-04a286421802a503b58d804d0d673dd5a28c9e9b.tar.gz
Basic support of TILE-Gx and TILEPro CPUs
This patch is an updated version of the CentOS 6 patch that we have been carrying as part of our own CentOS-like distribution since 2012. * src/Makefile.am (nobase_private_HEADERS): Add tile.h. * src/atomic_ops.h [__tile__]: Include tile.h file. * src/atomic_ops/sysdeps/gcc/tile.h: New file.
Diffstat (limited to 'src/atomic_ops')
-rw-r--r--src/atomic_ops/sysdeps/gcc/tile.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/tile.h b/src/atomic_ops/sysdeps/gcc/tile.h
new file mode 100644
index 0000000..0c13180
--- /dev/null
+++ b/src/atomic_ops/sysdeps/gcc/tile.h
@@ -0,0 +1,50 @@
+/*
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+/* Minimal support for tile. */
+
+#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) \
+ || __clang_major__ > 3 \
+ || (__clang_major__ == 3 && __clang_minor__ >= 4)) \
+ && !defined(AO_DISABLE_GCC_ATOMICS)
+
+# include "generic.h"
+
+#else /* AO_DISABLE_GCC_ATOMICS */
+
+# include "../all_atomic_load_store.h"
+
+# include "../test_and_set_t_is_ao_t.h"
+
+ AO_INLINE void
+ AO_nop_full(void)
+ {
+ __sync_synchronize();
+ }
+# define AO_HAVE_nop_full
+
+ AO_INLINE AO_t
+ AO_fetch_and_add_full(volatile AO_t *p, AO_t incr)
+ {
+ return __sync_fetch_and_add(p, incr);
+ }
+# define AO_HAVE_fetch_and_add_full
+
+ AO_INLINE AO_t
+ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val,
+ AO_t new_val)
+ {
+ return __sync_val_compare_and_swap(addr, old_val, new_val
+ /* empty protection list */);
+ }
+# define AO_HAVE_fetch_compare_and_swap_full
+
+#endif /* AO_DISABLE_GCC_ATOMICS */