aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/codegen/nv50_ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv50/codegen/nv50_ir.cpp')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir.cpp
index 1006985ab93..335e9e01e61 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir.cpp
@@ -658,6 +658,31 @@ Instruction::swapSources(int a, int b)
srcs[b].mod = m;
}
+// TODO: extend for delta < 0
+void
+Instruction::moveSources(int s, int delta)
+{
+ if (delta == 0)
+ return;
+ assert(delta > 0);
+
+ int k;
+ for (k = 0; srcExists(k); ++k) {
+ for (int i = 0; i < 2; ++i) {
+ if (src(k).indirect[i] >= s)
+ src(k).indirect[i] += delta;
+ }
+ }
+ if (predSrc >= s)
+ predSrc += delta;
+ if (flagsSrc >= s)
+ flagsSrc += delta;
+
+ --k;
+ for (int p = k + delta; k >= s; --k, --p)
+ setSrc(p, src(k));
+}
+
void
Instruction::takeExtraSources(int s, Value *values[3])
{