diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-04-14 13:14:51 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-04-17 16:25:36 -0400 |
commit | 5546d1958b78ba9d933606960a888b62edbf8d01 (patch) | |
tree | b459a96c7978b019249c4890b0e868025804480d /src/panfrost | |
parent | 68b4e708f14d116518edc55017dcb8da539328fd (diff) |
pan/bit: Add BI_REDUCE_FMA interp
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/bifrost/test/bi_interpret.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/test/bi_interpret.c b/src/panfrost/bifrost/test/bi_interpret.c index 53c3d983eb1..92f5865e48b 100644 --- a/src/panfrost/bifrost/test/bi_interpret.c +++ b/src/panfrost/bifrost/test/bi_interpret.c @@ -472,6 +472,21 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA) case BI_MOV: bpoly(mov); + case BI_REDUCE_FMA: { + if (ins->src_types[0] != nir_type_float32) + unreachable("Unknown reduce type"); + + if (ins->op.reduce == BI_REDUCE_ADD_FREXPM) { + int _nop = 0; + float f = frexp_log(srcs[1].f32, &_nop); + dest.f32 = srcs[0].f32 + f; + } else { + unreachable("Unknown reduce"); + } + + break; + } + case BI_SPECIAL: { assert(nir_alu_type_get_base_type(ins->dest_type) == nir_type_float); assert(nir_alu_type_get_base_type(ins->dest_type) != nir_type_float64); |