summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2021-04-12 16:20:06 +0200
committerDylan Baker <dylan.c.baker@intel.com>2021-04-21 09:53:37 -0700
commit9785e6c268950db9ee50074e3c64761c685a544f (patch)
treea1ffcaa3aa1cd939980454f4c7b5a44e08b45a73
parent548a050aea52bae1f3ec9903c8f893e597371099 (diff)
gallivm: handle 16-bit input in i2b32
Fixes: dac8cb981f4 ("gallivm/nir: allow 8/16-bit conversion and comparison.") Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185> (cherry picked from commit da5f346e6c63a17352ed8aacd6b1c182a1a9971d)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_nir.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 0dbf24cefbd..a3172b42211 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -229,7 +229,7 @@
"description": "gallivm: handle 16-bit input in i2b32",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "dac8cb981f4f2951a14e16851d59fb8d49a3e19b"
},
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index 4ab8d5bf956..a909b862683 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -212,7 +212,9 @@ static LLVMValueRef int_to_bool32(struct lp_build_nir_context *bld_base,
LLVMBuilderRef builder = bld_base->base.gallivm->builder;
struct lp_build_context *int_bld = get_int_bld(bld_base, is_unsigned, src_bit_size);
LLVMValueRef result = lp_build_compare(bld_base->base.gallivm, int_bld->type, PIPE_FUNC_NOTEQUAL, val, int_bld->zero);
- if (src_bit_size == 64)
+ if (src_bit_size == 16)
+ result = LLVMBuildSExt(builder, result, bld_base->int_bld.vec_type, "");
+ else if (src_bit_size == 64)
result = LLVMBuildTrunc(builder, result, bld_base->int_bld.vec_type, "");
return result;
}