aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_nir.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-12-10 14:47:07 +1000
committerDave Airlie <[email protected]>2019-12-27 13:22:43 +1000
commitdf3e0fe9d817a11c71b40ddaa5c56e4336611c84 (patch)
tree96dd02892854dd28eb1a41a7bb077528ab7d4a7b /src/gallium/auxiliary/gallivm/lp_bld_nir.c
parent258b9bc02eb7069a8f85cbf568e73c788da819a3 (diff)
gallivm: add support for 8-bit/16-bit integer builders
Acked-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_nir.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_nir.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index a3b57e86a6f..b04bba1a11c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -57,6 +57,10 @@ static LLVMValueRef cast_type(struct lp_build_nir_context *bld_base, LLVMValueRe
break;
case nir_type_int:
switch (bit_size) {
+ case 8:
+ return LLVMBuildBitCast(builder, val, bld_base->int8_bld.vec_type, "");
+ case 16:
+ return LLVMBuildBitCast(builder, val, bld_base->int16_bld.vec_type, "");
case 32:
return LLVMBuildBitCast(builder, val, bld_base->int_bld.vec_type, "");
case 64:
@@ -68,6 +72,10 @@ static LLVMValueRef cast_type(struct lp_build_nir_context *bld_base, LLVMValueRe
break;
case nir_type_uint:
switch (bit_size) {
+ case 8:
+ return LLVMBuildBitCast(builder, val, bld_base->uint8_bld.vec_type, "");
+ case 16:
+ return LLVMBuildBitCast(builder, val, bld_base->uint16_bld.vec_type, "");
case 32:
return LLVMBuildBitCast(builder, val, bld_base->uint_bld.vec_type, "");
case 64:
@@ -85,20 +93,6 @@ static LLVMValueRef cast_type(struct lp_build_nir_context *bld_base, LLVMValueRe
return NULL;
}
-static struct lp_build_context *get_int_bld(struct lp_build_nir_context *bld_base,
- bool is_unsigned,
- unsigned op_bit_size)
-{
- if (is_unsigned)
- if (op_bit_size == 64)
- return &bld_base->uint64_bld;
- else
- return &bld_base->uint_bld;
- else if (op_bit_size == 64)
- return &bld_base->int64_bld;
- else
- return &bld_base->int_bld;
-}
static struct lp_build_context *get_flt_bld(struct lp_build_nir_context *bld_base,
unsigned op_bit_size)