From c7731a07408c5d4169625d4a78962d2887419080 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sat, 28 May 2016 13:07:12 -0400 Subject: [PATCH] gk110/ir: fix unspilling of predicates from registers Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96258 Signed-off-by: Ilia Mirkin Cc: "11.2 11.1" --- .../nouveau/codegen/nv50_ir_emit_gk110.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp index 27d9b8e1689..80e09900bc6 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -2139,6 +2139,34 @@ CodeEmitterGK110::getSRegEncoding(const ValueRef& ref) void CodeEmitterGK110::emitMOV(const Instruction *i) { + if (i->def(0).getFile() == FILE_PREDICATE) { + if (i->src(0).getFile() == FILE_GPR) { + // Use ISETP.NE.AND dst, PT, src, RZ, PT + code[0] = 0x00000002; + code[1] = 0xdb500000; + + code[0] |= 0x7 << 2; + code[0] |= 0xff << 23; + code[1] |= 0x7 << 10; + srcId(i->src(0), 10); + } else + if (i->src(0).getFile() == FILE_PREDICATE) { + // Use PSETP.AND.AND dst, PT, src, PT, PT + code[0] = 0x00000002; + code[1] = 0x84800000; + + code[0] |= 0x7 << 2; + code[1] |= 0x7 << 0; + code[1] |= 0x7 << 10; + + srcId(i->src(0), 14); + } else { + assert(!"Unexpected source for predicate destination"); + emitNOP(i); + } + emitPredicate(i); + defId(i->def(0), 5); + } else if (i->src(0).getFile() == FILE_SYSTEM_VALUE) { code[0] = 0x00000002 | (getSRegEncoding(i->src(0)) << 23); code[1] = 0x86400000; -- 2.30.2