}
static void
-fetch_source_d(const struct tgsi_exec_machine *mach,
- union tgsi_exec_channel *chan,
- const struct tgsi_full_src_register *reg,
- const uint chan_index)
+get_index_registers(const struct tgsi_exec_machine *mach,
+ const struct tgsi_full_src_register *reg,
+ union tgsi_exec_channel *index,
+ union tgsi_exec_channel *index2D)
{
- union tgsi_exec_channel index;
- union tgsi_exec_channel index2D;
uint swizzle;
/* We start with a direct index into a register file.
* file = Register.File
* [1] = Register.Index
*/
- index.i[0] =
- index.i[1] =
- index.i[2] =
- index.i[3] = reg->Register.Index;
+ index->i[0] =
+ index->i[1] =
+ index->i[2] =
+ index->i[3] = reg->Register.Index;
/* There is an extra source register that indirectly subscripts
* a register file. The direct index now becomes an offset
&indir_index);
/* add value of address register to the offset */
- index.i[0] += indir_index.i[0];
- index.i[1] += indir_index.i[1];
- index.i[2] += indir_index.i[2];
- index.i[3] += indir_index.i[3];
+ index->i[0] += indir_index.i[0];
+ index->i[1] += indir_index.i[1];
+ index->i[2] += indir_index.i[2];
+ index->i[3] += indir_index.i[3];
/* for disabled execution channels, zero-out the index to
* avoid using a potential garbage value.
*/
for (i = 0; i < TGSI_QUAD_SIZE; i++) {
if ((execmask & (1 << i)) == 0)
- index.i[i] = 0;
+ index->i[i] = 0;
}
}
* [3] = Dimension.Index
*/
if (reg->Register.Dimension) {
- index2D.i[0] =
- index2D.i[1] =
- index2D.i[2] =
- index2D.i[3] = reg->Dimension.Index;
+ index2D->i[0] =
+ index2D->i[1] =
+ index2D->i[2] =
+ index2D->i[3] = reg->Dimension.Index;
/* Again, the second subscript index can be addressed indirectly
* identically to the first one.
&ZeroVec,
&indir_index);
- index2D.i[0] += indir_index.i[0];
- index2D.i[1] += indir_index.i[1];
- index2D.i[2] += indir_index.i[2];
- index2D.i[3] += indir_index.i[3];
+ index2D->i[0] += indir_index.i[0];
+ index2D->i[1] += indir_index.i[1];
+ index2D->i[2] += indir_index.i[2];
+ index2D->i[3] += indir_index.i[3];
/* for disabled execution channels, zero-out the index to
* avoid using a potential garbage value.
*/
for (i = 0; i < TGSI_QUAD_SIZE; i++) {
if ((execmask & (1 << i)) == 0) {
- index2D.i[i] = 0;
+ index2D->i[i] = 0;
}
}
}
* by a dimension register and continue the saga.
*/
} else {
- index2D.i[0] =
- index2D.i[1] =
- index2D.i[2] =
- index2D.i[3] = 0;
+ index2D->i[0] =
+ index2D->i[1] =
+ index2D->i[2] =
+ index2D->i[3] = 0;
}
+}
+
+
+static void
+fetch_source_d(const struct tgsi_exec_machine *mach,
+ union tgsi_exec_channel *chan,
+ const struct tgsi_full_src_register *reg,
+ const uint chan_index)
+{
+ union tgsi_exec_channel index;
+ union tgsi_exec_channel index2D;
+ uint swizzle;
+
+ get_index_registers(mach, reg, &index, &index2D);
+
swizzle = tgsi_util_get_full_src_register_swizzle( reg, chan_index );
fetch_src_file_channel(mach,