[Beignet] [PATCH 17/27] Modify the fake dst register for CMP in register allocation.
junyan.he at inbox.com
junyan.he at inbox.com
Tue Jan 6 02:02:01 PST 2015
From: Junyan He <junyan.he at linux.intel.com>
The fake dst regigster which is used to avoid the thread switch
for CMP instruction is not correct for I64 comparing.
The dst must have the same vstride as the src, so we need to
allocate a fake long type register.
Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
backend/src/backend/gen_reg_allocation.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/backend/src/backend/gen_reg_allocation.cpp b/backend/src/backend/gen_reg_allocation.cpp
index 26078e0..71bb8c1 100644
--- a/backend/src/backend/gen_reg_allocation.cpp
+++ b/backend/src/backend/gen_reg_allocation.cpp
@@ -620,7 +620,10 @@ namespace gbe
// set a temporary register to avoid switch in this block.
bool isSrc = false;
bool needMov = false;
- this->replaceReg(selection, &insn, 0, isSrc, ir::TYPE_FLOAT, needMov);
+ ir::Type ir_type = ir::TYPE_FLOAT;
+ if (insn.src(0).isint64())
+ ir_type = ir::TYPE_U64;
+ this->replaceReg(selection, &insn, 0, isSrc, ir_type, needMov);
}
// If the instruction requires to generate (CMP for long/int/float..)
// the flag value to the register, and it's not a pure flag boolean,
--
1.9.1
More information about the Beignet
mailing list