i965/fs: Introduce brw_negate_cmod().
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 26 Feb 2015 00:07:03 +0000 (16:07 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 27 Feb 2015 19:36:08 +0000 (11:36 -0800)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu.c
src/mesa/drivers/dri/i965/brw_eu.h

index 990597286d88c69326f6f88dd7bf8f43765244e1..a1b7fda93360e435940743dff514dfba8e70e9e8 100644 (file)
@@ -65,6 +65,28 @@ brw_reg_type_letters(unsigned type)
    return names[type];
 }
 
+/* Returns a conditional modifier that negates the condition. */
+enum brw_conditional_mod
+brw_negate_cmod(uint32_t cmod)
+{
+   switch (cmod) {
+   case BRW_CONDITIONAL_Z:
+      return BRW_CONDITIONAL_NZ;
+   case BRW_CONDITIONAL_NZ:
+      return BRW_CONDITIONAL_Z;
+   case BRW_CONDITIONAL_G:
+      return BRW_CONDITIONAL_LE;
+   case BRW_CONDITIONAL_GE:
+      return BRW_CONDITIONAL_L;
+   case BRW_CONDITIONAL_L:
+      return BRW_CONDITIONAL_GE;
+   case BRW_CONDITIONAL_LE:
+      return BRW_CONDITIONAL_G;
+   default:
+      return ~0;
+   }
+}
+
 /* Returns the corresponding conditional mod for swapping src0 and
  * src1 in e.g. CMP.
  */
index a94ea4221ad2ba2d8c30ccf7c9a0d62d7f8d31f4..736c54b4fa6b371e1b210b2525bb0330972f3ba3 100644 (file)
@@ -445,6 +445,7 @@ void brw_set_src1(struct brw_compile *p, brw_inst *insn, struct brw_reg reg);
 
 void brw_set_uip_jip(struct brw_compile *p);
 
+enum brw_conditional_mod brw_negate_cmod(uint32_t cmod);
 enum brw_conditional_mod brw_swap_cmod(uint32_t cmod);
 
 /* brw_eu_compact.c */