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 <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
This commit is contained in:
Alyssa Rosenzweig
2020-04-14 16:59:41 -04:00
parent 8890fa4050
commit 20f255b18e

View File

@@ -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;