[Beignet] [PATCH 2/7] GBE: Fix SEL.bool issue.

Ruiling Song ruiling.song at intel.com
Fri Apr 1 06:53:23 UTC 2016


the flag register is used by the condition source, we have
to store the dst register in GRF. when using this dst, will
update from the allocated GRF to flag register.

v2:
  should use ir::FAMILY_BOOL instead of ir::TYPE_BOOL.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/backend/gen_reg_allocation.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backend/src/backend/gen_reg_allocation.cpp b/backend/src/backend/gen_reg_allocation.cpp
index 7de2ea8..8d07045 100644
--- a/backend/src/backend/gen_reg_allocation.cpp
+++ b/backend/src/backend/gen_reg_allocation.cpp
@@ -624,6 +624,11 @@ namespace gbe
               }
               insn.extra.function = GEN_CONDITIONAL_NEQ;
             }
+            // SEL.bool instruction, the dst register should be stored in GRF
+            // the pred flag is used by flag register
+            if (insn.opcode == SEL_OP_SEL && ctx.sel->getRegisterFamily(insn.dst(0).reg()) == ir::FAMILY_BOOL) {
+              allocatedFlags.erase(insn.dst(0).reg());
+            }
             // If this is an external bool, we need to validate it if it is not validated yet.
             if ((insn.state.externFlag &&
                  insn.state.predicate != GEN_PREDICATE_NONE))
-- 
2.4.1



More information about the Beignet mailing list