Mesa (master): gallivm: add float to 8/16 int

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Nov 15 21:13:06 UTC 2020


Module: Mesa
Branch: master
Commit: 53064ce6b5f277364b29e4b6f206cfcb4fc717a4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53064ce6b5f277364b29e4b6f206cfcb4fc717a4

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Oct 26 13:54:48 2020 +1000

gallivm: add float to 8/16 int

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7595>

---

 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 915c9d96919..db098a8c2c9 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],



More information about the mesa-commit mailing list