summaryrefslogtreecommitdiff
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-08-26 15:11:26 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-09-03 11:55:21 -0700
commit3b85f1cc6cb12e9d4931e12cf29adde578f389fd (patch)
tree53c6e568c2d8ba880fda98df58684ae7653bb577 /src/glsl/ir.h
parentc8ee8e07f7cc8f18d367ffcec065b45f8a6976f4 (diff)
glsl2: Add cmp field to ir_loop
This reprents the type of comparison between the loop induction variable and the loop termination value.
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 0f887a9327..cf3a882f07 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -461,10 +461,7 @@ public:
*/
class ir_loop : public ir_instruction {
public:
- ir_loop() : from(NULL), to(NULL), increment(NULL), counter(NULL)
- {
- ir_type = ir_type_loop;
- }
+ ir_loop();
virtual ir_loop *clone(void *mem_ctx, struct hash_table *ht) const;
@@ -493,12 +490,30 @@ public:
/**
* \name Loop counter and controls
+ *
+ * Represents a loop like a FORTRAN \c do-loop.
+ *
+ * \note
+ * If \c from and \c to are the same value, the loop will execute once.
*/
/*@{*/
- ir_rvalue *from;
- ir_rvalue *to;
+ ir_rvalue *from; /** Value of the loop counter on the first
+ * iteration of the loop.
+ */
+ ir_rvalue *to; /** Value of the loop counter on the last
+ * iteration of the loop.
+ */
ir_rvalue *increment;
ir_variable *counter;
+
+ /**
+ * Comparison operation in the loop terminator.
+ *
+ * If any of the loop control fields are non-\c NULL, this field must be
+ * one of \c ir_binop_less, \c ir_binop_greater, \c ir_binop_lequal,
+ * \c ir_binop_gequal, \c ir_binop_equal, or \c ir_binop_nequal.
+ */
+ int cmp;
/*@}*/
};