From 7624f8410f64a7ce0ba125a2025904c70610c076 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 3 Jun 2015 21:24:18 +0300 Subject: i965: Define consistent interface to enable instruction conditional modifiers. v2: Use set_ prefix. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_ir_fs.h | 11 +++++++++++ src/mesa/drivers/dri/i965/brw_ir_vec4.h | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h index 660bab2c466..07af0082d9d 100644 --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h @@ -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 diff --git a/src/mesa/drivers/dri/i965/brw_ir_vec4.h b/src/mesa/drivers/dri/i965/brw_ir_vec4.h index b9a5a251914..96d1cfbeb93 100644 --- a/src/mesa/drivers/dri/i965/brw_ir_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_ir_vec4.h @@ -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 -- cgit v1.2.3