gm107/ir: make sure that flagsDef is set when emitting setcond
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 27 Jun 2016 22:59:46 +0000 (00:59 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 28 Jun 2016 16:38:56 +0000 (18:38 +0200)
Rely on the existence of a second destination when emitting a setcond
flag is dangerous, because this doesn't mean that the flag has been
correctly set. Instead rely on flagsDef like what emitX() does
for flagsSrc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp

index 40afbce9c6f365e3d943da705f82db5c69ca340d..2c5e8f69d1347a63a4cd637951661650c9b3f626 100644 (file)
@@ -420,7 +420,7 @@ CodeEmitterGM107::emitSAT(int pos)
 void
 CodeEmitterGM107::emitCC(int pos)
 {
-   emitField(pos, 1, insn->defExists(1));
+   emitField(pos, 1, insn->flagsDef >= 0);
 }
 
 void