summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_asm.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-08-03 14:14:58 -0400
committerJerome Glisse <jglisse@redhat.com>2010-08-03 14:31:49 -0400
commit7e42b7e5d2aebcda0e6bf081b6661411731e6df2 (patch)
tree3f5d5fa8a22bc8a80511851d9232faa5411c7bd6 /src/gallium/drivers/r600/r600_asm.c
parent57438adf3217955f16491ef8deeffafe05c2f7f8 (diff)
r600g: fix LIT + fix multiple constant one ALU + fix ALU block splitting
Make sure LIT fills all slot for instruction (can't do W instruction without having the Z slot filled with at least a NOP). ALU instruction can't access more than 4 constant, move constant to temporary reg if we reach the limit. Fix ALU block splitting, only split ALU after ALU with last instruction bit sets. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_asm.c')
-rw-r--r--src/gallium/drivers/r600/r600_asm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 386adde6b8..f1dc3dc3a9 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -91,6 +91,7 @@ static int r600_bc_add_cf(struct r600_bc *bc)
bc->cf_last = cf;
bc->ncf++;
bc->ndw += 2;
+ bc->force_add_cf = 0;
return 0;
}
@@ -119,7 +120,7 @@ int r600_bc_add_alu(struct r600_bc *bc, const struct r600_bc_alu *alu)
/* cf can contains only alu or only vtx or only tex */
if (bc->cf_last == NULL || bc->cf_last->inst != (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU << 3) ||
- (bc->cf_last->ndw >> 1) >= 120) {
+ bc->force_add_cf) {
/* at most 128 slots, one add alu can add 4 slots + 4 constant worst case */
r = r600_bc_add_cf(bc);
if (r) {
@@ -128,6 +129,9 @@ int r600_bc_add_alu(struct r600_bc *bc, const struct r600_bc_alu *alu)
}
bc->cf_last->inst = V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU << 3;
}
+ if (alu->last && (bc->cf_last->ndw >> 1) >= 124) {
+ bc->force_add_cf = 1;
+ }
/* number of gpr == the last gpr used in any alu */
for (i = 0; i < 3; i++) {
if (alu->src[i].sel >= bc->ngpr && alu->src[i].sel < 128) {