summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-03-26 04:01:33 +0000
committerAlyssa Rosenzweig <[email protected]>2019-03-26 23:36:09 +0000
commit7b78af8e00271ff7f52b04591bbf3bec6c382c98 (patch)
tree20c58f42a53b403b9ccda3986552abf6b5a61b7c /src/gallium/drivers/panfrost
parentb8739c24ee2fdccc60e4e18357eb9e63ae2b8183 (diff)
panfrost/midgard: Expand fge lowering to more types
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/midgard/helpers.h1
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_compile.c14
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_nir_algebraic.py3
3 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/helpers.h b/src/gallium/drivers/panfrost/midgard/helpers.h
index 0d553d87917..84db2de84d1 100644
--- a/src/gallium/drivers/panfrost/midgard/helpers.h
+++ b/src/gallium/drivers/panfrost/midgard/helpers.h
@@ -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,
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index 0c7bc28f00a..d6ed0008596 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -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];
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_nir_algebraic.py b/src/gallium/drivers/panfrost/midgard/midgard_nir_algebraic.py
index e5af36539d6..8aad4b128c4 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_nir_algebraic.py
+++ b/src/gallium/drivers/panfrost/midgard/midgard_nir_algebraic.py
@@ -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)))