Mesa (master): i965/fs: Introduce brw_negate_cmod().

Kenneth Graunke kwg at kemper.freedesktop.org
Fri Feb 27 19:38:38 UTC 2015


Module: Mesa
Branch: master
Commit: 4ebacf8aa67b1bfba7820f25536be98c7452dcb1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4ebacf8aa67b1bfba7820f25536be98c7452dcb1

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Feb 25 16:07:03 2015 -0800

i965/fs: Introduce brw_negate_cmod().

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_eu.c |   22 ++++++++++++++++++++++
 src/mesa/drivers/dri/i965/brw_eu.h |    1 +
 2 files changed, 23 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index 9905972..a1b7fda 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -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.
  */
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index a94ea42..736c54b 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -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 */




More information about the mesa-commit mailing list