[Beignet] [PATCH 11/18] GBE: Don't need the emask/notemask/barriermask any more.
Zhigang Gong
zhigang.gong at intel.com
Fri Mar 28 00:10:49 PDT 2014
As we change to use if/endif and change the implementation of
the barrier, we don't need to maintain emask/notmask/barriermask
any more. Just remove them.
Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
backend/src/backend/gen_context.cpp | 21 ---------------------
backend/src/backend/gen_reg_allocation.cpp | 4 ----
backend/src/backend/program.h | 3 ---
backend/src/ir/profile.cpp | 5 +----
backend/src/ir/profile.hpp | 7 ++-----
5 files changed, 3 insertions(+), 37 deletions(-)
diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index bab059b..2bc0e72 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -1416,7 +1416,6 @@ namespace gbe
GenRegister l = ra->genReg(insn.dst(12));
GenRegister m = ra->genReg(insn.dst(13));
GenRegister flagReg = checkFlagRegister(ra->genReg(insn.dst(14)));
- GenRegister emaskReg = ra->genReg(GenRegister::uw1grf(ir::ocl::emask));
GenRegister zero = GenRegister::immud(0),
one = GenRegister::immud(1),
imm31 = GenRegister::immud(31);
@@ -1503,8 +1502,6 @@ namespace gbe
p->curr.execWidth = 1;
p->curr.noMask = 1;
- p->AND(flagReg, flagReg, emaskReg);
-
// under condition, jump back to start point
if (simdWidth == 8)
p->curr.predicate = GEN_PREDICATE_ALIGN1_ANY8H;
@@ -1899,31 +1896,13 @@ namespace gbe
auto &stackUse = dag->getUse(ir::ocl::stackptr);
// We insert the block IP mask first
-#if 0
- this->insertCurbeReg(ir::ocl::blockip, this->newCurbeEntry(GBE_CURBE_BLOCK_IP, 0, this->simdWidth * sizeof(uint16_t)));
- this->insertCurbeReg(ir::ocl::emask, this->newCurbeEntry(GBE_CURBE_EMASK, 0, this->simdWidth * sizeof(uint16_t)));
- this->insertCurbeReg(ir::ocl::notemask, this->newCurbeEntry(GBE_CURBE_NOT_EMASK, 0, sizeof(uint16_t)));
- this->insertCurbeReg(ir::ocl::barriermask, this->newCurbeEntry(GBE_CURBE_BARRIER_MASK, 0, sizeof(uint16_t)));
- // Already inserted registers go here
- const size_t localIDSizde = sizeof(uint32_t) * this->simdWidth;
- insertCurbeReg(ir::ocl::lid0, this->newCurbeEntry(GBE_CURBE_LOCAL_ID_X, 0, localIDSize));
- insertCurbeReg(ir::ocl::lid1, this->newCurbeEntry(GBE_CURBE_LOCAL_ID_Y, 0, localIDSize));
- insertCurbeReg(ir::ocl::lid2, this->newCurbeEntry(GBE_CURBE_LOCAL_ID_Z, 0, localIDSize));
- // Insert the stack buffer if used
- if (stackUse.size() != 0)
- insertCurbeReg(ir::ocl::stackbuffer, this->newCurbeEntry(GBE_CURBE_EXTRA_ARGUMENT, GBE_STACK_BUFFER, ptrSize));
-#else
using namespace ir::ocl;
allocCurbeReg(blockip, GBE_CURBE_BLOCK_IP);
- allocCurbeReg(emask, GBE_CURBE_EMASK);
- allocCurbeReg(notemask, GBE_CURBE_NOT_EMASK);
- allocCurbeReg(barriermask, GBE_CURBE_BARRIER_MASK);
allocCurbeReg(lid0, GBE_CURBE_LOCAL_ID_X);
allocCurbeReg(lid1, GBE_CURBE_LOCAL_ID_Y);
allocCurbeReg(lid2, GBE_CURBE_LOCAL_ID_Z);
if (stackUse.size() != 0)
allocCurbeReg(stackbuffer, GBE_CURBE_EXTRA_ARGUMENT, GBE_STACK_BUFFER);
-#endif
// Go over the arguments and find the related patch locations
const uint32_t argNum = fn.argNum();
for (uint32_t argID = 0u; argID < argNum; ++argID) {
diff --git a/backend/src/backend/gen_reg_allocation.cpp b/backend/src/backend/gen_reg_allocation.cpp
index 5bf6f8a..3f2e746 100644
--- a/backend/src/backend/gen_reg_allocation.cpp
+++ b/backend/src/backend/gen_reg_allocation.cpp
@@ -864,10 +864,6 @@ namespace gbe
this->intervals[reg].maxID = std::max(this->intervals[reg].maxID, lastID);
}
- this->intervals[ocl::emask].minID = 0;
- this->intervals[ocl::emask].maxID = INT_MAX;
- this->intervals[ocl::notemask].minID = 0;
- this->intervals[ocl::notemask].maxID = INT_MAX;
this->intervals[ocl::retVal].minID = INT_MAX;
this->intervals[ocl::retVal].maxID = -INT_MAX;
diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h
index 5f308ad..4ca7277 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -76,9 +76,6 @@ enum gbe_curbe_type {
GBE_CURBE_EXTRA_ARGUMENT,
GBE_CURBE_BLOCK_IP,
GBE_CURBE_THREAD_NUM,
- GBE_CURBE_EMASK,
- GBE_CURBE_NOT_EMASK,
- GBE_CURBE_BARRIER_MASK,
};
/*! Extra arguments use the negative range of sub-values */
diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp
index f91e5d4..2a1bb41 100644
--- a/backend/src/ir/profile.cpp
+++ b/backend/src/ir/profile.cpp
@@ -41,7 +41,7 @@ namespace ir {
"block_ip",
"barrier_id", "thread_number",
"work_dimension",
- "emask", "notemask", "barriermask", "retVal"
+ "retVal"
};
#if GBE_DEBUG
@@ -78,9 +78,6 @@ namespace ir {
DECL_NEW_REG(FAMILY_DWORD, barrierid, 1);
DECL_NEW_REG(FAMILY_DWORD, threadn, 1);
DECL_NEW_REG(FAMILY_DWORD, workdim, 1);
- DECL_NEW_REG(FAMILY_WORD, emask, 1);
- DECL_NEW_REG(FAMILY_WORD, notemask, 1);
- DECL_NEW_REG(FAMILY_WORD, barriermask, 1);
DECL_NEW_REG(FAMILY_WORD, retVal, 1);
}
#undef DECL_NEW_REG
diff --git a/backend/src/ir/profile.hpp b/backend/src/ir/profile.hpp
index cc19fcb..c4763c8 100644
--- a/backend/src/ir/profile.hpp
+++ b/backend/src/ir/profile.hpp
@@ -65,11 +65,8 @@ namespace ir {
static const Register barrierid = Register(21);// barrierid
static const Register threadn = Register(22); // number of threads
static const Register workdim = Register(23); // work dimention.
- static const Register emask = Register(24); // store the emask bits for the branching fix.
- static const Register notemask = Register(25); // store the !emask bits for the branching fix.
- static const Register barriermask = Register(26); // software mask for barrier.
- static const Register retVal = Register(27); // helper register to do data flow analysis.
- static const uint32_t regNum = 28; // number of special registers
+ static const Register retVal = Register(24); // helper register to do data flow analysis.
+ static const uint32_t regNum = 25; // number of special registers
extern const char *specialRegMean[]; // special register name.
} /* namespace ocl */
--
1.8.3.2
More information about the Beignet
mailing list