From af8665c3a5bc91b2132c31e8ff619592f9472140 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Wed, 24 Feb 2021 22:15:04 -0500 Subject: [PATCH] nv50/ir: fix emission of logic ops on half-regs Signed-off-by: Ilia Mirkin Acked-by: Pierre Moreau Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp index a65c59e9ec1..a15b43a92e4 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp @@ -1614,13 +1614,15 @@ CodeEmitterNV50::emitLogicOp(const Instruction *i) emitForm_IMM(i); } else { switch (i->op) { - case OP_AND: code[1] = 0x04000000; break; - case OP_OR: code[1] = 0x04004000; break; - case OP_XOR: code[1] = 0x04008000; break; + case OP_AND: code[1] = 0x00000000; break; + case OP_OR: code[1] = 0x00004000; break; + case OP_XOR: code[1] = 0x00008000; break; default: assert(0); break; } + if (typeSizeof(i->dType) == 4) + code[1] |= 0x04000000; if (i->src(0).mod & Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 16; if (i->src(1).mod & Modifier(NV50_IR_MOD_NOT))