_mesa_printf("_SAT");
if (fp[a].DstReg.File != 0xf) {
- if (fp[a].DstReg.WriteMask != 0xf ||
- fp[a].SrcReg[0].NegateBase)
+ if (fp[a].DstReg.WriteMask != 0xf)
_mesa_printf(" %s[%d].%s%s%s%s ", file_string[fp[a].DstReg.File], fp[a].DstReg.Index,
GET_BIT(fp[a].DstReg.WriteMask, 0) ? "x" : "",
GET_BIT(fp[a].DstReg.WriteMask, 1) ? "y" : "",
_mesa_printf(" %s[%d] ", file_string[fp[a].DstReg.File], fp[a].DstReg.Index);
}
+ /* Examine each bit of negatebase here as this may be a SWZ instruction
+ */
if (fp[a].SrcReg[0].File != 0xf) {
if (fp[a].SrcReg[0].Swizzle != SWIZZLE_NOOP ||
fp[a].SrcReg[0].NegateBase)
- _mesa_printf("%s[%d].%s%c%c%c%c ", file_string[fp[a].SrcReg[0].File], fp[a].SrcReg[0].Index,
- fp[a].SrcReg[0].NegateBase ? "-" : "",
+ _mesa_printf("%s[%d].%s%c%s%c%s%c%s%c ", file_string[fp[a].SrcReg[0].File], fp[a].SrcReg[0].Index,
+ GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 0)],
+ GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 1)],
+ GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 2)],
+ GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 3)]);
else
_mesa_printf("%s[%d] ", file_string[fp[a].SrcReg[0].File], fp[a].SrcReg[0].Index);
/**
*/
static GLuint
-parse_extended_swizzle_mask (GLubyte ** inst, GLubyte * mask, GLboolean * Negate)
+parse_extended_swizzle_mask (GLubyte ** inst, GLubyte * mask, GLubyte * Negate)
{
GLint a;
GLubyte swz;
- *Negate = GL_FALSE;
+ *Negate = 0x0;
for (a = 0; a < 4; a++) {
if (parse_sign (inst) == -1)
- *Negate = GL_TRUE;
+ *Negate |= 1<<a;
swz = *(*inst)++;
return 1;
{
- GLubyte Swizzle[4]; /* FP's swizzle mask is a GLubyte, while VP's is GLuint */
- GLubyte Negate[4];
+ GLubyte Swizzle[4];
+ GLubyte NegateMask;
GLint File, Index;
if (parse_src_reg(ctx, inst, vc_head, Program, &File, &Index, &rel))
return 1;
- parse_extended_swizzle_mask (inst, Swizzle, Negate);
+ parse_extended_swizzle_mask (inst, Swizzle, &NegateMask);
fp->SrcReg[0].File = File;
fp->SrcReg[0].Index = Index;
- fp->SrcReg[0].NegateBase = (Negate[0] << 0 |
- Negate[1] << 1 |
- Negate[2] << 2 |
- Negate[3] << 3);
+ fp->SrcReg[0].NegateBase = NegateMask;
fp->SrcReg[0].Swizzle = (Swizzle[0] << 0 |
Swizzle[1] << 3 |
Swizzle[2] << 6 |
break;
}
{
- GLubyte Swizzle[4]; /* FP's swizzle mask is a GLubyte, while VP's is GLuint */
- GLubyte Negate[4];
+ GLubyte Swizzle[4];
+ GLubyte NegateMask;
GLboolean RelAddr;
GLint File, Index;
if (parse_src_reg(ctx, inst, vc_head, Program, &File, &Index, &RelAddr))
return 1;
- parse_extended_swizzle_mask (inst, Swizzle, Negate);
+ parse_extended_swizzle_mask (inst, Swizzle, &NegateMask);
vp->SrcReg[0].File = File;
vp->SrcReg[0].Index = Index;
- vp->SrcReg[0].Negate = (Negate[0] << 0 |
- Negate[1] << 1 |
- Negate[2] << 2 |
- Negate[3] << 3);
+ vp->SrcReg[0].Negate = NegateMask;
vp->SrcReg[0].Swizzle = (Swizzle[0] << 0 |
Swizzle[1] << 3 |
Swizzle[2] << 6 |
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
if (Parse_String(parseState, "-"))
- srcReg->NegateBase = GL_TRUE;
+ srcReg->NegateBase = 0xf;
else if (Parse_String(parseState, "+"))
- srcReg->NegateBase = GL_FALSE;
+ srcReg->NegateBase = 0;
else
- srcReg->NegateBase = GL_FALSE;
+ srcReg->NegateBase = 0;
}
else {
srcReg->Abs = GL_FALSE;
srcReg->NegateAbs = GL_FALSE;
- srcReg->NegateBase = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
+ srcReg->NegateBase = (sign < 0.0F) ? 0xf : 0x0;
}
/* This should be the real src vector/register name */
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
if (Parse_String(parseState, "-"))
- srcReg->NegateBase = GL_TRUE;
+ srcReg->NegateBase = 0xf;
else if (Parse_String(parseState, "+"))
- srcReg->NegateBase = GL_FALSE;
+ srcReg->NegateBase = 0x0;
else
- srcReg->NegateBase = GL_FALSE;
+ srcReg->NegateBase = 0x0;
}
else {
srcReg->Abs = GL_FALSE;
srcReg->NegateAbs = GL_FALSE;
- srcReg->NegateBase = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
+ srcReg->NegateBase = (sign < 0.0F) ? 0xf : 0x0;
}
if (!Peek_Token(parseState, token))
}
inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
- inst->SrcReg[0].NegateBase = GL_FALSE;
+ inst->SrcReg[0].NegateBase = 0x0;
inst->SrcReg[0].Abs = GL_FALSE;
inst->SrcReg[0].NegateAbs = GL_FALSE;