diff --git a/src/.clang-format b/src/.clang-format index e46e9938549..1cfe795befe 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -229,6 +229,8 @@ ForEachMacros: - agx_foreach_ssa_dest_rev - agx_foreach_ssa_src - agx_foreach_ssa_src_rev + - agx_foreach_reg_src + - agx_foreach_reg_dest - agx_foreach_successor - foreach_next_use - libagx_foreach_xfb diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index 9fdaa15d1a1..2bdf1e64ce5 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -728,6 +728,10 @@ void agx_block_add_successor(agx_block *block, agx_block *successor); agx_foreach_src_rev(ins, v) \ if (ins->src[v].type == AGX_INDEX_NORMAL) +#define agx_foreach_reg_src(ins, v) \ + agx_foreach_src(ins, v) \ + if (ins->src[v].type == AGX_INDEX_REGISTER) + #define agx_foreach_ssa_dest(ins, v) \ agx_foreach_dest(ins, v) \ if (ins->dest[v].type == AGX_INDEX_NORMAL) @@ -736,6 +740,10 @@ void agx_block_add_successor(agx_block *block, agx_block *successor); agx_foreach_dest_rev(ins, v) \ if (ins->dest[v].type == AGX_INDEX_NORMAL) +#define agx_foreach_reg_dest(ins, v) \ + agx_foreach_dest(ins, v) \ + if (ins->dest[v].type == AGX_INDEX_REGISTER) + /* Phis only come at the start (after else instructions) so we stop as soon as * we hit a non-phi */