/* 10. Check destination issues. */
}
-static void brw_set_src0( struct brw_instruction *insn,
- struct brw_reg reg )
+static void brw_set_src0(struct brw_compile *p,
+ struct brw_instruction *insn,
+ struct brw_reg reg)
{
if (reg.type != BRW_ARCHITECTURE_REGISTER_FILE)
assert(reg.nr < 128);
}
-void brw_set_src1( struct brw_instruction *insn,
- struct brw_reg reg )
+void brw_set_src1(struct brw_compile *p,
+ struct brw_instruction *insn,
+ struct brw_reg reg)
{
assert(reg.file != BRW_MESSAGE_REGISTER_FILE);
-static void brw_set_math_message( struct brw_context *brw,
+static void brw_set_math_message( struct brw_compile *p,
struct brw_instruction *insn,
GLuint msg_length,
GLuint response_length,
GLboolean saturate,
GLuint dataType )
{
+ struct brw_context *brw = p->brw;
struct intel_context *intel = &brw->intel;
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src1(p, insn, brw_imm_d(0));
if (intel->gen == 5) {
insn->bits3.math_gen5.function = function;
}
-static void brw_set_ff_sync_message(struct brw_context *brw,
+static void brw_set_ff_sync_message(struct brw_compile *p,
struct brw_instruction *insn,
GLboolean allocate,
GLuint response_length,
GLboolean end_of_thread)
{
+ struct brw_context *brw = p->brw;
struct intel_context *intel = &brw->intel;
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src1(p, insn, brw_imm_d(0));
insn->bits3.urb_gen5.opcode = 1; /* FF_SYNC */
insn->bits3.urb_gen5.offset = 0; /* Not used by FF_SYNC */
}
}
-static void brw_set_urb_message( struct brw_context *brw,
+static void brw_set_urb_message( struct brw_compile *p,
struct brw_instruction *insn,
GLboolean allocate,
GLboolean used,
GLuint offset,
GLuint swizzle_control )
{
+ struct brw_context *brw = p->brw;
struct intel_context *intel = &brw->intel;
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src1(p, insn, brw_imm_d(0));
if (intel->gen >= 5) {
insn->bits3.urb_gen5.opcode = 0; /* ? */
}
}
-static void brw_set_dp_write_message( struct brw_context *brw,
+static void brw_set_dp_write_message( struct brw_compile *p,
struct brw_instruction *insn,
GLuint binding_table_index,
GLuint msg_control,
GLuint end_of_thread,
GLuint send_commit_msg)
{
+ struct brw_context *brw = p->brw;
struct intel_context *intel = &brw->intel;
- brw_set_src1(insn, brw_imm_ud(0));
+ brw_set_src1(p, insn, brw_imm_ud(0));
if (intel->gen >= 6) {
insn->bits3.gen6_dp.binding_table_index = binding_table_index;
}
static void
-brw_set_dp_read_message(struct brw_context *brw,
+brw_set_dp_read_message(struct brw_compile *p,
struct brw_instruction *insn,
GLuint binding_table_index,
GLuint msg_control,
GLuint msg_length,
GLuint response_length)
{
+ struct brw_context *brw = p->brw;
struct intel_context *intel = &brw->intel;
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src1(p, insn, brw_imm_d(0));
if (intel->gen >= 6) {
uint32_t target_function;
}
}
-static void brw_set_sampler_message(struct brw_context *brw,
+static void brw_set_sampler_message(struct brw_compile *p,
struct brw_instruction *insn,
GLuint binding_table_index,
GLuint sampler,
GLuint header_present,
GLuint simd_mode)
{
+ struct brw_context *brw = p->brw;
struct intel_context *intel = &brw->intel;
assert(eot == 0);
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src1(p, insn, brw_imm_d(0));
if (intel->gen >= 5) {
insn->bits3.sampler_gen5.binding_table_index = binding_table_index;
{
struct brw_instruction *insn = next_insn(p, opcode);
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src);
+ brw_set_src0(p, insn, src);
return insn;
}
{
struct brw_instruction *insn = next_insn(p, opcode);
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src0);
- brw_set_src1(insn, src1);
+ brw_set_src0(p, insn, src0);
+ brw_set_src1(p, insn, src1);
return insn;
}
struct brw_instruction *rnd, *add; \
rnd = next_insn(p, BRW_OPCODE_##OP); \
brw_set_dest(p, rnd, dest); \
- brw_set_src0(rnd, src); \
+ brw_set_src0(p, rnd, src); \
rnd->header.destreg__conditionalmod = 0x7; /* turn on round-increments */ \
\
add = brw_ADD(p, dest, dest, brw_imm_f(1.0f)); \
{
struct brw_instruction *insn = next_insn(p, BRW_OPCODE_NOP);
brw_set_dest(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src1(insn, brw_imm_ud(0x0));
+ brw_set_src0(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
+ brw_set_src1(p, insn, brw_imm_ud(0x0));
}
*/
if (intel->gen < 6) {
brw_set_dest(p, insn, brw_ip_reg());
- brw_set_src0(insn, brw_ip_reg());
- brw_set_src1(insn, brw_imm_d(0x0));
+ brw_set_src0(p, insn, brw_ip_reg());
+ brw_set_src1(p, insn, brw_imm_d(0x0));
} else {
brw_set_dest(p, insn, brw_imm_w(0));
insn->bits1.branch_gen6.jump_count = 0;
- brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src1(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
}
insn->header.execution_size = execute_size;
brw_set_dest(p, insn, brw_imm_w(0));
insn->header.execution_size = BRW_EXECUTE_8;
insn->bits1.branch_gen6.jump_count = 0;
- brw_set_src0(insn, src0);
- brw_set_src1(insn, src1);
+ brw_set_src0(p, insn, src0);
+ brw_set_src1(p, insn, src1);
assert(insn->header.compression_control == BRW_COMPRESSION_NONE);
assert(insn->header.predicate_control == BRW_PREDICATE_NONE);
if (intel->gen < 6) {
brw_set_dest(p, insn, brw_ip_reg());
- brw_set_src0(insn, brw_ip_reg());
- brw_set_src1(insn, brw_imm_d(0x0));
+ brw_set_src0(p, insn, brw_ip_reg());
+ brw_set_src1(p, insn, brw_imm_d(0x0));
} else {
brw_set_dest(p, insn, brw_imm_w(0));
insn->bits1.branch_gen6.jump_count = 0;
- brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src1(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
}
insn->header.compression_control = BRW_COMPRESSION_NONE;
if (intel->gen < 6) {
brw_set_dest(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src1(insn, brw_imm_d(0x0));
+ brw_set_src0(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
+ brw_set_src1(p, insn, brw_imm_d(0x0));
} else {
brw_set_dest(p, insn, brw_imm_w(0));
- brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src1(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
}
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn = next_insn(p, BRW_OPCODE_BREAK);
if (intel->gen >= 6) {
brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src1(insn, brw_imm_d(0x0));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src1(p, insn, brw_imm_d(0x0));
} else {
brw_set_dest(p, insn, brw_ip_reg());
- brw_set_src0(insn, brw_ip_reg());
- brw_set_src1(insn, brw_imm_d(0x0));
+ brw_set_src0(p, insn, brw_ip_reg());
+ brw_set_src1(p, insn, brw_imm_d(0x0));
insn->bits3.if_else.pad0 = 0;
insn->bits3.if_else.pop_count = pop_count;
}
insn = next_insn(p, BRW_OPCODE_CONTINUE);
brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
brw_set_dest(p, insn, brw_ip_reg());
- brw_set_src0(insn, brw_ip_reg());
- brw_set_src1(insn, brw_imm_d(0x0));
+ brw_set_src0(p, insn, brw_ip_reg());
+ brw_set_src1(p, insn, brw_imm_d(0x0));
insn->bits3.break_cont.uip = br * (do_insn - insn);
struct brw_instruction *insn;
insn = next_insn(p, BRW_OPCODE_CONTINUE);
brw_set_dest(p, insn, brw_ip_reg());
- brw_set_src0(insn, brw_ip_reg());
- brw_set_src1(insn, brw_imm_d(0x0));
+ brw_set_src0(p, insn, brw_ip_reg());
+ brw_set_src1(p, insn, brw_imm_d(0x0));
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.execution_size = BRW_EXECUTE_8;
/* insn->header.mask_control = BRW_MASK_DISABLE; */
/* Override the defaults for this instruction:
*/
brw_set_dest(p, insn, brw_null_reg());
- brw_set_src0(insn, brw_null_reg());
- brw_set_src1(insn, brw_null_reg());
+ brw_set_src0(p, insn, brw_null_reg());
+ brw_set_src1(p, insn, brw_null_reg());
insn->header.compression_control = BRW_COMPRESSION_NONE;
insn->header.execution_size = execute_size;
brw_set_dest(p, insn, brw_imm_w(0));
insn->bits1.branch_gen6.jump_count = br * (do_insn - insn);
- brw_set_src0(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
- brw_set_src1(insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
+ brw_set_src1(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
insn->header.execution_size = do_insn->header.execution_size;
assert(insn->header.execution_size == BRW_EXECUTE_8);
insn = next_insn(p, BRW_OPCODE_ADD);
brw_set_dest(p, insn, brw_ip_reg());
- brw_set_src0(insn, brw_ip_reg());
- brw_set_src1(insn, brw_imm_d((do_insn - insn) * 16));
+ brw_set_src0(p, insn, brw_ip_reg());
+ brw_set_src1(p, insn, brw_imm_d((do_insn - insn) * 16));
insn->header.execution_size = BRW_EXECUTE_1;
} else {
insn = next_insn(p, BRW_OPCODE_WHILE);
assert(do_insn->header.opcode == BRW_OPCODE_DO);
brw_set_dest(p, insn, brw_ip_reg());
- brw_set_src0(insn, brw_ip_reg());
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src0(p, insn, brw_ip_reg());
+ brw_set_src1(p, insn, brw_imm_d(0));
insn->header.execution_size = do_insn->header.execution_size;
insn->bits3.if_else.jump_count = br * (do_insn - insn + 1);
insn->header.destreg__conditionalmod = conditional;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src0);
- brw_set_src1(insn, src1);
+ brw_set_src0(p, insn, src0);
+ brw_set_src1(p, insn, src1);
/* guess_execution_size(insn, src0); */
struct brw_reg src = brw_notification_1_reg();
brw_set_dest(p, insn, src);
- brw_set_src0(insn, src);
- brw_set_src1(insn, brw_null_reg());
+ brw_set_src0(p, insn, src);
+ brw_set_src1(p, insn, brw_null_reg());
insn->header.execution_size = 0; /* must */
insn->header.predicate_control = 0;
insn->header.compression_control = 0;
insn->header.saturate = saturate;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src);
- brw_set_src1(insn, brw_null_reg());
+ brw_set_src0(p, insn, src);
+ brw_set_src1(p, insn, brw_null_reg());
} else {
struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1;
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src);
- brw_set_math_message(p->brw,
+ brw_set_src0(p, insn, src);
+ brw_set_math_message(p,
insn,
msg_length, response_length,
function,
insn->header.destreg__conditionalmod = function;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src0);
- brw_set_src1(insn, src1);
+ brw_set_src0(p, insn, src0);
+ brw_set_src1(p, insn, src1);
}
/**
assert(!src.abs);
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src);
- brw_set_src1(insn, brw_null_reg());
+ brw_set_src0(p, insn, src);
+ brw_set_src1(p, insn, brw_null_reg());
return;
}
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src);
- brw_set_math_message(p->brw,
+ brw_set_src0(p, insn, src);
+ brw_set_math_message(p,
insn,
msg_length, response_length,
function,
insn->header.destreg__conditionalmod = msg_reg_nr+1;
brw_set_dest(p, insn, offset(dest,1));
- brw_set_src0(insn, src);
- brw_set_math_message(p->brw,
+ brw_set_src0(p, insn, src);
+ brw_set_math_message(p,
insn,
msg_length, response_length,
function,
brw_set_dest(p, insn, dest);
if (intel->gen >= 6) {
- brw_set_src0(insn, mrf);
+ brw_set_src0(p, insn, mrf);
} else {
- brw_set_src0(insn, brw_null_reg());
+ brw_set_src0(p, insn, brw_null_reg());
}
if (intel->gen >= 6)
else
msg_type = BRW_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE;
- brw_set_dp_write_message(p->brw,
+ brw_set_dp_write_message(p,
insn,
255, /* binding table index (255=stateless) */
msg_control,
brw_set_dest(p, insn, dest); /* UW? */
if (intel->gen >= 6) {
- brw_set_src0(insn, mrf);
+ brw_set_src0(p, insn, mrf);
} else {
- brw_set_src0(insn, brw_null_reg());
+ brw_set_src0(p, insn, brw_null_reg());
}
- brw_set_dp_read_message(p->brw,
+ brw_set_dp_read_message(p,
insn,
255, /* binding table index (255=stateless) */
msg_control,
brw_set_dest(p, insn, dest);
if (intel->gen >= 6) {
- brw_set_src0(insn, mrf);
+ brw_set_src0(p, insn, mrf);
} else {
- brw_set_src0(insn, brw_null_reg());
+ brw_set_src0(p, insn, brw_null_reg());
}
- brw_set_dp_read_message(p->brw,
+ brw_set_dp_read_message(p,
insn,
bind_table_index,
BRW_DATAPORT_OWORD_BLOCK_1_OWORDLOW,
dest = retype(vec8(dest), BRW_REGISTER_TYPE_UW);
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, brw_null_reg());
+ brw_set_src0(p, insn, brw_null_reg());
- brw_set_dp_read_message(p->brw,
+ brw_set_dp_read_message(p,
insn,
bind_table_index,
BRW_DATAPORT_DWORD_SCATTERED_BLOCK_8DWORDS,
brw_set_dest(p, insn, dest);
if (intel->gen >= 6) {
- brw_set_src0(insn, brw_message_reg(msg_reg_nr));
+ brw_set_src0(p, insn, brw_message_reg(msg_reg_nr));
} else {
- brw_set_src0(insn, brw_null_reg());
+ brw_set_src0(p, insn, brw_null_reg());
}
- brw_set_dp_read_message(p->brw,
+ brw_set_dp_read_message(p,
insn,
bind_table_index,
0,
insn->header.mask_control = BRW_MASK_DISABLE;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src);
+ brw_set_src0(p, insn, src);
if (intel->gen == 6)
msg_type = GEN6_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ;
else
msg_type = BRW_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ;
- brw_set_dp_read_message(p->brw,
+ brw_set_dp_read_message(p,
insn,
bind_table_index,
BRW_DATAPORT_OWORD_DUAL_BLOCK_1OWORD,
msg_control = BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD8_SINGLE_SOURCE_SUBSPAN01;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src0);
- brw_set_dp_write_message(p->brw,
+ brw_set_src0(p, insn, src0);
+ brw_set_dp_write_message(p,
insn,
binding_table_index,
msg_control,
insn->header.destreg__conditionalmod = msg_reg_nr;
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src0);
- brw_set_sampler_message(p->brw, insn,
+ brw_set_src0(p, insn, src0);
+ brw_set_sampler_message(p, insn,
binding_table_index,
sampler,
msg_type,
assert(msg_length < BRW_MAX_MRF);
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src0);
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src0(p, insn, src0);
+ brw_set_src1(p, insn, brw_imm_d(0));
if (intel->gen < 6)
insn->header.destreg__conditionalmod = msg_reg_nr;
- brw_set_urb_message(p->brw,
+ brw_set_urb_message(p,
insn,
allocate,
used,
insn = next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, insn, dest);
- brw_set_src0(insn, src0);
- brw_set_src1(insn, brw_imm_d(0));
+ brw_set_src0(p, insn, src0);
+ brw_set_src1(p, insn, brw_imm_d(0));
if (intel->gen < 6)
insn->header.destreg__conditionalmod = msg_reg_nr;
- brw_set_ff_sync_message(p->brw,
+ brw_set_ff_sync_message(p,
insn,
allocate,
response_length,