From: Alyssa Rosenzweig Date: Tue, 14 Apr 2020 19:25:17 +0000 (-0400) Subject: pan/bit: Add log2 helper interp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93fffd8a11ae78bfcb67a8ff5c0cd7842cad885f;p=mesa.git pan/bit: Add log2 helper 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 92f5865e48b..eca42292c60 100644 --- a/src/panfrost/bifrost/test/bi_interpret.c +++ b/src/panfrost/bifrost/test/bi_interpret.c @@ -509,6 +509,19 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA) break; } + case BI_TABLE: { + if (ins->op.table == BI_TABLE_LOG2_U_OVER_U_1_LOW) { + assert(ins->dest_type == nir_type_float32); + int _nop = 0; + float f = frexp_log(srcs[0].f32, &_nop); + dest.f32 = log2f(f) / (f - 1.0); + dest.u32++; /* Sorry. */ + } else { + unreachable("Unknown table op"); + } + break; + } + case BI_SHIFT: case BI_SWIZZLE: case BI_ROUND: