aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_flow.h
diff options
context:
space:
mode:
authorJames Benton <[email protected]>2012-04-19 13:02:57 +0100
committerJosé Fonseca <[email protected]>2012-05-02 10:12:48 +0100
commit630fa2688634365c03edf2a189cf9225899fbcc5 (patch)
treeb079dbed8cdd4f687c791e4796dc47ed16daf914 /src/gallium/auxiliary/gallivm/lp_bld_flow.h
parent83a02427e576a5126a618c13bc3e12ff2b4a3e0a (diff)
gallivm: llvm c-style for loops, allows us to create loops with conditions on entry, rather than condition check on loop
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_flow.h')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_flow.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_flow.h b/src/gallium/auxiliary/gallivm/lp_bld_flow.h
index 3cd5a9f42a5..0da849bfe0c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_flow.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_flow.h
@@ -131,6 +131,33 @@ lp_build_loop_end_cond(struct lp_build_loop_state *state,
LLVMIntPredicate cond);
+/**
+ * Implementation of simple C-style for loops
+ */
+struct lp_build_for_loop_state
+{
+ LLVMBasicBlockRef begin;
+ LLVMBasicBlockRef body;
+ LLVMBasicBlockRef exit;
+ LLVMValueRef counter_var;
+ LLVMValueRef counter;
+ LLVMValueRef step;
+ LLVMIntPredicate cond;
+ LLVMValueRef end;
+ struct gallivm_state *gallivm;
+};
+
+void
+lp_build_for_loop_begin(struct lp_build_for_loop_state *state,
+ struct gallivm_state *gallivm,
+ LLVMValueRef start,
+ LLVMIntPredicate llvm_cond,
+ LLVMValueRef end,
+ LLVMValueRef step);
+
+void
+lp_build_for_loop_end(struct lp_build_for_loop_state *state);
+
/**
* if/else/endif.