From c2fa965cc34668bba2256dbe2a01ff9e8e91b3f3 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 6 Jan 2021 08:51:18 +0100 Subject: [PATCH] microsoft/compiler: correct dxil fma opcode When I originally added the FFMA opcode here, I added the FMAD opcode instead of the FMA opcode. The reason for this is that it works on 32-bit values as well, so that seemed like a better fit. But that's not correct, as the FMA opcode isn't a fused operation, so let's correct the opcode. This isn't currently in use, because we currently lower away all ffma opcodes on the NIR level, but that's about to change. While we're at it, let's also update the opcode name to match the DXIL documentation. Reviewed-by: Jesse Natalie Part-of: --- src/microsoft/compiler/nir_to_dxil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index e59b1b35287..e7a53d8398b 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -207,7 +207,7 @@ enum dxil_intr { DXIL_INTR_UMAX = 39, DXIL_INTR_UMIN = 40, - DXIL_INTR_FFMA = 46, + DXIL_INTR_FMA = 47, DXIL_INTR_CREATE_HANDLE = 57, DXIL_INTR_CBUFFER_LOAD_LEGACY = 59, @@ -1956,7 +1956,7 @@ emit_alu(struct ntd_context *ctx, nir_alu_instr *alu) case nir_op_fsqrt: return emit_unary_intin(ctx, alu, DXIL_INTR_SQRT, src[0]); case nir_op_fmax: return emit_binary_intin(ctx, alu, DXIL_INTR_FMAX, src[0], src[1]); case nir_op_fmin: return emit_binary_intin(ctx, alu, DXIL_INTR_FMIN, src[0], src[1]); - case nir_op_ffma: return emit_tertiary_intin(ctx, alu, DXIL_INTR_FFMA, src[0], src[1], src[2]); + case nir_op_ffma: return emit_tertiary_intin(ctx, alu, DXIL_INTR_FMA, src[0], src[1], src[2]); case nir_op_unpack_half_2x16_split_x: return emit_f16tof32(ctx, alu, src[0]); case nir_op_pack_half_2x16_split: return emit_f32tof16(ctx, alu, src[0]);