[libdazzle: 1/2] powerpc32: use fallback code for 64 bits __sync primitives
- From: Christian Hergert <chergert src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [libdazzle: 1/2] powerpc32: use fallback code for 64 bits __sync primitives
 
- Date: Fri, 12 Jun 2020 15:53:09 +0000 (UTC)
 
commit 5ebf1b1455e2e65e79fed2e06e28a1fb31fdf6c4
Author: Charlène Wendling <julianaito posteo jp>
Date:   Fri Jun 12 16:24:51 2020 +0200
    powerpc32: use fallback code for 64 bits __sync primitives
 src/util/dzl-counter.c | 4 ++++
 src/util/dzl-counter.h | 3 +++
 2 files changed, 7 insertions(+)
---
diff --git a/src/util/dzl-counter.c b/src/util/dzl-counter.c
index 472e7fc..3cec2f4 100644
--- a/src/util/dzl-counter.c
+++ b/src/util/dzl-counter.c
@@ -52,7 +52,11 @@ G_DEFINE_BOXED_TYPE (DzlCounterArena, dzl_counter_arena, dzl_counter_arena_ref,
 #define CELLS_PER_GROUP(ncpu)                             \
   (((sizeof (CounterInfo) * COUNTERS_PER_GROUP) +         \
     (sizeof(DzlCounterValue) * (ncpu))) / DATA_CELL_SIZE)
+#ifdef DZL_COUNTER_REQUIRES_ATOMIC
 #define DZL_MEMORY_BARRIER __sync_synchronize()
+#else
+#define DZL_MEMORY_BARRIER 0
+#endif
 
 typedef struct
 {
diff --git a/src/util/dzl-counter.h b/src/util/dzl-counter.h
index 498b937..542f9a8 100644
--- a/src/util/dzl-counter.h
+++ b/src/util/dzl-counter.h
@@ -163,6 +163,9 @@ G_BEGIN_DECLS
 # define dzl_get_current_cpu() dzl_get_current_cpu_rdtscp()
 #elif defined(__linux__)
 # define dzl_get_current_cpu() dzl_get_current_cpu_call()
+#elif defined(__powerpc__) && !defined(__powerpc64__)
+# define dzl_get_current_cpu() 0
+# undef DZL_COUNTER_REQUIRES_ATOMIC
 #else
 # define dzl_get_current_cpu() 0
 # define DZL_COUNTER_REQUIRES_ATOMIC 1
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]