[Beignet] [PATCH] Fix a compare immediate optimize error.
Xing, Homer
homer.xing at intel.com
Thu Nov 14 20:06:08 PST 2013
Good patch. Looks good to me.
-----Original Message-----
From: beignet-bounces at lists.freedesktop.org [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Yang Rong
Sent: Friday, November 15, 2013 11:41 AM
To: beignet at lists.freedesktop.org
Cc: Yang, Rong R
Subject: [Beignet] [PATCH] Fix a compare immediate optimize error.
When do LOADI/compare -> compare optimize, IMM src1 will using LOADI type, but LOADI doesn't care unsigned or signed. Should use the compare type.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
backend/src/backend/gen_insn_selection.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index 5a6b9fd..335321a 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -2528,6 +2528,8 @@ namespace gbe
const auto &childInsn = cast<LoadImmInstruction>(dag1->insn);
src0 = sel.selReg(insn.getSrc(0), type);
src1 = getRegisterFromImmediate(childInsn.getImmediate());
+ if(src1.type != src0.type)
+ src1 = GenRegister::retype(src1, src0.type);
if (dag0) dag0->isRoot = 1;
} else {
src0 = sel.selReg(insn.getSrc(0), type);
--
1.8.1.2
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list