i965: Define consistent interface to enable instruction conditional modifiers.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 3 Jun 2015 18:24:18 +0000 (21:24 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 9 Jun 2015 10:56:06 +0000 (13:56 +0300)
v2: Use set_ prefix.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_ir_fs.h
src/mesa/drivers/dri/i965/brw_ir_vec4.h

index 660bab2c466f5864ac208b9b3e87bf776d3b3f73..07af0082d9def994da623615f9f7e4e816029449 100644 (file)
@@ -293,4 +293,15 @@ set_predicate(enum brw_predicate pred, fs_inst *inst)
    return set_predicate_inv(pred, false, inst);
 }
 
+/**
+ * Write the result of evaluating the condition given by \p mod to a flag
+ * register.
+ */
+static inline fs_inst *
+set_condmod(enum brw_conditional_mod mod, fs_inst *inst)
+{
+   inst->conditional_mod = mod;
+   return inst;
+}
+
 #endif
index b9a5a2519148e6a2d1e085873b51b3c8a04ef20c..96d1cfbeb93173f1899eb846a794d84a6e85c5b2 100644 (file)
@@ -212,6 +212,17 @@ set_predicate(enum brw_predicate pred, vec4_instruction *inst)
    return set_predicate_inv(pred, false, inst);
 }
 
+/**
+ * Write the result of evaluating the condition given by \p mod to a flag
+ * register.
+ */
+inline vec4_instruction *
+set_condmod(enum brw_conditional_mod mod, vec4_instruction *inst)
+{
+   inst->conditional_mod = mod;
+   return inst;
+}
+
 } /* namespace brw */
 
 #endif