tgis: SSE code generator doesn't yet support indirect addressing of temp regs
authorBrian Paul <brianp@vmware.com>
Fri, 24 Apr 2009 23:08:59 +0000 (17:08 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 24 Apr 2009 23:18:02 +0000 (17:18 -0600)
Fall back to interpreter in this case.

src/gallium/auxiliary/tgsi/tgsi_sse2.c

index 4b4e34b29eb221a8ee70b1d49ee30ded9e12bdde..ba2bfdef0627a3b82ddfc5a5936c34d83dd2164d 100644 (file)
@@ -1466,6 +1466,31 @@ emit_cmp(
    }
 }
 
+
+/**
+ * Check if inst src/dest regs use indirect addressing into temporary
+ * register file.
+ */
+static boolean
+indirect_temp_reference(const struct tgsi_full_instruction *inst)
+{
+   uint i;
+   for (i = 0; i < inst->Instruction.NumSrcRegs; i++) {
+      const struct tgsi_full_src_register *reg = &inst->FullSrcRegisters[i];
+      if (reg->SrcRegister.File == TGSI_FILE_TEMPORARY &&
+          reg->SrcRegister.Indirect)
+         return TRUE;
+   }
+   for (i = 0; i < inst->Instruction.NumDstRegs; i++) {
+      const struct tgsi_full_dst_register *reg = &inst->FullDstRegisters[i];
+      if (reg->DstRegister.File == TGSI_FILE_TEMPORARY &&
+          reg->DstRegister.Indirect)
+         return TRUE;
+   }
+   return FALSE;
+}
+
+
 static int
 emit_instruction(
    struct x86_function *func,
@@ -1473,6 +1498,10 @@ emit_instruction(
 {
    unsigned chan_index;
 
+   /* we can't handle indirect addressing into temp register file yet */
+   if (indirect_temp_reference(inst))
+      return FALSE;
+
    switch (inst->Instruction.Opcode) {
    case TGSI_OPCODE_ARL:
       FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {