summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/exec/tgsi_exec.c34
-rwxr-xr-xsrc/gallium/auxiliary/tgsi/exec/tgsi_sse2.c18
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_dump.c68
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_dump.h4
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_parse.h2
5 files changed, 80 insertions, 46 deletions
diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c b/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
index f2ed9e0353..78e7dec569 100644
--- a/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
@@ -1516,11 +1516,41 @@ exec_instruction(
break;
case TGSI_OPCODE_EXP:
- assert (0);
+ debug_printf("TGSI: EXP opcode not implemented\n");
+ /* from ARB_v_p:
+ tmp = ScalarLoad(op0);
+ result.x = 2^floor(tmp);
+ result.y = tmp - floor(tmp);
+ result.z = RoughApprox2ToX(tmp);
+ result.w = 1.0;
+ */
+#if 0
+ /* something like this: */
+ FETCH( &r[0], 0, CHAN_X );
+ micro_exp2( &r[0], &r[0] );
+ FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
+ STORE( &r[0], 0, chan_index );
+ }
+#endif
break;
case TGSI_OPCODE_LOG:
- assert (0);
+ debug_printf("TGSI: LOG opcode not implemented\n");
+ /* from ARB_v_p:
+ tmp = fabs(ScalarLoad(op0));
+ result.x = floor(log2(tmp));
+ result.y = tmp / 2^(floor(log2(tmp)));
+ result.z = RoughApproxLog2(tmp);
+ result.w = 1.0;
+ */
+#if 0
+ /* something like this: */
+ FETCH( &r[0], 0, CHAN_X );
+ micro_lg2( &r[0], &r[0] );
+ FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
+ STORE( &r[0], 0, chan_index );
+ }
+#endif
break;
case TGSI_OPCODE_MUL:
diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c
index 0da3b0bdb7..4e80597b3f 100755
--- a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c
+++ b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c
@@ -1821,7 +1821,11 @@ emit_instruction(
STORE( func, *inst, 5, 0, CHAN_Z );
}
IF_IS_DST0_CHANNEL_ENABLED( *inst, CHAN_W ) {
- FETCH( func, *inst, 0, TGSI_EXEC_TEMP_ONE_I, TGSI_EXEC_TEMP_ONE_C );
+ emit_tempf(
+ func,
+ 0,
+ TGSI_EXEC_TEMP_ONE_I,
+ TGSI_EXEC_TEMP_ONE_C );
STORE( func, *inst, 0, 0, CHAN_W );
}
break;
@@ -2021,11 +2025,19 @@ emit_instruction(
STORE( func, *inst, 0, 0, CHAN_Y );
}
IF_IS_DST0_CHANNEL_ENABLED( *inst, CHAN_Z ) {
- FETCH( func, *inst, 0, TGSI_EXEC_TEMP_00000000_I, TGSI_EXEC_TEMP_00000000_C );
+ emit_tempf(
+ func,
+ 0,
+ TGSI_EXEC_TEMP_00000000_I,
+ TGSI_EXEC_TEMP_00000000_C );
STORE( func, *inst, 0, 0, CHAN_Z );
}
IF_IS_DST0_CHANNEL_ENABLED( *inst, CHAN_W ) {
- FETCH( func, *inst, 0, TGSI_EXEC_TEMP_ONE_I, TGSI_EXEC_TEMP_ONE_C );
+ emit_tempf(
+ func,
+ 0,
+ TGSI_EXEC_TEMP_ONE_I,
+ TGSI_EXEC_TEMP_ONE_C );
STORE( func, *inst, 0, 0, CHAN_W );
}
break;
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_dump.c b/src/gallium/auxiliary/tgsi/util/tgsi_dump.c
index ceb407b884..7d292778ad 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_dump.c
@@ -324,7 +324,7 @@ static const char *TGSI_IMMS_SHORT[] =
"FLT32"
};
-static const char *TGSI_OPCODES[] =
+static const char *TGSI_OPCODES[TGSI_OPCODE_LAST] =
{
"OPCODE_ARL",
"OPCODE_MOV",
@@ -380,6 +380,7 @@ static const char *TGSI_OPCODES[] =
"OPCODE_STR",
"OPCODE_TEX",
"OPCODE_TXD",
+ "OPCODE_TXP",
"OPCODE_UP2H",
"OPCODE_UP2US",
"OPCODE_UP4B",
@@ -433,23 +434,6 @@ static const char *TGSI_OPCODES[] =
"OPCODE_NOISE3",
"OPCODE_NOISE4",
"OPCODE_NOP",
- "OPCODE_TEXBEM",
- "OPCODE_TEXBEML",
- "OPCODE_TEXREG2AR",
- "OPCODE_TEXM3X2PAD",
- "OPCODE_TEXM3X2TEX",
- "OPCODE_TEXM3X3PAD",
- "OPCODE_TEXM3X3TEX",
- "OPCODE_TEXM3X3SPEC",
- "OPCODE_TEXM3X3VSPEC",
- "OPCODE_TEXREG2GB",
- "OPCODE_TEXREG2RGB",
- "OPCODE_TEXDP3TEX",
- "OPCODE_TEXDP3",
- "OPCODE_TEXM3X3",
- "OPCODE_TEXM3X2DEPTH",
- "OPCODE_TEXDEPTH",
- "OPCODE_BEM",
"OPCODE_M4X3",
"OPCODE_M3X4",
"OPCODE_M3X3",
@@ -459,11 +443,10 @@ static const char *TGSI_OPCODES[] =
"OPCODE_IFC",
"OPCODE_BREAKC",
"OPCODE_KIL",
- "OPCODE_END",
- "OPCODE_TXP"
+ "OPCODE_END"
};
-static const char *TGSI_OPCODES_SHORT[] =
+static const char *TGSI_OPCODES_SHORT[TGSI_OPCODE_LAST] =
{
"ARL",
"MOV",
@@ -519,6 +502,7 @@ static const char *TGSI_OPCODES_SHORT[] =
"STR",
"TEX",
"TXD",
+ "TXP",
"UP2H",
"UP2US",
"UP4B",
@@ -572,23 +556,6 @@ static const char *TGSI_OPCODES_SHORT[] =
"NOISE3",
"NOISE4",
"NOP",
- "TEXBEM",
- "TEXBEML",
- "TEXREG2AR",
- "TEXM3X2PAD",
- "TEXM3X2TEX",
- "TEXM3X3PAD",
- "TEXM3X3TEX",
- "TEXM3X3SPEC",
- "TEXM3X3VSPEC",
- "TEXREG2GB",
- "TEXREG2RGB",
- "TEXDP3TEX",
- "TEXDP3",
- "TEXM3X3",
- "TEXM3X2DEPTH",
- "TEXDEPTH",
- "BEM",
"M4X3",
"M3X4",
"M3X3",
@@ -598,8 +565,7 @@ static const char *TGSI_OPCODES_SHORT[] =
"IFC",
"BREAKC",
"KIL",
- "END",
- "TXP"
+ "END"
};
static const char *TGSI_SATS[] =
@@ -1597,3 +1563,25 @@ tgsi_dump_str(
*str = dump.text;
}
+
+
+void tgsi_debug_dump( struct tgsi_token *tokens )
+{
+ char *str, *p;
+
+ tgsi_dump_str( &str, tokens, 0 );
+
+ p = str;
+ while (p != NULL)
+ {
+ char *end = strchr( p, '\n' );
+ if (end != NULL)
+ {
+ *end++ = '\0';
+ }
+ debug_printf( "%s\n", p );
+ p = end;
+ }
+
+ FREE( str );
+}
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_dump.h b/src/gallium/auxiliary/tgsi/util/tgsi_dump.h
index b983b38226..51d79a0362 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_dump.h
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_dump.h
@@ -20,6 +20,10 @@ tgsi_dump_str(
const struct tgsi_token *tokens,
unsigned flags );
+/* Dump to debug_printf()
+ */
+void tgsi_debug_dump( struct tgsi_token *tokens );
+
#if defined __cplusplus
}
#endif
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_parse.h b/src/gallium/auxiliary/tgsi/util/tgsi_parse.h
index 5ccb5bfcf6..40083728d6 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_parse.h
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_parse.h
@@ -56,7 +56,7 @@ struct tgsi_full_immediate
};
#define TGSI_FULL_MAX_DST_REGISTERS 2
-#define TGSI_FULL_MAX_SRC_REGISTERS 3
+#define TGSI_FULL_MAX_SRC_REGISTERS 4 /* TXD has 4 */
struct tgsi_full_instruction
{