summaryrefslogtreecommitdiffstats
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/tgsi_build.c4
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_dump.c11
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c51
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_lowering.c3
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_text.c12
5 files changed, 13 insertions, 68 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c
index 39a4296a3a1..fdb7febf7ea 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.c
@@ -610,7 +610,7 @@ tgsi_default_instruction( void )
instruction.Type = TGSI_TOKEN_TYPE_INSTRUCTION;
instruction.NrTokens = 0;
instruction.Opcode = TGSI_OPCODE_MOV;
- instruction.Saturate = TGSI_SAT_NONE;
+ instruction.Saturate = 0;
instruction.Predicate = 0;
instruction.NumDstRegs = 1;
instruction.NumSrcRegs = 1;
@@ -632,7 +632,7 @@ tgsi_build_instruction(unsigned opcode,
struct tgsi_instruction instruction;
assert (opcode <= TGSI_OPCODE_LAST);
- assert (saturate <= TGSI_SAT_MINUS_PLUS_ONE);
+ assert (saturate <= 1);
assert (num_dst_regs <= 3);
assert (num_src_regs <= 15);
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index 27d410853bf..c584c2b0001 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -539,17 +539,8 @@ iter_instruction(
TXT( info->mnemonic );
- switch (inst->Instruction.Saturate) {
- case TGSI_SAT_NONE:
- break;
- case TGSI_SAT_ZERO_ONE:
+ if (inst->Instruction.Saturate) {
TXT( "_SAT" );
- break;
- case TGSI_SAT_MINUS_PLUS_ONE:
- TXT( "_SATNV" );
- break;
- default:
- assert( 0 );
}
for (i = 0; i < inst->Instruction.NumDstRegs; i++) {
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 6512e80ba2e..a098a82be63 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1765,14 +1765,12 @@ store_dest(struct tgsi_exec_machine *mach,
if (!dst)
return;
- switch (inst->Instruction.Saturate) {
- case TGSI_SAT_NONE:
+ if (!inst->Instruction.Saturate) {
for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i))
dst->i[i] = chan->i[i];
- break;
-
- case TGSI_SAT_ZERO_ONE:
+ }
+ else {
for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i)) {
if (chan->f[i] < 0.0f)
@@ -1782,22 +1780,6 @@ store_dest(struct tgsi_exec_machine *mach,
else
dst->i[i] = chan->i[i];
}
- break;
-
- case TGSI_SAT_MINUS_PLUS_ONE:
- for (i = 0; i < TGSI_QUAD_SIZE; i++)
- if (execmask & (1 << i)) {
- if (chan->f[i] < -1.0f)
- dst->f[i] = -1.0f;
- else if (chan->f[i] > 1.0f)
- dst->f[i] = 1.0f;
- else
- dst->i[i] = chan->i[i];
- }
- break;
-
- default:
- assert( 0 );
}
}
@@ -3317,16 +3299,14 @@ store_double_channel(struct tgsi_exec_machine *mach,
union tgsi_double_channel temp;
const uint execmask = mach->ExecMask;
- switch (inst->Instruction.Saturate) {
- case TGSI_SAT_NONE:
+ if (!inst->Instruction.Saturate) {
for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i)) {
dst[0].u[i] = chan->u[i][0];
dst[1].u[i] = chan->u[i][1];
}
- break;
-
- case TGSI_SAT_ZERO_ONE:
+ }
+ else {
for (i = 0; i < TGSI_QUAD_SIZE; i++)
if (execmask & (1 << i)) {
if (chan->d[i] < 0.0)
@@ -3339,25 +3319,6 @@ store_double_channel(struct tgsi_exec_machine *mach,
dst[0].u[i] = temp.u[i][0];
dst[1].u[i] = temp.u[i][1];
}
- break;
-
- case TGSI_SAT_MINUS_PLUS_ONE:
- for (i = 0; i < TGSI_QUAD_SIZE; i++)
- if (execmask & (1 << i)) {
- if (chan->d[i] < -1.0)
- temp.d[i] = -1.0;
- else if (chan->d[i] > 1.0)
- temp.d[i] = 1.0;
- else
- temp.d[i] = chan->d[i];
-
- dst[0].u[i] = temp.u[i][0];
- dst[1].u[i] = temp.u[i][1];
- }
- break;
-
- default:
- assert( 0 );
}
store_dest_double(mach, &dst[0], reg, inst, chan_0, TGSI_EXEC_DATA_UINT);
diff --git a/src/gallium/auxiliary/tgsi/tgsi_lowering.c b/src/gallium/auxiliary/tgsi/tgsi_lowering.c
index 4954c1178e5..a3b90bdb509 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_lowering.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_lowering.c
@@ -1133,8 +1133,7 @@ transform_samp(struct tgsi_transform_context *tctx,
/* MOV_SAT tmpA.<mask>, tmpA */
if (mask) {
- create_mov(tctx, &ctx->tmp[A].dst, &ctx->tmp[A].src, mask,
- TGSI_SAT_ZERO_ONE);
+ create_mov(tctx, &ctx->tmp[A].dst, &ctx->tmp[A].src, mask, 1);
}
/* modify the texture samp instruction to take fixed up coord: */
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index b6b3585d561..a9734db6355 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -903,7 +903,7 @@ match_inst(const char **pcur,
/* simple case: the whole string matches the instruction name */
if (str_match_nocase_whole(&cur, info->mnemonic)) {
*pcur = cur;
- *saturate = TGSI_SAT_NONE;
+ *saturate = 0;
return TRUE;
}
@@ -911,13 +911,7 @@ match_inst(const char **pcur,
/* the instruction has a suffix, figure it out */
if (str_match_nocase_whole(&cur, "_SAT")) {
*pcur = cur;
- *saturate = TGSI_SAT_ZERO_ONE;
- return TRUE;
- }
-
- if (str_match_nocase_whole(&cur, "_SATNV")) {
- *pcur = cur;
- *saturate = TGSI_SAT_MINUS_PLUS_ONE;
+ *saturate = 1;
return TRUE;
}
}
@@ -931,7 +925,7 @@ parse_instruction(
boolean has_label )
{
uint i;
- uint saturate = TGSI_SAT_NONE;
+ uint saturate = 0;
const struct tgsi_opcode_info *info;
struct tgsi_full_instruction inst;
const char *cur;