diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-04-14 16:21:14 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-04-17 16:25:36 -0400 |
commit | b7dd5b579dadb02715029b47b284fb2979fa71c8 (patch) | |
tree | 31e99ee50d983558530c77cefd5c07d1d70b7e80 /src | |
parent | 1e3960a7256cc0bd3cf8d46d9f945372d86e0d7a (diff) |
pan/bit: _MSCALE interp
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/bifrost/test/bi_interpret.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/test/bi_interpret.c b/src/panfrost/bifrost/test/bi_interpret.c index eca42292c60..9e88795b324 100644 --- a/src/panfrost/bifrost/test/bi_interpret.c +++ b/src/panfrost/bifrost/test/bi_interpret.c @@ -548,6 +548,17 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA) unreachable("Unsupported op"); } + /* Apply _MSCALE */ + if ((ins->type == BI_FMA || ins->type == BI_ADD) && ins->op.mscale) { + unsigned idx = (ins->type == BI_FMA) ? 3 : 2; + + assert(ins->src_types[idx] == nir_type_int32); + assert(ins->dest_type == nir_type_float32); + + int32_t scale = srcs[idx].i32; + dest.f32 *= exp2f(scale); + } + /* Apply outmod */ if (bi_has_outmod(ins) && ins->outmod != BIFROST_NONE) { if (ins->dest_type == nir_type_float16) { |