summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-06-10 10:55:59 +1000
committerDave Airlie <[email protected]>2016-06-11 06:44:17 +1000
commite5c57824ec4021a859f5cbd4feba148d068713ee (patch)
treed3fa685ba5638db70e457d898da8d228b312e382 /src/gallium/auxiliary/gallivm
parent3b97e50b9a3e413aca24edbaa3fd4a86dd216faf (diff)
gallivm: make non-float return code bitcast consistent.
This just uses the same form across the fetches. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 8759392ac15..e3a2c4b215d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1403,12 +1403,9 @@ emit_fetch_immediate(
res = emit_fetch_64bit(bld_base, stype, res, bld->immediates[reg->Register.Index][swizzle + 1]);
}
- if (stype == TGSI_TYPE_UNSIGNED) {
- res = LLVMBuildBitCast(builder, res, bld_base->uint_bld.vec_type, "");
- } else if (stype == TGSI_TYPE_SIGNED) {
- res = LLVMBuildBitCast(builder, res, bld_base->int_bld.vec_type, "");
- } else if (stype == TGSI_TYPE_DOUBLE) {
- res = LLVMBuildBitCast(builder, res, bld_base->dbl_bld.vec_type, "");
+ if (stype == TGSI_TYPE_SIGNED || stype == TGSI_TYPE_UNSIGNED || stype == TGSI_TYPE_DOUBLE) {
+ struct lp_build_context *bld_fetch = stype_to_fetch(bld_base, stype);
+ res = LLVMBuildBitCast(builder, res, bld_fetch->vec_type, "");
}
return res;
}
@@ -1483,12 +1480,9 @@ emit_fetch_input(
assert(res);
- if (stype == TGSI_TYPE_UNSIGNED) {
- res = LLVMBuildBitCast(builder, res, bld_base->uint_bld.vec_type, "");
- } else if (stype == TGSI_TYPE_SIGNED) {
- res = LLVMBuildBitCast(builder, res, bld_base->int_bld.vec_type, "");
- } else if (stype == TGSI_TYPE_DOUBLE) {
- res = LLVMBuildBitCast(builder, res, bld_base->dbl_bld.vec_type, "");
+ if (stype == TGSI_TYPE_SIGNED || stype == TGSI_TYPE_UNSIGNED || stype == TGSI_TYPE_DOUBLE) {
+ struct lp_build_context *bld_fetch = stype_to_fetch(bld_base, stype);
+ res = LLVMBuildBitCast(builder, res, bld_fetch->vec_type, "");
}
return res;