From 661f3948ed13fae81aaefc1e263492db8c8da824 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 2 Jan 2014 08:29:04 -0500 Subject: [PATCH] ck_pr: Add acquire and release fences. --- include/ck_pr.h | 8 ++++++++ include/gcc/arm/ck_pr.h | 2 ++ include/gcc/ppc/ck_pr.h | 2 ++ include/gcc/ppc64/ck_pr.h | 2 ++ include/gcc/sparcv9/ck_pr.h | 2 ++ include/gcc/x86/ck_pr.h | 2 ++ include/gcc/x86_64/ck_pr.h | 2 ++ 7 files changed, 20 insertions(+) diff --git a/include/ck_pr.h b/include/ck_pr.h index 66214dc..2832e17 100644 --- a/include/ck_pr.h +++ b/include/ck_pr.h @@ -95,6 +95,8 @@ CK_PR_FENCE_EMIT(store_load) CK_PR_FENCE_EMIT(load) CK_PR_FENCE_EMIT(store) CK_PR_FENCE_EMIT(memory) +CK_PR_FENCE_EMIT(acquire) +CK_PR_FENCE_EMIT(release) #elif defined(CK_MD_PSO) /* * Anything can be re-ordered with respect to stores. @@ -110,6 +112,8 @@ CK_PR_FENCE_EMIT(store_load) CK_PR_FENCE_NOOP(load) CK_PR_FENCE_EMIT(store) CK_PR_FENCE_EMIT(memory) +CK_PR_FENCE_EMIT(acquire) +CK_PR_FENCE_EMIT(release) #elif defined(CK_MD_TSO) /* * Only loads are re-ordered and only with respect to @@ -125,6 +129,10 @@ CK_PR_FENCE_EMIT(store_load) CK_PR_FENCE_NOOP(load) CK_PR_FENCE_NOOP(store) CK_PR_FENCE_NOOP(memory) +CK_PR_FENCE_NOOP(acquire) +CK_PR_FENCE_NOOP(release) +#elif +#error "No memory model has been defined." #endif /* CK_MD_TSO */ #undef CK_PR_FENCE_EMIT diff --git a/include/gcc/arm/ck_pr.h b/include/gcc/arm/ck_pr.h index a6a9966..2e67b8c 100644 --- a/include/gcc/arm/ck_pr.h +++ b/include/gcc/arm/ck_pr.h @@ -92,6 +92,8 @@ CK_PR_FENCE(store_load, _CK_DMB_ST) CK_PR_FENCE(load, _CK_DMB) CK_PR_FENCE(load_store, _CK_DMB) CK_PR_FENCE(memory, _CK_DMB) +CK_PR_FENCE(acquire, _CK_DMB) +CK_PR_FENCE(release, _CK_DMB) #undef CK_PR_FENCE diff --git a/include/gcc/ppc/ck_pr.h b/include/gcc/ppc/ck_pr.h index 6a445f1..da42fcf 100644 --- a/include/gcc/ppc/ck_pr.h +++ b/include/gcc/ppc/ck_pr.h @@ -77,6 +77,8 @@ CK_PR_FENCE(store_load, "sync") CK_PR_FENCE(load, "lwsync") CK_PR_FENCE(load_store, "lwsync") CK_PR_FENCE(memory, "sync") +CK_PR_FENCE(acquire, "lwsync") +CK_PR_FENCE(release, "lwsync") #undef CK_PR_FENCE diff --git a/include/gcc/ppc64/ck_pr.h b/include/gcc/ppc64/ck_pr.h index f66bac1..54b7ec2 100644 --- a/include/gcc/ppc64/ck_pr.h +++ b/include/gcc/ppc64/ck_pr.h @@ -80,6 +80,8 @@ CK_PR_FENCE(store_load, "sync") CK_PR_FENCE(load, "lwsync") CK_PR_FENCE(load_store, "lwsync") CK_PR_FENCE(memory, "sync") +CK_PR_FENCE(acquire, "lwsync") +CK_PR_FENCE(release, "lwsync") #undef CK_PR_FENCE diff --git a/include/gcc/sparcv9/ck_pr.h b/include/gcc/sparcv9/ck_pr.h index 68ffd22..253c8ef 100644 --- a/include/gcc/sparcv9/ck_pr.h +++ b/include/gcc/sparcv9/ck_pr.h @@ -77,6 +77,8 @@ CK_PR_FENCE(store_load, "membar #StoreLoad") CK_PR_FENCE(load, "membar #LoadLoad") CK_PR_FENCE(load_store, "membar #LoadStore") CK_PR_FENCE(memory, "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad") +CK_PR_FENCE(acquire, "membar #LoadLoad | #LoadStore") +CK_PR_FENCE(release, "membar #LoadStore | #StoreStore") #undef CK_PR_FENCE diff --git a/include/gcc/x86/ck_pr.h b/include/gcc/x86/ck_pr.h index b731c4e..1fef566 100644 --- a/include/gcc/x86/ck_pr.h +++ b/include/gcc/x86/ck_pr.h @@ -80,6 +80,8 @@ CK_PR_FENCE(load_store, "mfence") CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(memory, "mfence") +CK_PR_FENCE(release, "mfence") +CK_PR_FENCE(acquire, "mfence") #undef CK_PR_FENCE diff --git a/include/gcc/x86_64/ck_pr.h b/include/gcc/x86_64/ck_pr.h index a5cddfb..8200af8 100644 --- a/include/gcc/x86_64/ck_pr.h +++ b/include/gcc/x86_64/ck_pr.h @@ -86,6 +86,8 @@ CK_PR_FENCE(load_store, "mfence") CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(memory, "mfence") +CK_PR_FENCE(release, "mfence") +CK_PR_FENCE(acquire, "mfence") #undef CK_PR_FENCE