diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c index 887ef8a22f7..94a9bfaf71e 100644 --- a/src/freedreno/ir3/ir3.c +++ b/src/freedreno/ir3/ir3.c @@ -1773,8 +1773,8 @@ ir3_valid_flags(struct ir3_instruction *instr, unsigned n, unsigned flags) } break; case 3: - valid_flags = - ir3_cat3_absneg(instr->opc, n) | IR3_REG_RELATIV | IR3_REG_SHARED; + valid_flags = ir3_cat3_absneg(compiler, instr->opc, n) | IR3_REG_RELATIV | + IR3_REG_SHARED; switch (instr->opc) { case OPC_SHRM: @@ -2128,7 +2128,7 @@ ir3_cat2_absneg(opc_t opc) /* map cat3 instructions to valid abs/neg flags: */ inline unsigned -ir3_cat3_absneg(opc_t opc, unsigned src_n) +ir3_cat3_absneg(struct ir3_compiler *compiler, opc_t opc, unsigned src_n) { switch (opc) { case OPC_MAD_F16: @@ -2137,6 +2137,10 @@ ir3_cat3_absneg(opc_t opc, unsigned src_n) case OPC_SEL_F32: return IR3_REG_FNEG; + case OPC_SEL_B16: + case OPC_SEL_B32: + return compiler->has_sel_b_fneg ? IR3_REG_FNEG : 0; + case OPC_SAD_S16: case OPC_SAD_S32: return src_n == 1 ? IR3_REG_SNEG : 0; @@ -2151,9 +2155,6 @@ ir3_cat3_absneg(opc_t opc, unsigned src_n) case OPC_SEL_S32: /* neg *may* work on 3rd src.. */ - case OPC_SEL_B16: - case OPC_SEL_B32: - case OPC_SHRM: case OPC_SHLM: case OPC_SHRG: diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index da479e27d86..89c63f11ab9 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -1753,7 +1753,8 @@ ir3_cat2_int(opc_t opc) unsigned ir3_cat2_absneg(opc_t opc); /* map cat3 instructions to valid abs/neg flags: */ -unsigned ir3_cat3_absneg(opc_t opc, unsigned src_n); +unsigned ir3_cat3_absneg(struct ir3_compiler *compiler, opc_t opc, + unsigned src_n); /* Return the type (float, int, or uint) the op uses when converting from the * internal result of the op (which is assumed to be the same size as the