From: Alyssa Rosenzweig Date: Tue, 10 Mar 2020 12:03:20 +0000 (-0400) Subject: pan/bi: Add isub op X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55f0d811e4aeba74842c8a86e02889ae3e86c994;p=mesa.git pan/bi: Add isub op Can't be a regular ADD since there's no negate modifier for integers (it's a different opcode entirely). Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index daccf91a98f..06b4a034cfc 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -120,6 +120,7 @@ bi_class_name(enum bi_class cl) case BI_DISCARD: return "discard"; case BI_FMA: return "fma"; case BI_FREXP: return "frexp"; + case BI_ISUB: return "isub"; case BI_LOAD: return "load"; case BI_LOAD_UNIFORM: return "load_uniform"; case BI_LOAD_ATTR: return "load_attr"; diff --git a/src/panfrost/bifrost/bi_tables.c b/src/panfrost/bifrost/bi_tables.c index 06430d0912b..e33b89aae55 100644 --- a/src/panfrost/bifrost/bi_tables.c +++ b/src/panfrost/bifrost/bi_tables.c @@ -38,6 +38,7 @@ unsigned bi_class_props[BI_NUM_CLASSES] = { [BI_DISCARD] = BI_SCHED_HI_LATENCY, [BI_FMA] = BI_ROUNDMODE | BI_SCHED_FMA, [BI_FREXP] = BI_SCHED_ALL, + [BI_ISUB] = BI_GENERIC | BI_SCHED_ALL, [BI_LOAD] = BI_SCHED_HI_LATENCY, [BI_LOAD_UNIFORM] = BI_SCHED_HI_LATENCY, [BI_LOAD_ATTR] = BI_SCHED_HI_LATENCY, diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 6fa982e50f4..97ef06946ac 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -233,6 +233,8 @@ bi_class_for_nir_alu(nir_op op) case nir_op_fadd: case nir_op_fsub: return BI_ADD; + case nir_op_isub: + return BI_ISUB; case nir_op_i2i8: case nir_op_i2i16: diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index c1c8d695be3..ec1a6f3768c 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -58,6 +58,7 @@ enum bi_class { BI_DISCARD, BI_FMA, BI_FREXP, + BI_ISUB, BI_LOAD, BI_LOAD_UNIFORM, BI_LOAD_ATTR,