diff options
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index f2529e52a09..5e822299094 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -237,6 +237,16 @@ bi_class_for_nir_alu(nir_op op) case nir_op_isub: return BI_ISUB; + case nir_op_flt: + case nir_op_fge: + case nir_op_feq: + case nir_op_fne: + case nir_op_ilt: + case nir_op_ige: + case nir_op_ieq: + case nir_op_ine: + return BI_CMP; + case nir_op_bcsel: return BI_CSEL; @@ -290,6 +300,27 @@ bi_class_for_nir_alu(nir_op op) } } +static enum bi_cond +bi_cond_for_nir(nir_op op) +{ + switch (op) { + case nir_op_flt: + case nir_op_ilt: + return BI_COND_LT; + case nir_op_fge: + case nir_op_ige: + return BI_COND_GE; + case nir_op_feq: + case nir_op_ieq: + return BI_COND_EQ; + case nir_op_fne: + case nir_op_ine: + return BI_COND_NE; + default: + unreachable("Invalid compare"); + } +} + static void emit_alu(bi_context *ctx, nir_alu_instr *instr) { @@ -388,6 +419,16 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr) case nir_op_fcos: alu.op.special = BI_SPECIAL_FCOS; break; + case nir_op_flt: + case nir_op_ilt: + case nir_op_fge: + case nir_op_ige: + case nir_op_feq: + case nir_op_ieq: + case nir_op_fne: + case nir_op_ine: + alu.op.compare = bi_cond_for_nir(instr->op); + break; default: break; } |