@@ -18,39 +18,37 @@ extern __constant int __OptDisable;
1818
1919// MEMFENCE IMPLEMENTATION
2020
21- void __attribute__((optnone )) __intel_memfence_optnone (bool flushRW , bool isGlobal , bool invalidateL1 , bool forceLocalLSCScope )
21+ void __attribute__((optnone )) __intel_memfence_optnone (bool flushRW , bool isGlobal , bool invalidateL1 )
2222{
23- #define MEMFENCE_IF (V1 , V5 , V6 , V7 ) \
24- if (flushRW == V1 && isGlobal == V5 && invalidateL1 == V6 && forceLocalLSCScope == V7) \
25- { \
26- __builtin_IB_memfence(true, V1, false, false, false, V5, V6, V7); \
23+ #define MEMFENCE_IF (V1 , V5 , V6 ) \
24+ if (flushRW == V1 && isGlobal == V5 && invalidateL1 == V6) \
25+ { \
26+ __builtin_IB_memfence(true, V1, false, false, false, V5, V6); \
2727} else
2828
2929// Generate combinations for all MEMFENCE_IF cases, e.g.:
30- // true, true, true, true
31- // true, true, true, false etc.
32- #define MF_L3 (...) MF_L2(__VA_ARGS__,false) MF_L2(__VA_ARGS__,true)
30+ // true, true, true
31+ // true, true, false etc.
3332#define MF_L2 (...) MF_L1(__VA_ARGS__,false) MF_L1(__VA_ARGS__,true)
3433#define MF_L1 (...) MEMFENCE_IF(__VA_ARGS__,false) MEMFENCE_IF(__VA_ARGS__,true)
35- MF_L3 (false )
36- MF_L3 (true ) {}
34+ MF_L2 (false )
35+ MF_L2 (true ) {}
3736
3837#undef MEMFENCE_IF
39- #undef MF_L3
4038#undef MF_L2
4139#undef MF_L1
4240}
43- void __intel_memfence (bool flushRW , bool isGlobal , bool invalidateL1 , bool forceLocalLSCScope )
41+ void __intel_memfence (bool flushRW , bool isGlobal , bool invalidateL1 )
4442{
45- __builtin_IB_memfence (true, flushRW , false, false, false, isGlobal , invalidateL1 , forceLocalLSCScope );
43+ __builtin_IB_memfence (true, flushRW , false, false, false, isGlobal , invalidateL1 );
4644}
4745
48- void __intel_memfence_handler (bool flushRW , bool isGlobal , bool invalidateL1 , bool forceLocalLSCScope )
46+ void __intel_memfence_handler (bool flushRW , bool isGlobal , bool invalidateL1 )
4947{
5048 if (__OptDisable )
51- __intel_memfence_optnone (flushRW , isGlobal , invalidateL1 , forceLocalLSCScope );
49+ __intel_memfence_optnone (flushRW , isGlobal , invalidateL1 );
5250 else
53- __intel_memfence (flushRW , isGlobal , invalidateL1 , forceLocalLSCScope );
51+ __intel_memfence (flushRW , isGlobal , invalidateL1 );
5452}
5553
5654// TYPEDMEMFENCE IMPLEMENTATION
@@ -99,12 +97,12 @@ static void __intel_atomic_work_item_fence( Scope_t Memory, uint Semantics )
9997 // although on some platforms they may be elided; platform-specific checks are performed in codegen
10098 if (Semantics & WorkgroupMemory )
10199 {
102- __intel_memfence_handler (false, false, false,false );
100+ __intel_memfence_handler (false, false, false);
103101 }
104102 if (Semantics & CrossWorkgroupMemory )
105103 {
106104 bool flushL3 = Memory == Device || Memory == CrossDevice ;
107- __intel_memfence_handler (flushL3 , true, invalidateL1 , false );
105+ __intel_memfence_handler (flushL3 , true, invalidateL1 );
108106 }
109107 }
110108}
0 commit comments