void brw_math_16( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
- GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint precision );
void brw_math( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
- GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint data_type,
GLuint function,
GLuint integer_type,
bool low_precision,
- bool saturate,
GLuint dataType )
{
struct brw_context *brw = p->brw;
break;
}
+
brw_set_message_descriptor(p, insn, BRW_SFID_MATH,
msg_length, response_length, false, false);
if (intel->gen == 5) {
insn->bits3.math_gen5.function = function;
insn->bits3.math_gen5.int_type = integer_type;
insn->bits3.math_gen5.precision = low_precision;
- insn->bits3.math_gen5.saturate = saturate;
+ insn->bits3.math_gen5.saturate = insn->header.saturate;
insn->bits3.math_gen5.data_type = dataType;
insn->bits3.math_gen5.snapshot = 0;
} else {
insn->bits3.math.function = function;
insn->bits3.math.int_type = integer_type;
insn->bits3.math.precision = low_precision;
- insn->bits3.math.saturate = saturate;
+ insn->bits3.math.saturate = insn->header.saturate;
insn->bits3.math.data_type = dataType;
}
+ insn->header.saturate = 0;
}
void brw_math( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
- GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint data_type,
* becomes FC[3:0] and ThreadCtrl becomes FC[5:4].
*/
insn->header.destreg__conditionalmod = function;
- insn->header.saturate = saturate;
brw_set_dest(p, insn, dest);
brw_set_src0(p, insn, src);
function,
src.type == BRW_REGISTER_TYPE_D,
precision,
- saturate,
data_type);
}
}
void brw_math_16( struct brw_compile *p,
struct brw_reg dest,
GLuint function,
- GLuint saturate,
GLuint msg_reg_nr,
struct brw_reg src,
GLuint precision )
* becomes FC[3:0] and ThreadCtrl becomes FC[5:4].
*/
insn->header.destreg__conditionalmod = function;
- insn->header.saturate = saturate;
/* Source modifiers are ignored for extended math instructions. */
assert(!src.negate);
function,
BRW_MATH_INTEGER_UNSIGNED,
precision,
- saturate,
BRW_MATH_DATA_VECTOR);
/* Second instruction:
function,
BRW_MATH_INTEGER_UNSIGNED,
precision,
- saturate,
BRW_MATH_DATA_VECTOR);
brw_pop_insn_state(p);
brw_math( p,
dst,
BRW_MATH_FUNCTION_INV,
- BRW_MATH_SATURATE_NONE,
0,
src,
BRW_MATH_PRECISION_FULL,
assert(inst->mlen == 0);
brw_math(p, dst,
brw_math_function(inst->opcode),
- inst->saturate ? BRW_MATH_SATURATE_SATURATE
- : BRW_MATH_SATURATE_NONE,
0, src0,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p, dst,
op,
- inst->saturate ? BRW_MATH_SATURATE_SATURATE :
- BRW_MATH_SATURATE_NONE,
0, src0,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
brw_math(p, sechalf(dst),
op,
- inst->saturate ? BRW_MATH_SATURATE_SATURATE :
- BRW_MATH_SATURATE_NONE,
0, sechalf(src0),
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p, dst,
op,
- inst->saturate ? BRW_MATH_SATURATE_SATURATE :
- BRW_MATH_SATURATE_NONE,
inst->base_mrf, src,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF);
brw_math(p, sechalf(dst),
op,
- inst->saturate ? BRW_MATH_SATURATE_SATURATE :
- BRW_MATH_SATURATE_NONE,
inst->base_mrf + 1, sechalf(src),
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
brw_math(&c->func,
c->inv_det,
BRW_MATH_FUNCTION_INV,
- BRW_MATH_SATURATE_NONE,
0,
c->det,
BRW_MATH_DATA_SCALAR,
brw_math(&c->func,
c->tmp,
BRW_MATH_FUNCTION_INV,
- BRW_MATH_SATURATE_NONE,
0,
c->dx0,
BRW_MATH_DATA_SCALAR,
brw_math(p,
dst,
brw_math_function(inst->opcode),
- BRW_MATH_SATURATE_NONE,
inst->base_mrf,
src,
BRW_MATH_DATA_VECTOR,
brw_math(p,
dst,
brw_math_function(inst->opcode),
- BRW_MATH_SATURATE_NONE,
inst->base_mrf,
src,
BRW_MATH_DATA_SCALAR,
brw_math(p,
dst,
brw_math_function(inst->opcode),
- BRW_MATH_SATURATE_NONE,
inst->base_mrf,
op0,
BRW_MATH_DATA_VECTOR,
brw_math(p,
tmp,
function,
- BRW_MATH_SATURATE_NONE,
2,
arg0,
BRW_MATH_DATA_SCALAR,
brw_math(p,
tmp_dst,
function,
- BRW_MATH_SATURATE_NONE,
2,
tmp_src,
BRW_MATH_DATA_SCALAR,
brw_math(p,
tmp,
function,
- BRW_MATH_SATURATE_NONE,
2,
arg0,
BRW_MATH_DATA_SCALAR,
if (c->dispatch_width == 16) {
brw_math_16(p, dst[3],
BRW_MATH_FUNCTION_INV,
- BRW_MATH_SATURATE_NONE,
2, src,
BRW_MATH_PRECISION_FULL);
} else {
brw_math(p, dst[3],
BRW_MATH_FUNCTION_INV,
- BRW_MATH_SATURATE_NONE,
2, src,
BRW_MATH_DATA_VECTOR,
BRW_MATH_PRECISION_FULL);
struct brw_compile *p = &c->func;
struct intel_context *intel = &p->brw->intel;
int dst_chan = ffs(mask & WRITEMASK_XYZW) - 1;
- GLuint saturate = ((mask & SATURATE) ?
- BRW_MATH_SATURATE_SATURATE :
- BRW_MATH_SATURATE_NONE);
struct brw_reg src;
if (!(mask & WRITEMASK_XYZW))
/* Send two messages to perform all 16 operations:
*/
brw_push_insn_state(p);
+ brw_set_saturate(p, (mask & SATURATE) ? 1 : 0);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p,
dst[dst_chan],
function,
- saturate,
2,
src,
BRW_MATH_DATA_VECTOR,
brw_math(p,
offset(dst[dst_chan],1),
function,
- saturate,
3,
sechalf(src),
BRW_MATH_DATA_VECTOR,
sechalf(src1));
}
} else {
- GLuint saturate = ((mask & SATURATE) ?
- BRW_MATH_SATURATE_SATURATE :
- BRW_MATH_SATURATE_NONE);
-
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_MOV(p, brw_message_reg(3), arg1[0]);
if (c->dispatch_width == 16) {
brw_MOV(p, brw_message_reg(5), sechalf(arg1[0]));
}
+ brw_set_saturate(p, (mask & SATURATE) ? 1 : 0);
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
brw_math(p,
dst[dst_chan],
function,
- saturate,
2,
arg0[0],
BRW_MATH_DATA_VECTOR,
brw_math(p,
offset(dst[dst_chan],1),
function,
- saturate,
4,
sechalf(arg0[0]),
BRW_MATH_DATA_VECTOR,