summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-09-01 20:01:50 -0700
committerMatt Turner <mattst88@gmail.com>2014-09-24 09:42:46 -0700
commit7119712f4582b387323ecfaf0227ed070328d9e8 (patch)
tree80c166f3568f5eef40a02d22fd8279fe38ef200a
parent235f451f7a11ea5dfa941dcb6f5fc628455e9249 (diff)
i965/cfg: Add macros to iterate through a block given a starting point.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_cfg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index 7985a9795ac..3819f1f3401 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -142,4 +142,14 @@ struct cfg_t {
__inst != __block->start->prev; \
__inst = (__type *)__inst->prev)
+#define foreach_inst_in_block_starting_from(__type, __scan_inst, __inst, __block) \
+ for (__type *__scan_inst = (__type *)__inst->next; \
+ __scan_inst != __block->end->next; \
+ __scan_inst = (__type *)__scan_inst->next)
+
+#define foreach_inst_in_block_reverse_starting_from(__type, __scan_inst, __inst, __block) \
+ for (__type *__scan_inst = (__type *)__inst->prev; \
+ __scan_inst != __block->start->prev; \
+ __scan_inst = (__type *)__scan_inst->prev)
+
#endif /* BRW_CFG_H */