diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-03-27 20:28:09 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-31 01:12:26 +0000 |
commit | f81b67b857bd941ada721aa77ccbf430456eff0c (patch) | |
tree | 3e875d7b90bf0431d4af454dbd7781f28094a4d9 /src | |
parent | c7170e974234d5c5bd1a6f5f7b2f76ef5acc44c1 (diff) |
pan/bi: Handle round opcodes in frontend
These correspond to various ops routed through BI_ROUND
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 2d137605bf4..f78dfddbcce 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -413,6 +413,12 @@ bi_class_for_nir_alu(nir_op op) case nir_op_mov: return BI_MOV; + case nir_op_fround_even: + case nir_op_fceil: + case nir_op_ffloor: + case nir_op_ftrunc: + return BI_ROUND; + case nir_op_frcp: case nir_op_frsq: case nir_op_fsin: @@ -607,6 +613,22 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr) BI_CASE_CMP(nir_op_ine) alu.op.compare = bi_cond_for_nir(instr->op, false); break; + case nir_op_fround_even: + alu.op.round = BI_ROUND_MODE; + alu.roundmode = BIFROST_RTE; + break; + case nir_op_fceil: + alu.op.round = BI_ROUND_MODE; + alu.roundmode = BIFROST_RTP; + break; + case nir_op_ffloor: + alu.op.round = BI_ROUND_MODE; + alu.roundmode = BIFROST_RTN; + break; + case nir_op_ftrunc: + alu.op.round = BI_ROUND_MODE; + alu.roundmode = BIFROST_RTZ; + break; default: break; } |