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.
Signed-off-by: Ruiling Song <[email protected]> --- 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 a9338c5..49f7331 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::TYPE_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 _______________________________________________ Beignet mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/beignet
