ck_pr: Add acquire and release fences.

ck_pring
Samy Al Bahra 11 years ago
parent fb7310b4cb
commit 661f3948ed

@ -95,6 +95,8 @@ CK_PR_FENCE_EMIT(store_load)
CK_PR_FENCE_EMIT(load) CK_PR_FENCE_EMIT(load)
CK_PR_FENCE_EMIT(store) CK_PR_FENCE_EMIT(store)
CK_PR_FENCE_EMIT(memory) CK_PR_FENCE_EMIT(memory)
CK_PR_FENCE_EMIT(acquire)
CK_PR_FENCE_EMIT(release)
#elif defined(CK_MD_PSO) #elif defined(CK_MD_PSO)
/* /*
* Anything can be re-ordered with respect to stores. * 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_NOOP(load)
CK_PR_FENCE_EMIT(store) CK_PR_FENCE_EMIT(store)
CK_PR_FENCE_EMIT(memory) CK_PR_FENCE_EMIT(memory)
CK_PR_FENCE_EMIT(acquire)
CK_PR_FENCE_EMIT(release)
#elif defined(CK_MD_TSO) #elif defined(CK_MD_TSO)
/* /*
* Only loads are re-ordered and only with respect to * 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(load)
CK_PR_FENCE_NOOP(store) CK_PR_FENCE_NOOP(store)
CK_PR_FENCE_NOOP(memory) 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 */ #endif /* CK_MD_TSO */
#undef CK_PR_FENCE_EMIT #undef CK_PR_FENCE_EMIT

@ -92,6 +92,8 @@ CK_PR_FENCE(store_load, _CK_DMB_ST)
CK_PR_FENCE(load, _CK_DMB) CK_PR_FENCE(load, _CK_DMB)
CK_PR_FENCE(load_store, _CK_DMB) CK_PR_FENCE(load_store, _CK_DMB)
CK_PR_FENCE(memory, _CK_DMB) CK_PR_FENCE(memory, _CK_DMB)
CK_PR_FENCE(acquire, _CK_DMB)
CK_PR_FENCE(release, _CK_DMB)
#undef CK_PR_FENCE #undef CK_PR_FENCE

@ -77,6 +77,8 @@ CK_PR_FENCE(store_load, "sync")
CK_PR_FENCE(load, "lwsync") CK_PR_FENCE(load, "lwsync")
CK_PR_FENCE(load_store, "lwsync") CK_PR_FENCE(load_store, "lwsync")
CK_PR_FENCE(memory, "sync") CK_PR_FENCE(memory, "sync")
CK_PR_FENCE(acquire, "lwsync")
CK_PR_FENCE(release, "lwsync")
#undef CK_PR_FENCE #undef CK_PR_FENCE

@ -80,6 +80,8 @@ CK_PR_FENCE(store_load, "sync")
CK_PR_FENCE(load, "lwsync") CK_PR_FENCE(load, "lwsync")
CK_PR_FENCE(load_store, "lwsync") CK_PR_FENCE(load_store, "lwsync")
CK_PR_FENCE(memory, "sync") CK_PR_FENCE(memory, "sync")
CK_PR_FENCE(acquire, "lwsync")
CK_PR_FENCE(release, "lwsync")
#undef CK_PR_FENCE #undef CK_PR_FENCE

@ -77,6 +77,8 @@ CK_PR_FENCE(store_load, "membar #StoreLoad")
CK_PR_FENCE(load, "membar #LoadLoad") CK_PR_FENCE(load, "membar #LoadLoad")
CK_PR_FENCE(load_store, "membar #LoadStore") CK_PR_FENCE(load_store, "membar #LoadStore")
CK_PR_FENCE(memory, "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad") 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 #undef CK_PR_FENCE

@ -80,6 +80,8 @@ CK_PR_FENCE(load_store, "mfence")
CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store, "sfence")
CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(store_load, "mfence")
CK_PR_FENCE(memory, "mfence") CK_PR_FENCE(memory, "mfence")
CK_PR_FENCE(release, "mfence")
CK_PR_FENCE(acquire, "mfence")
#undef CK_PR_FENCE #undef CK_PR_FENCE

@ -86,6 +86,8 @@ CK_PR_FENCE(load_store, "mfence")
CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store, "sfence")
CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(store_load, "mfence")
CK_PR_FENCE(memory, "mfence") CK_PR_FENCE(memory, "mfence")
CK_PR_FENCE(release, "mfence")
CK_PR_FENCE(acquire, "mfence")
#undef CK_PR_FENCE #undef CK_PR_FENCE

Loading…
Cancel
Save