i965/eu: Port Broadwell CMP destination type hack to brw_eu_emit.c.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 30 Jun 2014 14:51:51 +0000 (07:51 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Aug 2014 02:32:34 +0000 (19:32 -0700)
See gen8_generator::CMP().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 822c73cc4395a36143d876064b794dc6ac05100d..1128bad29e5212367143095461884505aada8d23 100644 (file)
@@ -1742,6 +1742,14 @@ void brw_CMP(struct brw_compile *p,
    struct brw_context *brw = p->brw;
    brw_inst *insn = next_insn(p, BRW_OPCODE_CMP);
 
+   if (brw->gen >= 8) {
+      /* The CMP instruction appears to behave erratically for floating point
+       * sources unless the destination type is also float.  Overriding it to
+       * match src0 makes it work in all cases.
+       */
+      dest.type = src0.type;
+   }
+
    brw_inst_set_cond_modifier(brw, insn, conditional);
    brw_set_dest(p, insn, dest);
    brw_set_src0(p, insn, src0);