summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-07-21 08:18:56 -0600
committerBrian Paul <[email protected]>2010-07-21 10:16:31 -0600
commit695814a15b4d64e1fa829d51f18c4089837929c3 (patch)
treed30ff306a839b819ac1e18058ba0f308d4cdcc35 /src/gallium/auxiliary
parent6921a6dd4ed2df2e4b635b329f66b1664a092923 (diff)
gallivm: re-org, comments for get_temp_ptr()
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 994bc537ce8..4e640f5903c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -405,6 +405,15 @@ static void lp_exec_mask_endsub(struct lp_exec_mask *mask, int *pc)
lp_exec_mask_update(mask);
}
+
+/**
+ * Return pointer to a temporary register channel (src or dest).
+ * \param index which temporary register
+ * \param chan which channel of the temp register.
+ * \param is_indirect if true, add 'addr' to the index
+ * \param addr indirect addressing offset (should already have been
+ * multiplied by four).
+ */
static LLVMValueRef
get_temp_ptr(struct lp_build_tgsi_soa_context *bld,
unsigned index,
@@ -413,15 +422,16 @@ get_temp_ptr(struct lp_build_tgsi_soa_context *bld,
LLVMValueRef addr)
{
assert(chan < 4);
- if (!bld->has_indirect_addressing) {
- return bld->temps[index][chan];
- } else {
+ if (bld->has_indirect_addressing) {
LLVMValueRef lindex =
LLVMConstInt(LLVMInt32Type(), index * 4 + chan, 0);
if (is_indirect)
lindex = lp_build_add(&bld->base, lindex, addr);
return LLVMBuildGEP(bld->base.builder, bld->temps_array, &lindex, 1, "");
}
+ else {
+ return bld->temps[index][chan];
+ }
}