[Beignet] [PATCH] Fix a compare immediate optimize error.
Zhigang Gong
zhigang.gong at linux.intel.com
Thu Nov 14 21:22:09 PST 2013
Pushed, thanks.
On Fri, Nov 15, 2013 at 11:40:30AM +0800, Yang Rong wrote:
> 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