summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPan Xiuli <xiuli.pan@intel.com>2016-09-02 16:50:51 +0800
committerYang Rong <rong.r.yang@intel.com>2016-10-21 12:35:03 +0800
commit4fc1429d976c44ca37a46683b8bcbfc40052b430 (patch)
treea42a86b03cf7de836cbb2db5c51056d61f8a1cb0
parent685decb2b984942fec22736d7a3f5154ccb52b8f (diff)
Backend: Fix bug for sub/work group functions
In simd8 mode, some of the MOV is in simd16 mode, they will influence registers that we should not access. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/backend/gen8_context.cpp14
-rw-r--r--backend/src/backend/gen_context.cpp14
2 files changed, 14 insertions, 14 deletions
diff --git a/backend/src/backend/gen8_context.cpp b/backend/src/backend/gen8_context.cpp
index a520e618..09b38b2b 100644
--- a/backend/src/backend/gen8_context.cpp
+++ b/backend/src/backend/gen8_context.cpp
@@ -1590,7 +1590,7 @@ namespace gbe
wg_op == ir::WORKGROUP_OP_REDUCE_MIN ||
wg_op == ir::WORKGROUP_OP_REDUCE_MAX)
{
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
/* value exchanged with other threads */
p->MOV(threadExchangeData, result[0]);
/* partial result thread */
@@ -1600,7 +1600,7 @@ namespace gbe
wg_op == ir::WORKGROUP_OP_INCLUSIVE_MIN ||
wg_op == ir::WORKGROUP_OP_INCLUSIVE_MAX)
{
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
/* value exchanged with other threads */
p->MOV(threadExchangeData, result[simd - 1]);
/* partial result thread */
@@ -1614,7 +1614,7 @@ namespace gbe
/* set result[0] to min/max/null */
wgOpInitValue(p, result[0], wg_op);
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
/* value exchanged with other threads */
wgOpPerform(threadExchangeData, result[simd - 1], input[simd - 1], wg_op, p);
/* partial result thread */
@@ -1675,7 +1675,7 @@ namespace gbe
/* do some calculation within each thread */
wgOpPerformThread(dst, theVal, threadData, tmp, simd, wg_op, p);
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
p->MOV(theVal, dst);
threadData = GenRegister::toUniform(threadData, dst.type);
@@ -1790,13 +1790,13 @@ namespace gbe
wg_op == ir::WORKGROUP_OP_REDUCE_MAX)
{
/* save result to final register location dst */
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
p->MOV(dst, partialData);
}
else
{
/* save result to final register location dst */
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
if(wg_op == ir::WORKGROUP_OP_INCLUSIVE_ADD
|| wg_op == ir::WORKGROUP_OP_EXCLUSIVE_ADD)
@@ -1845,7 +1845,7 @@ namespace gbe
p->CMP(GEN_CONDITIONAL_EQ, threadId, GenRegister::immd(0x0));
p->curr.predicate = GEN_PREDICATE_NORMAL;
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
p->MOV(dst, theVal);
} p->pop();
}
diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index 6afa4709..4f73237f 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -3113,7 +3113,7 @@ namespace gbe
wg_op == ir::WORKGROUP_OP_REDUCE_MIN ||
wg_op == ir::WORKGROUP_OP_REDUCE_MAX)
{
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
/* value exchanged with other threads */
p->MOV(threadExchangeData, result[0]);
/* partial result thread */
@@ -3123,7 +3123,7 @@ namespace gbe
wg_op == ir::WORKGROUP_OP_INCLUSIVE_MIN ||
wg_op == ir::WORKGROUP_OP_INCLUSIVE_MAX)
{
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
/* value exchanged with other threads */
p->MOV(threadExchangeData, result[simd - 1]);
/* partial result thread */
@@ -3137,7 +3137,7 @@ namespace gbe
/* set result[0] to min/max/null */
wgOpInitValue(p, result[0], wg_op);
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
/* value exchanged with other threads */
wgOpPerform(threadExchangeData, result[simd - 1], input[simd - 1], wg_op, p);
/* partial result thread */
@@ -3198,7 +3198,7 @@ namespace gbe
/* do some calculation within each thread */
wgOpPerformThread(dst, theVal, threadData, tmp, simd, wg_op, p);
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
p->MOV(theVal, dst);
threadData = GenRegister::toUniform(threadData, dst.type);
@@ -3313,13 +3313,13 @@ namespace gbe
wg_op == ir::WORKGROUP_OP_REDUCE_MAX)
{
/* save result to final register location dst */
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
p->MOV(dst, partialData);
}
else
{
/* save result to final register location dst */
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
if(wg_op == ir::WORKGROUP_OP_INCLUSIVE_ADD
|| wg_op == ir::WORKGROUP_OP_EXCLUSIVE_ADD)
@@ -3368,7 +3368,7 @@ namespace gbe
p->CMP(GEN_CONDITIONAL_EQ, threadId, GenRegister::immd(0x0));
p->curr.predicate = GEN_PREDICATE_NORMAL;
- p->curr.execWidth = 16;
+ p->curr.execWidth = simd;
p->MOV(dst, theVal);
} p->pop();
}