i965/fs: Add SHADER_OPCODE_LOAD_PAYLOAD.

Will be used to simplify the handling of large virtual GRFs in SSA form.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Matt Turner 2014-05-27 18:47:40 -07:00
parent 39cdf1621e
commit b996216384
5 changed files with 33 additions and 0 deletions

View file

@ -798,6 +798,20 @@ enum opcode {
SHADER_OPCODE_TG4,
SHADER_OPCODE_TG4_OFFSET,
/**
* Combines multiple sources of size 1 into a larger virtual GRF.
* For example, parameters for a send-from-GRF message. Or, updating
* channels of a size 4 VGRF used to store vec4s such as texturing results.
*
* This will be lowered into MOVs from each source to consecutive reg_offsets
* of the destination VGRF.
*
* src[0] may be BAD_FILE. If so, the lowering pass skips emitting the MOV,
* but still reserves the first channel of the destination VGRF. This can be
* used to reserve space for, say, a message header set up by the generators.
*/
SHADER_OPCODE_LOAD_PAYLOAD,
SHADER_OPCODE_SHADER_TIME_ADD,
SHADER_OPCODE_UNTYPED_ATOMIC,

View file

@ -241,6 +241,16 @@ fs_visitor::CMP(fs_reg dst, fs_reg src0, fs_reg src1, uint32_t condition)
return inst;
}
fs_inst *
fs_visitor::LOAD_PAYLOAD(const fs_reg &dst, fs_reg *src, int sources)
{
fs_inst *inst = new(mem_ctx) fs_inst(SHADER_OPCODE_LOAD_PAYLOAD, dst, src,
sources);
inst->regs_written = sources;
return inst;
}
exec_list
fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_reg &dst,
const fs_reg &surf_index,

View file

@ -338,6 +338,8 @@ public:
fs_inst *end,
const fs_reg &reg);
fs_inst *LOAD_PAYLOAD(const fs_reg &dst, fs_reg *src, int sources);
exec_list VARYING_PULL_CONSTANT_LOAD(const fs_reg &dst,
const fs_reg &surf_index,
const fs_reg &varying_offset,

View file

@ -1749,6 +1749,10 @@ fs_generator::generate_code(exec_list *instructions)
_mesa_problem(ctx, "Unsupported opcode %d in FS", inst->opcode);
}
abort();
case SHADER_OPCODE_LOAD_PAYLOAD:
assert(!"Should be lowered by lower_load_payload()");
break;
}
if (inst->conditional_mod) {

View file

@ -454,6 +454,9 @@ brw_instruction_name(enum opcode op)
case SHADER_OPCODE_SHADER_TIME_ADD:
return "shader_time_add";
case SHADER_OPCODE_LOAD_PAYLOAD:
return "load_payload";
case SHADER_OPCODE_GEN4_SCRATCH_READ:
return "gen4_scratch_read";
case SHADER_OPCODE_GEN4_SCRATCH_WRITE: