microsoft/compiler: Handle b2f64

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
This commit is contained in:
Jesse Natalie 2022-01-28 15:11:42 -08:00 committed by Marge Bot
parent 4d17393ba0
commit b24cfd0d40
1 changed files with 18 additions and 0 deletions

View File

@ -2111,6 +2111,23 @@ emit_b2f32(struct ntd_context *ctx, nir_alu_instr *alu, const struct dxil_value
return emit_select(ctx, alu, val, c1, c0);
}
static bool
emit_b2f64(struct ntd_context *ctx, nir_alu_instr *alu, const struct dxil_value *val)
{
assert(val);
struct dxil_module *m = &ctx->mod;
const struct dxil_value *c1 = dxil_module_get_double_const(m, 1.0);
const struct dxil_value *c0 = dxil_module_get_double_const(m, 0.0);
if (!c0 || !c1)
return false;
ctx->mod.feats.doubles = 1;
return emit_select(ctx, alu, val, c1, c0);
}
static bool
emit_f2b32(struct ntd_context *ctx, nir_alu_instr *alu, const struct dxil_value *val)
{
@ -2431,6 +2448,7 @@ emit_alu(struct ntd_context *ctx, nir_alu_instr *alu)
case nir_op_f2b32: return emit_f2b32(ctx, alu, src[0]);
case nir_op_b2f16: return emit_b2f16(ctx, alu, src[0]);
case nir_op_b2f32: return emit_b2f32(ctx, alu, src[0]);
case nir_op_b2f64: return emit_b2f64(ctx, alu, src[0]);
default:
NIR_INSTR_UNSUPPORTED(&alu->instr);
assert("Unimplemented ALU instruction");