summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-06-05 18:39:00 +1000
committerBen Skeggs <[email protected]>2008-06-29 15:46:14 +1000
commit7df7f7bb99441ed8e2fba2840e0459e72691f272 (patch)
tree8bf5e8cf741d61b4b48ed3f6d8e60adb885fd85d /src/gallium/drivers/nv50
parent52a69196c1680ff16d1ad1fc88e5869bc6055d00 (diff)
nv50: big fuckup, fix it
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c75
1 files changed, 60 insertions, 15 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index afc911cd265..a293db6f723 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -556,20 +556,29 @@ nv50_program_tx_insn(struct nv50_pc *pc, const union tgsi_full_token *tok)
switch (inst->Instruction.Opcode) {
case TGSI_OPCODE_ADD:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_add(pc, dst[c], src[0][c], src[1][c]);
+ }
break;
case TGSI_OPCODE_COS:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_flop(pc, 5, dst[c], src[0][c]);
+ }
break;
case TGSI_OPCODE_DP3:
temp = alloc_temp(pc, NULL);
emit_mul(pc, temp, src[0][0], src[1][0]);
emit_mad(pc, temp, src[0][1], src[1][1], temp);
emit_mad(pc, temp, src[0][2], src[1][2], temp);
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_mov(pc, dst[c], temp);
+ }
free_temp(pc, temp);
break;
case TGSI_OPCODE_DP4:
@@ -578,53 +587,89 @@ nv50_program_tx_insn(struct nv50_pc *pc, const union tgsi_full_token *tok)
emit_mad(pc, temp, src[0][1], src[1][1], temp);
emit_mad(pc, temp, src[0][2], src[1][2], temp);
emit_mad(pc, temp, src[0][3], src[1][3], temp);
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_mov(pc, dst[c], temp);
+ }
free_temp(pc, temp);
break;
case TGSI_OPCODE_EX2:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_flop(pc, 6, dst[c], src[0][c]);
+ }
break;
case TGSI_OPCODE_LG2:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_flop(pc, 3, dst[c], src[0][c]);
+ }
break;
case TGSI_OPCODE_MAD:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_mad(pc, dst[c], src[0][c], src[1][c], src[2][c]);
+ }
break;
case TGSI_OPCODE_MAX:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_minmax(pc, 4, dst[c], src[0][c], src[1][c]);
+ }
break;
case TGSI_OPCODE_MIN:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_minmax(pc, 5, dst[c], src[0][c], src[1][c]);
+ }
break;
case TGSI_OPCODE_MOV:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_mov(pc, dst[c], src[0][c]);
+ }
break;
case TGSI_OPCODE_MUL:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_mul(pc, dst[c], src[0][c], src[1][c]);
+ }
break;
case TGSI_OPCODE_RCP:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_flop(pc, 0, dst[c], src[0][c]);
+ }
break;
case TGSI_OPCODE_RSQ:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_flop(pc, 2, dst[c], src[0][c]);
+ }
break;
case TGSI_OPCODE_SIN:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_flop(pc, 4, dst[c], src[0][c]);
+ }
break;
case TGSI_OPCODE_SUB:
- for (c = 0; c < 4; c++)
+ for (c = 0; c < 4; c++) {
+ if (!(mask & (1 << c)))
+ continue;
emit_sub(pc, dst[c], src[0][c], src[1][c]);
+ }
break;
case TGSI_OPCODE_END:
break;