GBE: work around the local memory barrier fence issue.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Tue, 25 Jun 2013 06:22:43 +0000 (14:22 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Tue, 25 Jun 2013 06:27:35 +0000 (14:27 +0800)
According to the spec, we do not need to add a memory fence
for SLM's access. But, in pratice, we have to add it to make
sure get correct result. Don't know the root cause yet, just
use this work around now.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
backend/src/backend/gen_insn_selection.cpp

index 5901419..1e5f514 100644 (file)
@@ -1695,8 +1695,8 @@ namespace gbe
       const ir::Register reg = sel.reg(FAMILY_DWORD);
 
       const uint32_t params = insn.getParameters();
-      //need to double check local barrier whether need fence or not
-      if(params == syncGlobalBarrier) {
+      //XXX TODO need to double check local barrier whether need fence or not
+      if(params == syncGlobalBarrier || params == syncLocalBarrier) {
         const ir::Register fenceDst = sel.reg(FAMILY_DWORD);
         sel.FENCE(sel.selReg(fenceDst, ir::TYPE_U32));
       }