From: Alyssa Rosenzweig Date: Tue, 14 Apr 2020 20:21:14 +0000 (-0400) Subject: pan/bit: _MSCALE interp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b7dd5b579dadb02715029b47b284fb2979fa71c8;p=mesa.git pan/bit: _MSCALE interp Signed-off-by: Alyssa Rosenzweig Part-of: --- 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) {