Mesa (master): i965/cfg: Add a foreach_block_and_inst macro.

Matt Turner mattst88 at kemper.freedesktop.org
Mon Jul 21 17:37:41 UTC 2014


Module: Mesa
Branch: master
Commit: dd65a6d9ada7cfa1b694d4211d8c95e446b29c62
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd65a6d9ada7cfa1b694d4211d8c95e446b29c62

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Jul 11 21:17:01 2014 -0700

i965/cfg: Add a foreach_block_and_inst macro.

Will let us abstract how the instructions are stored.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

---

 src/mesa/drivers/dri/i965/brw_cfg.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index cdbadde..01fcc1b 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -103,6 +103,10 @@ struct cfg_t {
    int num_blocks;
 };
 
+#define foreach_block_and_inst(__block, __type, __inst, __cfg) \
+   foreach_block (__block, __cfg)                              \
+      foreach_inst_in_block (__type, __inst, __block)
+
 #define foreach_inst_in_block(__type, __inst, __block)         \
    for (__type *__inst = (__type *)__block->start;             \
         __inst != __block->end->next;                          \




More information about the mesa-commit mailing list