From 53064ce6b5f277364b29e4b6f206cfcb4fc717a4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 26 Oct 2020 13:54:48 +1000 Subject: [PATCH] gallivm: add float to 8/16 int Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_nir.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 915c9d9..db098a8 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -579,9 +579,29 @@ static LLVMValueRef do_alu_action(struct lp_build_nir_context *bld_base, result = LLVMBuildFPExt(builder, src[0], bld_base->dbl_bld.vec_type, ""); break; + case nir_op_f2i8: + result = LLVMBuildFPToSI(builder, + src[0], + bld_base->uint8_bld.vec_type, ""); + break; + case nir_op_f2i16: + result = LLVMBuildFPToSI(builder, + src[0], + bld_base->uint16_bld.vec_type, ""); + break; case nir_op_f2i32: result = LLVMBuildFPToSI(builder, src[0], bld_base->base.int_vec_type, ""); break; + case nir_op_f2u8: + result = LLVMBuildFPToUI(builder, + src[0], + bld_base->uint8_bld.vec_type, ""); + break; + case nir_op_f2u16: + result = LLVMBuildFPToUI(builder, + src[0], + bld_base->uint16_bld.vec_type, ""); + break; case nir_op_f2u32: result = LLVMBuildFPToUI(builder, src[0], -- 2.7.4