src->File = reg.file;
src->Index = reg.idx;
src->Swizzle = reg.swz;
- src->Abs = reg.abs;
src->Negate = reg.negate ? NEGATE_XYZW : NEGATE_NONE;
src->RelAddr = 0;
/* Check that bitfield sizes aren't exceeded */
mesa_reg.Swizzle = reg.swizzle;
mesa_reg.RelAddr = reg.reladdr != NULL;
mesa_reg.Negate = reg.negate;
- mesa_reg.Abs = 0;
return mesa_reg;
}
result[3] = src[GET_SWZ(source->Swizzle, 3)];
}
- if (source->Abs) {
- result[0] = fabsf(result[0]);
- result[1] = fabsf(result[1]);
- result[2] = fabsf(result[2]);
- result[3] = fabsf(result[3]);
- }
if (source->Negate) {
assert(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[2] = deriv[GET_SWZ(source->Swizzle, 2)];
result[3] = deriv[GET_SWZ(source->Swizzle, 3)];
- if (source->Abs) {
- result[0] = fabsf(result[0]);
- result[1] = fabsf(result[1]);
- result[2] = fabsf(result[2]);
- result[3] = fabsf(result[3]);
- }
if (source->Negate) {
assert(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[0] = src[GET_SWZ(source->Swizzle, 0)];
- if (source->Abs) {
- result[0] = fabsf(result[0]);
- }
if (source->Negate) {
result[0] = -result[0];
}
GLuint Swizzle:12;
GLuint RelAddr:1;
- /** Take the component-wise absolute value */
- GLuint Abs:1;
-
/**
- * Post-Abs negation.
+ * Negation.
* This will either be NEGATE_NONE or NEGATE_XYZW, except for the SWZ
* instruction which allows per-component negation.
*/
return (a->File == b->File)
&& (a->Index == b->Index)
&& (a->Swizzle == b->Swizzle)
- && (a->Abs == b->Abs)
&& (a->Negate == b->Negate)
&& (a->RelAddr == 0)
&& (b->RelAddr == 0);
data[2] = value[GET_SWZ(r->Swizzle, 2)].f;
data[3] = value[GET_SWZ(r->Swizzle, 3)].f;
- if (r->Abs) {
- data[0] = fabsf(data[0]);
- data[1] = fabsf(data[1]);
- data[2] = fabsf(data[2]);
- data[3] = fabsf(data[3]);
- }
-
if (r->Negate & 0x01) {
data[0] = -data[0];
}
mov->Opcode == OPCODE_MOV &&
mov->SrcReg[0].RelAddr == 0 &&
mov->SrcReg[0].Negate == 0 &&
- mov->SrcReg[0].Abs == 0 &&
mov->DstReg.RelAddr == 0;
}
if (inst2->SrcReg[arg].File != mov->DstReg.File ||
inst2->SrcReg[arg].Index != mov->DstReg.Index ||
- inst2->SrcReg[arg].RelAddr ||
- inst2->SrcReg[arg].Abs)
+ inst2->SrcReg[arg].RelAddr)
continue;
read_mask = get_src_arg_mask(inst2, arg, NO_MASK);
gl_prog_print_mode mode,
const struct gl_program *prog)
{
- const char *abs = srcReg->Abs ? "|" : "";
-
- fprintf(f, "%s%s%s%s",
- abs,
+ fprintf(f, "%s%s",
reg_string((gl_register_file) srcReg->File,
srcReg->Index, mode, srcReg->RelAddr, prog),
_mesa_swizzle_string(srcReg->Swizzle,
- srcReg->Negate, GL_FALSE),
- abs);
+ srcReg->Negate, GL_FALSE));
#if 0
fprintf(f, "%s[%d]%s",
_mesa_register_file_name((gl_register_file) srcReg->File),
def = nir_fmov_alu(b, src, 4);
- if (prog_src->Abs)
- def = nir_fabs(b, def);
-
if (prog_src->Negate)
def = nir_fneg(b, def);
} else {
chans[i] = &mov->dest.dest.ssa;
}
- if (prog_src->Abs)
- chans[i] = nir_fabs(b, chans[i]);
-
if (prog_src->Negate & (1 << i))
chans[i] = nir_fneg(b, chans[i]);
}
$$.Base.Negate = ~$$.Base.Negate;
}
}
- | optionalSign '|' scalarUse '|'
- {
- $$ = $3;
-
- if (!state->option.NV_fragment) {
- yyerror(& @2, state, "unexpected character '|'");
- YYERROR;
- }
-
- if ($1) {
- $$.Base.Negate = ~$$.Base.Negate;
- }
-
- $$.Base.Abs = 1;
- }
;
scalarUse: srcReg scalarSuffix
$$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
$3.swizzle);
}
- | optionalSign '|' srcReg swizzleSuffix '|'
- {
- $$ = $3;
-
- if (!state->option.NV_fragment) {
- yyerror(& @2, state, "unexpected character '|'");
- YYERROR;
- }
-
- if ($1) {
- $$.Base.Negate = ~$$.Base.Negate;
- }
-
- $$.Base.Abs = 1;
- $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
- $4.swizzle);
- }
-
;
maskedDstReg: dstReg optionalMask
if (SrcReg->Negate == NEGATE_XYZW)
src = ureg_negate(src);
- if (SrcReg->Abs)
- src = ureg_abs(src);
-
if (SrcReg->RelAddr) {
src = ureg_src_indirect( src, ureg_src(t->address[0]));
if (SrcReg->File != PROGRAM_INPUT &&