summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi/tgsi_dump.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2010-06-18 13:41:20 -0400
committerZack Rusin <zackr@vmware.com>2010-06-18 13:46:44 -0400
commit101f792a2af9c9a19a050afba8b60caa689466a5 (patch)
treed79405c3da0da947a90d70dc7670b03a9855b237 /src/gallium/auxiliary/tgsi/tgsi_dump.c
parent2b221e11da7a8bf759e3c359f22ba6f49d5f0997 (diff)
gallium: add a temporary array register file
like normal temporaries, but allows to define a number of distinct arrays, all of which make it explicit that they contain /indexable/ registers. as a side-effect we're adding support for multi-dimensional destination registers. The whole thing looks like this: DCL TEMPX[0][0..128] # 0 array with 128 registers ADD TEMPX[0][0], IN[0], IMM[0] ADD TEMPX[0][1], IN[0], IMM[0] ABS OUT[0], TEMPX[0][TEMP[0]]
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_dump.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_dump.c93
1 files changed, 44 insertions, 49 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index 82443d9611..9fcc28f4c9 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -102,7 +102,8 @@ static const char *file_names[TGSI_FILE_COUNT] =
"IMM",
"PRED",
"SV",
- "IMMX"
+ "IMMX",
+ "TEMPX"
};
static const char *interpolate_names[] =
@@ -192,20 +193,6 @@ static const char *fs_coord_pixel_center_names[] =
static void
-_dump_register_dst(
- struct dump_ctx *ctx,
- uint file,
- int index)
-{
- ENM( file, file_names );
-
- CHR( '[' );
- SID( index );
- CHR( ']' );
-}
-
-
-static void
_dump_register_src(
struct dump_ctx *ctx,
const struct tgsi_full_src_register *src )
@@ -251,30 +238,52 @@ _dump_register_src(
}
}
+
static void
-_dump_register_ind(
+_dump_register_dst(
struct dump_ctx *ctx,
- uint file,
- int index,
- uint ind_file,
- int ind_index,
- uint ind_swizzle )
+ const struct tgsi_full_dst_register *dst )
{
- ENM( file, file_names );
- CHR( '[' );
- ENM( ind_file, file_names );
- CHR( '[' );
- SID( ind_index );
- TXT( "]." );
- ENM( ind_swizzle, swizzle_names );
- if (index != 0) {
- if (index > 0)
- CHR( '+' );
- SID( index );
+ ENM(dst->Register.File, file_names);
+ if (dst->Register.Dimension) {
+ if (dst->Dimension.Indirect) {
+ CHR( '[' );
+ ENM( dst->DimIndirect.File, file_names );
+ CHR( '[' );
+ SID( dst->DimIndirect.Index );
+ TXT( "]." );
+ ENM( dst->DimIndirect.SwizzleX, swizzle_names );
+ if (dst->Dimension.Index != 0) {
+ if (dst->Dimension.Index > 0)
+ CHR( '+' );
+ SID( dst->Dimension.Index );
+ }
+ CHR( ']' );
+ } else {
+ CHR('[');
+ SID(dst->Dimension.Index);
+ CHR(']');
+ }
+ }
+ if (dst->Register.Indirect) {
+ CHR( '[' );
+ ENM( dst->Indirect.File, file_names );
+ CHR( '[' );
+ SID( dst->Indirect.Index );
+ TXT( "]." );
+ ENM( dst->Indirect.SwizzleX, swizzle_names );
+ if (dst->Register.Index != 0) {
+ if (dst->Register.Index > 0)
+ CHR( '+' );
+ SID( dst->Register.Index );
+ }
+ CHR( ']' );
+ } else {
+ CHR( '[' );
+ SID( dst->Register.Index );
+ CHR( ']' );
}
- CHR( ']' );
}
-
static void
_dump_writemask(
struct dump_ctx *ctx,
@@ -603,21 +612,7 @@ iter_instruction(
CHR( ',' );
CHR( ' ' );
- if (dst->Register.Indirect) {
- _dump_register_ind(
- ctx,
- dst->Register.File,
- dst->Register.Index,
- dst->Indirect.File,
- dst->Indirect.Index,
- dst->Indirect.SwizzleX );
- }
- else {
- _dump_register_dst(
- ctx,
- dst->Register.File,
- dst->Register.Index );
- }
+ _dump_register_dst( ctx, dst );
_dump_writemask( ctx, dst->Register.WriteMask );
first_reg = FALSE;