summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2013-02-28 19:00:02 +0100
committerChristoph Bumiller <[email protected]>2013-03-12 12:55:36 +0100
commitb23ec3f8ba1230679d0188e5bf00270bf238b826 (patch)
tree733821dad1cdcdf30bf0b9c579d11e280bbbc6e4 /src/gallium/drivers
parentd39169cb6dd25f92e62254aa3920c2add2b3ca25 (diff)
nv50/ir: fix size adjustment for sched info for multiple functions
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_target.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_target.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_target.cpp
index 92552a0efe5..1b6d1830ee5 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_target.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_target.cpp
@@ -197,18 +197,23 @@ CodeEmitter::prepareEmission(Program *prog)
// adjust sizes & positions for schedulding info:
if (prog->getTarget()->hasSWSched) {
+ uint32_t adjPos = func->binPos;
BasicBlock *bb = NULL;
for (int i = 0; i < func->bbCount; ++i) {
bb = func->bbArray[i];
- const uint32_t oldPos = bb->binPos;
- const uint32_t oldEnd = bb->binPos + bb->binSize;
- uint32_t adjPos = oldPos + sizeToBundlesNVE4(oldPos) * 8;
- uint32_t adjEnd = oldEnd + sizeToBundlesNVE4(oldEnd) * 8;
+ int32_t adjSize = bb->binSize;
+ if (adjPos % 64) {
+ adjSize -= 64 - adjPos % 64;
+ if (adjSize < 0)
+ adjSize = 0;
+ }
+ adjSize = bb->binSize + sizeToBundlesNVE4(adjSize) * 8;
bb->binPos = adjPos;
- bb->binSize = adjEnd - adjPos;
+ bb->binSize = adjSize;
+ adjPos += adjSize;
}
if (bb)
- func->binSize = bb->binPos + bb->binSize;
+ func->binSize = adjPos - func->binPos;
}
prog->binSize += func->binSize;