From 20f255b18e48f61a5a0b22041c7149225f3bed64 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 14 Apr 2020 16:59:41 -0400 Subject: [PATCH] pan/bit: Add fexp2_fast interp Kind of a hack and not at all how the h/w does it. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/test/bi_interpret.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/test/bi_interpret.c b/src/panfrost/bifrost/test/bi_interpret.c index 9e88795b324..1d7b51bba17 100644 --- a/src/panfrost/bifrost/test/bi_interpret.c +++ b/src/panfrost/bifrost/test/bi_interpret.c @@ -489,7 +489,14 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA) 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); + assert(ins->dest_type != nir_type_float64); + + if (ins->op.special == BI_SPECIAL_EXP2_LOW) { + assert(ins->dest_type == nir_type_float32); + dest.f32 = exp2f(srcs[1].f32); + break; + } + float Q = (ins->dest_type == nir_type_float16) ? bf(srcs[0].u16[ins->swizzle[0][0]]) : srcs[0].f32; -- 2.30.2