From 109d56f61220c153bf0f2a2b2d89f9c0ae045082 Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Thu, 8 Sep 2022 02:25:10 +0200 Subject: [PATCH] nv50/ir/nir: convert 8/16 bit src to 32 bit for {i,u}2f64 Converting signed and unsigned integers from 8/16 bit sources to a 64 bit floating point destination (i2f64 / u2f64) isn't possible, hence convert the source to 32 bit first. Reviewed-by: Karol Herbst Signed-off-by: Danilo Krummrich Part-of: --- src/nouveau/codegen/nv50_ir_from_nir.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nouveau/codegen/nv50_ir_from_nir.cpp b/src/nouveau/codegen/nv50_ir_from_nir.cpp index 523ae0124e1..9aa7ce3827a 100644 --- a/src/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/nouveau/codegen/nv50_ir_from_nir.cpp @@ -3291,6 +3291,15 @@ Converter::lowerBitSizeCB(const nir_instr *instr, void *data) return 0; } + case nir_op_i2f64: + case nir_op_u2f64: { + DataType stype = instance->getSTypes(alu)[0]; + + if (isIntType(stype) && (typeSizeof(stype) <= 2)) + return 32; + + return 0; + } default: return 0; }