nir/algebraic: add support for conditional helper functions to expressions

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Timothy Arceri
2017-01-10 15:47:31 +11:00
parent a7e399de59
commit e8328e55e7
3 changed files with 15 additions and 1 deletions

View File

@@ -263,6 +263,9 @@ match_expression(const nir_search_expression *expr, nir_alu_instr *instr,
unsigned num_components, const uint8_t *swizzle,
struct match_state *state)
{
if (expr->cond && !expr->cond(instr))
return false;
if (instr->op != expr->opcode)
return false;