Mesa (master): i965/cfg: Add macros to iterate through a block given a starting point.
Matt Turner
mattst88 at kemper.freedesktop.org
Wed Sep 24 16:51:02 UTC 2014
Module: Mesa
Branch: master
Commit: 7119712f4582b387323ecfaf0227ed070328d9e8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7119712f4582b387323ecfaf0227ed070328d9e8
Author: Matt Turner <mattst88 at gmail.com>
Date: Mon Sep 1 20:01:50 2014 -0700
i965/cfg: Add macros to iterate through a block given a starting point.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/mesa/drivers/dri/i965/brw_cfg.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index 7985a97..3819f1f 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 */
More information about the mesa-commit
mailing list