panfrost/midgard: Expand fge lowering to more types

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2019-03-26 04:01:33 +00:00
parent b8739c24ee
commit 7b78af8e00
3 changed files with 12 additions and 6 deletions

View file

@ -218,6 +218,7 @@ static unsigned alu_opcode_props[256] = {
/* For vector comparisons, use ball etc */
[midgard_alu_op_feq] = UNITS_MOST,
[midgard_alu_op_fne] = UNITS_MOST,
[midgard_alu_op_fle] = UNITS_MOST,
[midgard_alu_op_flt] = UNITS_MOST,
[midgard_alu_op_ieq] = UNITS_MOST,
[midgard_alu_op_ine] = UNITS_MOST,

View file

@ -1052,11 +1052,19 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
ALU_CASE(b32any_inequal3, ibany_neq);
ALU_CASE(b32any_inequal4, ibany_neq);
/* For greater-or-equal, we use less-or-equal and flip the
/* For greater-or-equal, we lower to less-or-equal and flip the
* arguments */
case nir_op_ige32: {
op = midgard_alu_op_ile;
case nir_op_fge:
case nir_op_fge32:
case nir_op_ige32:
case nir_op_uge32: {
op =
instr->op == nir_op_fge ? midgard_alu_op_fle :
instr->op == nir_op_fge32 ? midgard_alu_op_fle :
instr->op == nir_op_ige32 ? midgard_alu_op_ile :
instr->op == nir_op_uge32 ? midgard_alu_op_ule :
0;
/* Swap via temporary */
nir_alu_src temp = instr->src[1];

View file

@ -30,9 +30,6 @@ a = 'a'
b = 'b'
algebraic = [
# TODO: Should really be a fle, maybe not lowered in algebraic?
(('fge', a, b), ('flt', b, a)),
# XXX: We have hw ops for this, just unknown atm..
#(('fsign@32', a), ('i2f32@32', ('isign', ('f2i32@32', ('fmul', a, 0x43800000)))))
#(('fsign', a), ('fcsel', ('fge', a, 0), 1.0, ('fcsel', ('flt', a, 0.0), -1.0, 0.0)))