summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-08-15 18:19:27 +0000
committerTom Stellard <[email protected]>2012-08-15 18:35:25 +0000
commita76a0f74225802f4d3f11028ab54afe98b26302b (patch)
tree79a16bb4f7ac53de6bc6f092fc56cd6c914ec544
parent97b4b97b2f9b0e4532c8ba9cedfff9f013a76fc2 (diff)
radeon/llvm: Force VTX_READ instructions to use same reg for src and dst
I was seeing some GPU hangs that seemed to be cause by ALU instructions writing to the same register used as the source for VTX_READ. Adding this constraint to the VTX_READ instructions avoids this situation.
-rw-r--r--src/gallium/drivers/radeon/R600Instructions.td14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/R600Instructions.td b/src/gallium/drivers/radeon/R600Instructions.td
index c96bc40eaf6..bb65c177f55 100644
--- a/src/gallium/drivers/radeon/R600Instructions.td
+++ b/src/gallium/drivers/radeon/R600Instructions.td
@@ -978,6 +978,15 @@ class VTX_READ_32_eg <bits<8> buffer_id, list<dag> pattern>
let DST_SEL_Z = 7; // Masked
let DST_SEL_W = 7; // Masked
let DATA_FORMAT = 0xD; // COLOR_32
+
+ // This is not really necessary, but there were some GPU hangs that appeared
+ // to be caused by ALU instructions in the next instruction group that wrote
+ // to the $ptr registers of the VTX_READ.
+ // e.g.
+ // %T3_X<def> = VTX_READ_PARAM_i32_eg %T2_X<kill>, 24
+ // %T2_X<def> = MOV %ZERO
+ //Adding this constraint prevents this from happening.
+ let Constraints = "$ptr.ptr = $dst";
}
class VTX_READ_128_eg <bits<8> buffer_id, list<dag> pattern>
@@ -989,6 +998,11 @@ class VTX_READ_128_eg <bits<8> buffer_id, list<dag> pattern>
let DST_SEL_Z = 2;
let DST_SEL_W = 3;
let DATA_FORMAT = 0x22; // COLOR_32_32_32_32
+
+ // XXX: Need to force VTX_READ_128 instructions to write to the same register
+ // that holds its buffer address to avoid potential hangs. We can't use
+ // the same constraint as VTX_READ_32_eg, because the $ptr.ptr and $dst
+ // registers are different sizes.
}
//===----------------------------------------------------------------------===//