From 1f440d00d2b6ae6f74fb850ea5acec1f1b5efa58 Mon Sep 17 00:00:00 2001 From: Jose Maria Casanova Crespo Date: Sat, 1 Jul 2017 07:58:26 +0200 Subject: nir: Handle fp16 rounding modes at nir_type_conversion_op nir_type_conversion enables new operations to handle rounding modes to convert to fp16 values. Two new opcodes are enabled nir_op_f2f16_rtne and nir_op_f2f16_rtz. The undefined behaviour doesn't has any effect and uses the original nir_op_f2f16 operation. v2: Indentation fixed (Jason Ekstrand) v3: Use explicit case for undefined rounding and assert if rounding mode is used for non 16-bit float conversions (Jason Ekstrand) Reviewed-by: Jason Ekstrand --- src/compiler/spirv/vtn_alu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compiler/spirv/vtn_alu.c') diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c index 7653b8acfa1..fa4dbfecddd 100644 --- a/src/compiler/spirv/vtn_alu.c +++ b/src/compiler/spirv/vtn_alu.c @@ -356,7 +356,7 @@ vtn_nir_alu_op_for_spirv_opcode(struct vtn_builder *b, case SpvOpConvertUToF: case SpvOpSConvert: case SpvOpFConvert: - return nir_type_conversion_op(src, dst); + return nir_type_conversion_op(src, dst, nir_rounding_mode_undef); /* Derivatives: */ case SpvOpDPdx: return nir_op_fddx; -- cgit v1.2.3