#define BRW_MAX_CURBE (32*16)
struct brw_context;
-struct brw_instruction;
+struct brw_inst;
struct brw_vs_prog_key;
struct brw_vec4_prog_key;
struct brw_wm_prog_key;
/* brw_disasm.c */
int brw_disassemble_inst(FILE *file, struct brw_context *brw,
- struct brw_instruction *inst, bool is_compacted);
+ struct brw_inst *inst, bool is_compacted);
/* brw_vs.c */
gl_clip_plane *brw_select_clip_planes(struct gl_context *ctx);
return err;
}
-static int dest (FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int dest (FILE *file, struct brw_context *brw, brw_inst *inst)
{
int err = 0;
return 0;
}
-static int dest_3src (FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int dest_3src (FILE *file, struct brw_context *brw, brw_inst *inst)
{
int err = 0;
uint32_t reg_file;
return err;
}
-static int src0_3src (FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int src0_3src (FILE *file, struct brw_context *brw, brw_inst *inst)
{
int err = 0;
unsigned swz = brw_inst_3src_src0_swizzle(brw, inst);
return err;
}
-static int src1_3src (FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int src1_3src (FILE *file, struct brw_context *brw, brw_inst *inst)
{
int err = 0;
unsigned swz = brw_inst_3src_src1_swizzle(brw, inst);
}
-static int src2_3src (FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int src2_3src (FILE *file, struct brw_context *brw, brw_inst *inst)
{
int err = 0;
unsigned swz = brw_inst_3src_src2_swizzle(brw, inst);
}
static int imm (FILE *file, struct brw_context *brw, unsigned type,
- struct brw_instruction *inst) {
+ brw_inst *inst) {
switch (type) {
case BRW_HW_REG_TYPE_UD:
format (file, "0x%08xUD", brw_inst_imm_ud(brw, inst));
return 0;
}
-static int src0 (FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int src0 (FILE *file, struct brw_context *brw, brw_inst *inst)
{
if (brw_inst_src0_reg_file(brw, inst) == BRW_IMMEDIATE_VALUE)
return imm (file, brw, brw_inst_src0_reg_type(brw, inst), inst);
}
}
-static int src1 (FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int src1 (FILE *file, struct brw_context *brw, brw_inst *inst)
{
if (brw_inst_src1_reg_file(brw, inst) == BRW_IMMEDIATE_VALUE)
return imm (file, brw, brw_inst_src1_reg_type(brw, inst), inst);
}
}
-static int qtr_ctrl(FILE *file, struct brw_context *brw,
- struct brw_instruction *inst)
+static int qtr_ctrl(FILE *file, struct brw_context *brw, brw_inst *inst)
{
int qtr_ctl = brw_inst_qtr_control(brw, inst);
int exec_size = 1 << brw_inst_exec_size(brw, inst);
}
int
-brw_disassemble_inst(FILE *file, struct brw_context *brw,
- struct brw_instruction *inst, bool is_compacted)
+brw_disassemble_inst(FILE *file, struct brw_context *brw, brw_inst *inst,
+ bool is_compacted)
{
int err = 0;
int space = 0;
void brw_push_insn_state( struct brw_compile *p )
{
assert(p->current != &p->stack[BRW_EU_MAX_INSN_STACK-1]);
- memcpy(p->current+1, p->current, sizeof(struct brw_instruction));
+ memcpy(p->current + 1, p->current, sizeof(brw_inst));
p->compressed_stack[p->current - p->stack] = p->compressed;
p->current++;
}
* until out of memory.
*/
p->store_size = 1024;
- p->store = rzalloc_array(mem_ctx, struct brw_instruction, p->store_size);
+ p->store = rzalloc_array(mem_ctx, brw_inst, p->store_size);
p->nr_insn = 0;
p->current = p->stack;
p->compressed = false;
bool dump_hex = false;
for (int offset = start; offset < end;) {
- struct brw_instruction *insn = assembly + offset;
- struct brw_instruction uncompacted;
+ brw_inst *insn = assembly + offset;
+ brw_inst uncompacted;
bool compacted = brw_inst_cmpt_control(brw, insn);
fprintf(out, "0x%08x: ", offset);
#define brw_last_inst (&p->store[p->nr_insn - 1])
struct brw_compile {
- struct brw_instruction *store;
+ brw_inst *store;
int store_size;
unsigned nr_insn;
unsigned int next_insn_offset;
/* Allow clients to push/pop instruction state:
*/
- struct brw_instruction stack[BRW_EU_MAX_INSN_STACK];
+ brw_inst stack[BRW_EU_MAX_INSN_STACK];
bool compressed_stack[BRW_EU_MAX_INSN_STACK];
- struct brw_instruction *current;
+ brw_inst *current;
bool single_program_flow;
bool compressed;
int start, int end, FILE *out);
const unsigned *brw_get_program( struct brw_compile *p, unsigned *sz );
-struct brw_instruction *brw_next_insn(struct brw_compile *p, unsigned opcode);
-void brw_set_dest(struct brw_compile *p, struct brw_instruction *insn,
- struct brw_reg dest);
-void brw_set_src0(struct brw_compile *p, struct brw_instruction *insn,
- struct brw_reg reg);
+brw_inst *brw_next_insn(struct brw_compile *p, unsigned opcode);
+void brw_set_dest(struct brw_compile *p, brw_inst *insn, struct brw_reg dest);
+void brw_set_src0(struct brw_compile *p, brw_inst *insn, struct brw_reg reg);
void gen6_resolve_implied_move(struct brw_compile *p,
struct brw_reg *src,
/* Helpers for regular instructions:
*/
-#define ALU1(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
- struct brw_reg dest, \
+#define ALU1(OP) \
+brw_inst *brw_##OP(struct brw_compile *p, \
+ struct brw_reg dest, \
struct brw_reg src0);
-#define ALU2(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
- struct brw_reg dest, \
- struct brw_reg src0, \
+#define ALU2(OP) \
+brw_inst *brw_##OP(struct brw_compile *p, \
+ struct brw_reg dest, \
+ struct brw_reg src0, \
struct brw_reg src1);
-#define ALU3(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
- struct brw_reg dest, \
- struct brw_reg src0, \
- struct brw_reg src1, \
+#define ALU3(OP) \
+brw_inst *brw_##OP(struct brw_compile *p, \
+ struct brw_reg dest, \
+ struct brw_reg src0, \
+ struct brw_reg src1, \
struct brw_reg src2);
#define ROUND(OP) \
/* Helpers for SEND instruction:
*/
void brw_set_sampler_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
unsigned binding_table_index,
unsigned sampler,
unsigned msg_type,
unsigned return_format);
void brw_set_dp_read_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
unsigned binding_table_index,
unsigned msg_control,
unsigned msg_type,
unsigned response_length);
void brw_set_dp_write_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
unsigned binding_table_index,
unsigned msg_control,
unsigned msg_type,
/* If/else/endif. Works by manipulating the execution flags on each
* channel.
*/
-struct brw_instruction *brw_IF(struct brw_compile *p,
- unsigned execute_size);
-struct brw_instruction *gen6_IF(struct brw_compile *p, uint32_t conditional,
- struct brw_reg src0, struct brw_reg src1);
+brw_inst *brw_IF(struct brw_compile *p, unsigned execute_size);
+brw_inst *gen6_IF(struct brw_compile *p, uint32_t conditional,
+ struct brw_reg src0, struct brw_reg src1);
void brw_ELSE(struct brw_compile *p);
void brw_ENDIF(struct brw_compile *p);
/* DO/WHILE loops:
*/
-struct brw_instruction *brw_DO(struct brw_compile *p,
- unsigned execute_size);
+brw_inst *brw_DO(struct brw_compile *p, unsigned execute_size);
-struct brw_instruction *brw_WHILE(struct brw_compile *p);
+brw_inst *brw_WHILE(struct brw_compile *p);
-struct brw_instruction *brw_BREAK(struct brw_compile *p);
-struct brw_instruction *brw_CONT(struct brw_compile *p);
-struct brw_instruction *gen6_CONT(struct brw_compile *p);
-struct brw_instruction *gen6_HALT(struct brw_compile *p);
+brw_inst *brw_BREAK(struct brw_compile *p);
+brw_inst *brw_CONT(struct brw_compile *p);
+brw_inst *gen6_CONT(struct brw_compile *p);
+brw_inst *gen6_HALT(struct brw_compile *p);
/* Forward jumps:
*/
void brw_land_fwd_jump(struct brw_compile *p, int jmp_insn_idx);
-struct brw_instruction *brw_JMPI(struct brw_compile *p, struct brw_reg index,
- unsigned predicate_control);
+brw_inst *brw_JMPI(struct brw_compile *p, struct brw_reg index,
+ unsigned predicate_control);
void brw_NOP(struct brw_compile *p);
struct brw_reg dst,
struct brw_reg src);
-void brw_set_src1(struct brw_compile *p,
- struct brw_instruction *insn,
- struct brw_reg reg);
+void brw_set_src1(struct brw_compile *p, brw_inst *insn, struct brw_reg reg);
void brw_set_uip_jip(struct brw_compile *p);
void brw_init_compaction_tables(struct brw_context *brw);
void brw_compact_instructions(struct brw_compile *p, int start_offset,
int num_annotations, struct annotation *annotation);
-void brw_uncompact_instruction(struct brw_context *brw,
- struct brw_instruction *dst,
+void brw_uncompact_instruction(struct brw_context *brw, brw_inst *dst,
struct brw_compact_instruction *src);
bool brw_try_compact_instruction(struct brw_compile *p,
struct brw_compact_instruction *dst,
- struct brw_instruction *src);
+ brw_inst *src);
-void brw_debug_compact_uncompact(struct brw_context *brw,
- struct brw_instruction *orig,
- struct brw_instruction *uncompacted);
+void brw_debug_compact_uncompact(struct brw_context *brw, brw_inst *orig,
+ brw_inst *uncompacted);
static inline int
next_offset(const struct brw_context *brw, void *store, int offset)
{
- struct brw_instruction *insn =
- (struct brw_instruction *)((char *)store + offset);
+ brw_inst *insn = (brw_inst *)((char *)store + offset);
if (brw_inst_cmpt_control(brw, insn))
return offset + 8;
static bool
set_control_index(struct brw_context *brw,
struct brw_compact_instruction *dst,
- struct brw_instruction *src)
+ brw_inst *src)
{
uint32_t uncompacted = /* 17b/SNB; 19b/IVB+ */
(brw_inst_bits(src, 31, 31) << 16) | /* 1b */
static bool
set_datatype_index(struct brw_context *brw,
struct brw_compact_instruction *dst,
- struct brw_instruction *src)
+ brw_inst *src)
{
uint32_t uncompacted = /* 18b */
(brw_inst_bits(src, 63, 61) << 15) | /* 3b */
static bool
set_subreg_index(struct brw_context *brw,
struct brw_compact_instruction *dst,
- struct brw_instruction *src,
- bool is_immediate)
+ brw_inst *src, bool is_immediate)
{
uint16_t uncompacted = /* 15b */
(brw_inst_bits(src, 52, 48) << 0) | /* 5b */
static bool
set_src0_index(struct brw_context *brw,
struct brw_compact_instruction *dst,
- struct brw_instruction *src)
+ brw_inst *src)
{
uint16_t compacted;
uint16_t uncompacted = brw_inst_bits(src, 88, 77); /* 12b */
static bool
set_src1_index(struct brw_context *brw,
struct brw_compact_instruction *dst,
- struct brw_instruction *src, bool is_immediate)
+ brw_inst *src, bool is_immediate)
{
if (is_immediate) {
dst->dw1.src1_index = (brw_inst_imm_ud(brw, src) >> 8) & 0x1f;
bool
brw_try_compact_instruction(struct brw_compile *p,
struct brw_compact_instruction *dst,
- struct brw_instruction *src)
+ brw_inst *src)
{
struct brw_context *brw = p->brw;
struct brw_compact_instruction temp;
}
static void
-set_uncompacted_control(struct brw_context *brw,
- struct brw_instruction *dst,
+set_uncompacted_control(struct brw_context *brw, brw_inst *dst,
struct brw_compact_instruction *src)
{
uint32_t uncompacted = control_index_table[src->dw0.control_index];
}
static void
-set_uncompacted_datatype(struct brw_context *brw,
- struct brw_instruction *dst,
+set_uncompacted_datatype(struct brw_context *brw, brw_inst *dst,
struct brw_compact_instruction *src)
{
uint32_t uncompacted = datatype_table[src->dw0.data_type_index];
}
static void
-set_uncompacted_subreg(struct brw_context *brw,
- struct brw_instruction *dst,
+set_uncompacted_subreg(struct brw_context *brw, brw_inst *dst,
struct brw_compact_instruction *src)
{
uint16_t uncompacted = subreg_table[src->dw0.sub_reg_index];
}
static void
-set_uncompacted_src0(struct brw_context *brw,
- struct brw_instruction *dst,
+set_uncompacted_src0(struct brw_context *brw, brw_inst *dst,
struct brw_compact_instruction *src)
{
uint32_t compacted = src->dw0.src0_index | src->dw1.src0_index << 2;
}
static void
-set_uncompacted_src1(struct brw_context *brw,
- struct brw_instruction *dst,
+set_uncompacted_src1(struct brw_context *brw, brw_inst *dst,
struct brw_compact_instruction *src, bool is_immediate)
{
if (is_immediate) {
}
void
-brw_uncompact_instruction(struct brw_context *brw,
- struct brw_instruction *dst,
+brw_uncompact_instruction(struct brw_context *brw, brw_inst *dst,
struct brw_compact_instruction *src)
{
memset(dst, 0, sizeof(*dst));
}
void brw_debug_compact_uncompact(struct brw_context *brw,
- struct brw_instruction *orig,
- struct brw_instruction *uncompacted)
+ brw_inst *orig,
+ brw_inst *uncompacted)
{
fprintf(stderr, "Instruction compact/uncompact changed (gen%d):\n",
brw->gen);
}
static void
-update_uip_jip(struct brw_context *brw, struct brw_instruction *insn,
+update_uip_jip(struct brw_context *brw, brw_inst *insn,
int this_old_ip, int *compacted_counts)
{
int jip = brw_inst_jip(brw, insn);
int offset = 0;
int compacted_count = 0;
for (src_offset = 0; src_offset < p->next_insn_offset - start_offset;) {
- struct brw_instruction *src = store + src_offset;
+ brw_inst *src = store + src_offset;
void *dst = store + offset;
old_ip[offset / 8] = src_offset / 8;
compacted_counts[src_offset / 8] = compacted_count;
- struct brw_instruction saved = *src;
+ brw_inst saved = *src;
if (!brw_inst_cmpt_control(brw, src) &&
brw_try_compact_instruction(p, dst, src)) {
compacted_count++;
if (INTEL_DEBUG) {
- struct brw_instruction uncompacted;
+ brw_inst uncompacted;
brw_uncompact_instruction(brw, &uncompacted, dst);
if (memcmp(&saved, &uncompacted, sizeof(uncompacted))) {
brw_debug_compact_uncompact(brw, &saved, &uncompacted);
/* Fix up control flow offsets. */
p->next_insn_offset = start_offset + offset;
for (offset = 0; offset < p->next_insn_offset - start_offset;) {
- struct brw_instruction *insn = store + offset;
+ brw_inst *insn = store + offset;
int this_old_ip = old_ip[offset / 8];
int this_compacted_count = compacted_counts[this_old_ip];
int target_old_ip, target_compacted_count;
*/
static void guess_execution_size(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
struct brw_reg reg)
{
const struct brw_context *brw = p->brw;
}
void
-brw_set_dest(struct brw_compile *p, struct brw_instruction *inst,
- struct brw_reg dest)
+brw_set_dest(struct brw_compile *p, brw_inst *inst, struct brw_reg dest)
{
const struct brw_context *brw = p->brw;
extern int reg_type_size[];
static void
-validate_reg(const struct brw_context *brw,
- struct brw_instruction *inst, struct brw_reg reg)
+validate_reg(const struct brw_context *brw, brw_inst *inst, struct brw_reg reg)
{
int hstride_for_reg[] = {0, 1, 2, 4};
int vstride_for_reg[] = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256};
}
void
-brw_set_src0(struct brw_compile *p, struct brw_instruction *inst,
- struct brw_reg reg)
+brw_set_src0(struct brw_compile *p, brw_inst *inst, struct brw_reg reg)
{
struct brw_context *brw = p->brw;
void
-brw_set_src1(struct brw_compile *p,
- struct brw_instruction *inst,
- struct brw_reg reg)
+brw_set_src1(struct brw_compile *p, brw_inst *inst, struct brw_reg reg)
{
const struct brw_context *brw = p->brw;
assert(reg.file != BRW_MESSAGE_REGISTER_FILE);
*/
static void
brw_set_message_descriptor(struct brw_compile *p,
- struct brw_instruction *inst,
+ brw_inst *inst,
enum brw_message_target sfid,
unsigned msg_length,
unsigned response_length,
}
static void brw_set_math_message( struct brw_compile *p,
- struct brw_instruction *inst,
+ brw_inst *inst,
unsigned function,
unsigned integer_type,
bool low_precision,
static void brw_set_ff_sync_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
bool allocate,
unsigned response_length,
bool end_of_thread)
}
static void brw_set_urb_message( struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
enum brw_urb_write_flags flags,
unsigned msg_length,
unsigned response_length,
void
brw_set_dp_write_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
unsigned binding_table_index,
unsigned msg_control,
unsigned msg_type,
void
brw_set_dp_read_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
unsigned binding_table_index,
unsigned msg_control,
unsigned msg_type,
void
brw_set_sampler_message(struct brw_compile *p,
- struct brw_instruction *inst,
+ brw_inst *inst,
unsigned binding_table_index,
unsigned sampler,
unsigned msg_type,
static void
gen7_set_dp_scratch_message(struct brw_compile *p,
- struct brw_instruction *inst,
+ brw_inst *inst,
bool write,
bool dword,
bool invalidate_after_read,
}
#define next_insn brw_next_insn
-struct brw_instruction *
+brw_inst *
brw_next_insn(struct brw_compile *p, unsigned opcode)
{
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
if (p->nr_insn + 1 > p->store_size) {
p->store_size <<= 1;
- p->store = reralloc(p->mem_ctx, p->store,
- struct brw_instruction, p->store_size);
+ p->store = reralloc(p->mem_ctx, p->store, brw_inst, p->store_size);
}
p->next_insn_offset += 16;
return insn;
}
-static struct brw_instruction *brw_alu1( struct brw_compile *p,
- unsigned opcode,
- struct brw_reg dest,
- struct brw_reg src )
+static brw_inst *
+brw_alu1(struct brw_compile *p, unsigned opcode,
+ struct brw_reg dest, struct brw_reg src)
{
- struct brw_instruction *insn = next_insn(p, opcode);
+ brw_inst *insn = next_insn(p, opcode);
brw_set_dest(p, insn, dest);
brw_set_src0(p, insn, src);
return insn;
}
-static struct brw_instruction *brw_alu2(struct brw_compile *p,
- unsigned opcode,
- struct brw_reg dest,
- struct brw_reg src0,
- struct brw_reg src1 )
+static brw_inst *
+brw_alu2(struct brw_compile *p, unsigned opcode,
+ struct brw_reg dest, struct brw_reg src0, struct brw_reg src1)
{
- struct brw_instruction *insn = next_insn(p, opcode);
+ brw_inst *insn = next_insn(p, opcode);
brw_set_dest(p, insn, dest);
brw_set_src0(p, insn, src0);
brw_set_src1(p, insn, src1);
}
}
-static struct brw_instruction *brw_alu3(struct brw_compile *p,
- unsigned opcode,
- struct brw_reg dest,
- struct brw_reg src0,
- struct brw_reg src1,
- struct brw_reg src2)
+static brw_inst *
+brw_alu3(struct brw_compile *p, unsigned opcode, struct brw_reg dest,
+ struct brw_reg src0, struct brw_reg src1, struct brw_reg src2)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *inst = next_insn(p, opcode);
+ brw_inst *inst = next_insn(p, opcode);
gen7_convert_mrf_to_grf(p, &dest);
* Convenience routines.
*/
#define ALU1(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
+brw_inst *brw_##OP(struct brw_compile *p, \
struct brw_reg dest, \
struct brw_reg src0) \
{ \
}
#define ALU2(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
+brw_inst *brw_##OP(struct brw_compile *p, \
struct brw_reg dest, \
struct brw_reg src0, \
struct brw_reg src1) \
}
#define ALU3(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
+brw_inst *brw_##OP(struct brw_compile *p, \
struct brw_reg dest, \
struct brw_reg src0, \
struct brw_reg src1, \
}
#define ALU3F(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
+brw_inst *brw_##OP(struct brw_compile *p, \
struct brw_reg dest, \
struct brw_reg src0, \
struct brw_reg src1, \
struct brw_reg src) \
{ \
struct brw_context *brw = p->brw; \
- struct brw_instruction *rnd, *add; \
+ brw_inst *rnd, *add; \
rnd = next_insn(p, BRW_OPCODE_##OP); \
brw_set_dest(p, rnd, dest); \
brw_set_src0(p, rnd, src); \
ROUND(RNDE)
-struct brw_instruction *brw_ADD(struct brw_compile *p,
- struct brw_reg dest,
- struct brw_reg src0,
- struct brw_reg src1)
+brw_inst *
+brw_ADD(struct brw_compile *p, struct brw_reg dest,
+ struct brw_reg src0, struct brw_reg src1)
{
/* 6.2.2: add */
if (src0.type == BRW_REGISTER_TYPE_F ||
return brw_alu2(p, BRW_OPCODE_ADD, dest, src0, src1);
}
-struct brw_instruction *brw_AVG(struct brw_compile *p,
- struct brw_reg dest,
- struct brw_reg src0,
- struct brw_reg src1)
+brw_inst *
+brw_AVG(struct brw_compile *p, struct brw_reg dest,
+ struct brw_reg src0, struct brw_reg src1)
{
assert(dest.type == src0.type);
assert(src0.type == src1.type);
return brw_alu2(p, BRW_OPCODE_AVG, dest, src0, src1);
}
-struct brw_instruction *brw_MUL(struct brw_compile *p,
- struct brw_reg dest,
- struct brw_reg src0,
- struct brw_reg src1)
+brw_inst *
+brw_MUL(struct brw_compile *p, struct brw_reg dest,
+ struct brw_reg src0, struct brw_reg src1)
{
/* 6.32.38: mul */
if (src0.type == BRW_REGISTER_TYPE_D ||
void brw_NOP(struct brw_compile *p)
{
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_NOP);
+ brw_inst *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(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
brw_set_src1(p, insn, brw_imm_ud(0x0));
* Comparisons, if/else/endif
*/
-struct brw_instruction *brw_JMPI(struct brw_compile *p,
- struct brw_reg index,
- unsigned predicate_control)
+brw_inst *
+brw_JMPI(struct brw_compile *p, struct brw_reg index,
+ unsigned predicate_control)
{
const struct brw_context *brw = p->brw;
struct brw_reg ip = brw_ip_reg();
- struct brw_instruction *inst = brw_alu2(p, BRW_OPCODE_JMPI, ip, ip, index);
+ brw_inst *inst = brw_alu2(p, BRW_OPCODE_JMPI, ip, ip, index);
brw_inst_set_exec_size(brw, inst, BRW_EXECUTE_2);
brw_inst_set_qtr_control(brw, inst, BRW_COMPRESSION_NONE);
}
static void
-push_if_stack(struct brw_compile *p, struct brw_instruction *inst)
+push_if_stack(struct brw_compile *p, brw_inst *inst)
{
p->if_stack[p->if_stack_depth] = inst - p->store;
}
}
-static struct brw_instruction *
+static brw_inst *
pop_if_stack(struct brw_compile *p)
{
p->if_stack_depth--;
}
static void
-push_loop_stack(struct brw_compile *p, struct brw_instruction *inst)
+push_loop_stack(struct brw_compile *p, brw_inst *inst)
{
if (p->loop_stack_array_size < p->loop_stack_depth) {
p->loop_stack_array_size *= 2;
p->if_depth_in_loop[p->loop_stack_depth] = 0;
}
-static struct brw_instruction *
+static brw_inst *
get_inner_do_insn(struct brw_compile *p)
{
return &p->store[p->loop_stack[p->loop_stack_depth - 1]];
* When the matching 'endif' instruction is reached, the flags are
* popped off. If the stack is now empty, normal execution resumes.
*/
-struct brw_instruction *
+brw_inst *
brw_IF(struct brw_compile *p, unsigned execute_size)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
insn = next_insn(p, BRW_OPCODE_IF);
/* This function is only used for gen6-style IF instructions with an
* embedded comparison (conditional modifier). It is not used on gen7.
*/
-struct brw_instruction *
+brw_inst *
gen6_IF(struct brw_compile *p, uint32_t conditional,
struct brw_reg src0, struct brw_reg src1)
{
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
insn = next_insn(p, BRW_OPCODE_IF);
*/
static void
convert_IF_ELSE_to_ADD(struct brw_compile *p,
- struct brw_instruction *if_inst,
- struct brw_instruction *else_inst)
+ brw_inst *if_inst, brw_inst *else_inst)
{
const struct brw_context *brw = p->brw;
/* The next instruction (where the ENDIF would be, if it existed) */
- struct brw_instruction *next_inst = &p->store[p->nr_insn];
+ brw_inst *next_inst = &p->store[p->nr_insn];
assert(p->single_program_flow);
assert(if_inst != NULL && brw_inst_opcode(brw, if_inst) == BRW_OPCODE_IF);
*/
static void
patch_IF_ELSE(struct brw_compile *p,
- struct brw_instruction *if_inst,
- struct brw_instruction *else_inst,
- struct brw_instruction *endif_inst)
+ brw_inst *if_inst, brw_inst *else_inst, brw_inst *endif_inst)
{
struct brw_context *brw = p->brw;
brw_ELSE(struct brw_compile *p)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
insn = next_insn(p, BRW_OPCODE_ELSE);
brw_ENDIF(struct brw_compile *p)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn = NULL;
- struct brw_instruction *else_inst = NULL;
- struct brw_instruction *if_inst = NULL;
- struct brw_instruction *tmp;
+ brw_inst *insn = NULL;
+ brw_inst *else_inst = NULL;
+ brw_inst *if_inst = NULL;
+ brw_inst *tmp;
bool emit_endif = true;
/* In single program flow mode, we can express IF and ELSE instructions
patch_IF_ELSE(p, if_inst, else_inst, insn);
}
-struct brw_instruction *brw_BREAK(struct brw_compile *p)
+brw_inst *
+brw_BREAK(struct brw_compile *p)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
insn = next_insn(p, BRW_OPCODE_BREAK);
if (brw->gen >= 6) {
return insn;
}
-struct brw_instruction *gen6_CONT(struct brw_compile *p)
+brw_inst *
+gen6_CONT(struct brw_compile *p)
{
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
insn = next_insn(p, BRW_OPCODE_CONTINUE);
brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
return insn;
}
-struct brw_instruction *brw_CONT(struct brw_compile *p)
+brw_inst *
+brw_CONT(struct brw_compile *p)
{
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
insn = next_insn(p, BRW_OPCODE_CONTINUE);
brw_set_dest(p, insn, brw_ip_reg());
brw_set_src0(p, insn, brw_ip_reg());
return insn;
}
-struct brw_instruction *gen6_HALT(struct brw_compile *p)
+brw_inst *
+gen6_HALT(struct brw_compile *p)
{
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
insn = next_insn(p, BRW_OPCODE_HALT);
brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
* For gen6, there's no more mask stack, so no need for DO. WHILE
* just points back to the first instruction of the loop.
*/
-struct brw_instruction *brw_DO(struct brw_compile *p, unsigned execute_size)
+brw_inst *
+brw_DO(struct brw_compile *p, unsigned execute_size)
{
struct brw_context *brw = p->brw;
push_loop_stack(p, &p->store[p->nr_insn]);
return &p->store[p->nr_insn];
} else {
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_DO);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_DO);
push_loop_stack(p, insn);
* nesting, since it can always just point to the end of the block/current loop.
*/
static void
-brw_patch_break_cont(struct brw_compile *p, struct brw_instruction *while_inst)
+brw_patch_break_cont(struct brw_compile *p, brw_inst *while_inst)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *do_inst = get_inner_do_insn(p);
- struct brw_instruction *inst;
+ brw_inst *do_inst = get_inner_do_insn(p);
+ brw_inst *inst;
int br = (brw->gen == 5) ? 2 : 1;
for (inst = while_inst - 1; inst != do_inst; inst--) {
}
}
-struct brw_instruction *brw_WHILE(struct brw_compile *p)
+brw_inst *
+brw_WHILE(struct brw_compile *p)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn, *do_insn;
+ brw_inst *insn, *do_insn;
unsigned br = 1;
if (brw->gen >= 5)
void brw_land_fwd_jump(struct brw_compile *p, int jmp_insn_idx)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *jmp_insn = &p->store[jmp_insn_idx];
+ brw_inst *jmp_insn = &p->store[jmp_insn_idx];
unsigned jmpi = 1;
if (brw->gen >= 5)
struct brw_reg src1)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_CMP);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_CMP);
brw_inst_set_cond_modifier(brw, insn, conditional);
brw_set_dest(p, insn, dest);
unsigned precision )
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
assert(brw->gen < 6);
struct brw_reg src1)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_MATH);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_MATH);
assert(brw->gen >= 6);
{
struct brw_reg dest;
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
int send_commit_msg;
struct brw_reg src_header = retype(brw_vec8_grf(0, 0),
BRW_REGISTER_TYPE_UW);
}
{
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
assert(brw_inst_pred_control(brw, insn) == 0);
brw_inst_set_qtr_control(brw, insn, BRW_COMPRESSION_NONE);
unsigned offset)
{
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
assert(brw_inst_pred_control(brw, insn) == BRW_PREDICATE_NONE);
brw_inst_set_qtr_control(brw, insn, BRW_COMPRESSION_NONE);
2), BRW_REGISTER_TYPE_UD),
brw_imm_ud(offset));
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
/* cast dest to a uword[8] vector */
dest = retype(vec8(dest), BRW_REGISTER_TYPE_UW);
bool header_present)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
unsigned msg_type;
struct brw_reg dest;
unsigned return_format)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
if (msg_reg_nr != -1)
gen6_resolve_implied_move(p, &src0, msg_reg_nr);
unsigned swizzle)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
gen6_resolve_implied_move(p, &src0, msg_reg_nr);
for (offset = next_offset(brw, store, start_offset);
offset < p->next_insn_offset;
offset = next_offset(brw, store, offset)) {
- struct brw_instruction *insn = store + offset;
+ brw_inst *insn = store + offset;
switch (brw_inst_opcode(brw, insn)) {
case BRW_OPCODE_ENDIF:
for (offset = next_offset(brw, store, start_offset);
offset < p->next_insn_offset;
offset = next_offset(brw, store, offset)) {
- struct brw_instruction *insn = store + offset;
+ brw_inst *insn = store + offset;
if (brw_inst_opcode(brw, insn) == BRW_OPCODE_WHILE) {
int jip = brw->gen == 6 ? brw_inst_gen6_jump_count(brw, insn)
for (offset = 0; offset < p->next_insn_offset;
offset = next_offset(brw, store, offset)) {
- struct brw_instruction *insn = store + offset;
+ brw_inst *insn = store + offset;
if (brw_inst_cmpt_control(brw, insn)) {
/* Fixups for compacted BREAK/CONTINUE not supported yet. */
bool eot)
{
struct brw_context *brw = p->brw;
- struct brw_instruction *insn;
+ brw_inst *insn;
gen6_resolve_implied_move(p, &src0, msg_reg_nr);
unsigned binding_table_index,
bool send_commit_msg)
{
- struct brw_instruction *insn;
+ brw_inst *insn;
gen6_resolve_implied_move(p, &src0, msg_reg_nr);
static void
brw_set_dp_untyped_atomic_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
unsigned atomic_op,
unsigned bind_table_index,
unsigned msg_length,
unsigned msg_length,
unsigned response_length) {
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = brw_next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, insn, retype(dest, BRW_REGISTER_TYPE_UD));
brw_set_src0(p, insn, retype(mrf, BRW_REGISTER_TYPE_UD));
static void
brw_set_dp_untyped_surface_read_message(struct brw_compile *p,
- struct brw_instruction *insn,
+ brw_inst *insn,
unsigned bind_table_index,
unsigned msg_length,
unsigned response_length,
unsigned response_length)
{
const struct brw_context *brw = p->brw;
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, insn, retype(dest, BRW_REGISTER_TYPE_UD));
brw_set_src0(p, insn, retype(mrf, BRW_REGISTER_TYPE_UD));
brw_push_insn_state(p);
brw_set_default_access_mode(p, BRW_ALIGN_1);
brw_set_default_mask_control(p, BRW_MASK_DISABLE);
- struct brw_instruction *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
brw_pop_insn_state(p);
/* We use brw_vec1_reg and unmasked because we want to increment the given
* included GPU hangs and sparkly rendering on the piglit discard
* tests.
*/
- struct brw_instruction *last_halt = gen6_HALT(p);
+ brw_inst *last_halt = gen6_HALT(p);
brw_inst_set_uip(brw, last_halt, 2);
brw_inst_set_jip(brw, last_halt, 2);
foreach_list(node, &this->discard_halt_patches) {
ip_record *patch_ip = (ip_record *)node;
- struct brw_instruction *patch = &p->store[patch_ip->ip];
+ brw_inst *patch = &p->store[patch_ip->ip];
assert(brw_inst_opcode(brw, patch) == BRW_OPCODE_HALT);
/* HALT takes a half-instruction distance from the pre-incremented IP. */
brw_push_insn_state(p);
brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
brw_set_default_mask_control(p, BRW_MASK_DISABLE);
- struct brw_instruction *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
brw_pop_insn_state(p);
/* We use the SIMD4x2 mode because we want to end up with 4 components in
struct brw_reg header = brw_vec8_grf(0, 0);
gen6_resolve_implied_move(p, &header, inst->base_mrf);
- struct brw_instruction *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
brw_inst_set_qtr_control(brw, send, BRW_COMPRESSION_NONE);
brw_set_dest(p, send, retype(dst, BRW_REGISTER_TYPE_UW));
brw_set_src0(p, send, header);
simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD8;
}
- struct brw_instruction *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, send, dst);
brw_set_src0(p, send, offset);
brw_set_sampler_message(p, send,
* doesn't make sense.
*/
assert(p->next_insn_offset == last_insn_offset + 16);
- struct brw_instruction *last = &p->store[last_insn_offset / 16];
+ brw_inst *last = &p->store[last_insn_offset / 16];
brw_inst_set_cond_modifier(brw, last, inst->conditional_mod);
}
}
{
struct brw_compile *p = &c->func;
struct brw_context *brw = p->brw;
- struct brw_instruction *inst;
+ brw_inst *inst;
c->prog_data.svbi_postincrement_value = num_verts;
brw_ff_gs_alloc_regs(c, num_verts, true);
extern "C" {
#endif
-struct brw_instruction;
-
-typedef struct {
+/* brw_context.h has a forward declaration of brw_inst, so name the struct. */
+typedef struct brw_inst {
uint64_t data[2];
} brw_inst;
-static inline uint64_t brw_inst_bits(struct brw_instruction *inst,
+static inline uint64_t brw_inst_bits(brw_inst *inst,
unsigned high, unsigned low);
-static inline void brw_inst_set_bits(struct brw_instruction *inst,
+static inline void brw_inst_set_bits(brw_inst *inst,
unsigned high, unsigned low,
uint64_t value);
#define FC(name, high, low, assertions) \
static inline void \
brw_inst_set_##name(const struct brw_context *brw, \
- struct brw_instruction *inst, uint64_t v) \
+ brw_inst *inst, uint64_t v) \
{ \
assert(assertions); \
brw_inst_set_bits(inst, high, low, v); \
} \
static inline uint64_t \
brw_inst_##name(const struct brw_context *brw, \
- struct brw_instruction *inst) \
+ brw_inst *inst) \
{ \
assert(assertions); \
return brw_inst_bits(inst, high, low); \
#define FF(name, hi4, lo4, hi45, lo45, hi5, lo5, hi6, lo6, hi7, lo7, hi8, lo8)\
static inline void \
brw_inst_set_##name(const struct brw_context *brw, \
- struct brw_instruction *inst, uint64_t value) \
+ brw_inst *inst, uint64_t value) \
{ \
BOUNDS(hi4, lo4, hi45, lo45, hi5, lo5, hi6, lo6, hi7, lo7, hi8, lo8) \
brw_inst_set_bits(inst, high, low, value); \
} \
static inline uint64_t \
-brw_inst_##name(const struct brw_context *brw, struct brw_instruction *inst) \
+brw_inst_##name(const struct brw_context *brw, brw_inst *inst) \
{ \
BOUNDS(hi4, lo4, hi45, lo45, hi5, lo5, hi6, lo6, hi7, lo7, hi8, lo8) \
return brw_inst_bits(inst, high, low); \
*/
static inline void
brw_inst_set_uip(const struct brw_context *brw,
- struct brw_instruction *inst, int32_t value)
+ brw_inst *inst, int32_t value)
{
assert(brw->gen >= 6);
}
static inline int32_t
-brw_inst_uip(const struct brw_context *brw, struct brw_instruction *inst)
+brw_inst_uip(const struct brw_context *brw, brw_inst *inst)
{
assert(brw->gen >= 6);
static inline void
brw_inst_set_jip(const struct brw_context *brw,
- struct brw_instruction *inst, int32_t value)
+ brw_inst *inst, int32_t value)
{
assert(brw->gen >= 6);
}
static inline int32_t
-brw_inst_jip(const struct brw_context *brw, struct brw_instruction *inst)
+brw_inst_jip(const struct brw_context *brw, brw_inst *inst)
{
assert(brw->gen >= 6);
* @{
*/
static inline int
-brw_inst_imm_d(const struct brw_context *brw, struct brw_instruction *insn)
+brw_inst_imm_d(const struct brw_context *brw, brw_inst *insn)
{
return brw_inst_bits(insn, 127, 96);
}
static inline unsigned
-brw_inst_imm_ud(const struct brw_context *brw, struct brw_instruction *insn)
+brw_inst_imm_ud(const struct brw_context *brw, brw_inst *insn)
{
return brw_inst_bits(insn, 127, 96);
}
static inline float
-brw_inst_imm_f(const struct brw_context *brw, struct brw_instruction *insn)
+brw_inst_imm_f(const struct brw_context *brw, brw_inst *insn)
{
fi_type ft;
ft.u = brw_inst_bits(insn, 127, 96);
static inline void
brw_inst_set_imm_d(const struct brw_context *brw,
- struct brw_instruction *insn, int value)
+ brw_inst *insn, int value)
{
return brw_inst_set_bits(insn, 127, 96, value);
}
static inline void
brw_inst_set_imm_ud(const struct brw_context *brw,
- struct brw_instruction *insn, unsigned value)
+ brw_inst *insn, unsigned value)
{
return brw_inst_set_bits(insn, 127, 96, value);
}
static inline void
brw_inst_set_imm_f(const struct brw_context *brw,
- struct brw_instruction *insn, float value)
+ brw_inst *insn, float value)
{
fi_type ft;
ft.f = value;
#define BRW_IA1_ADDR_IMM(reg, g4_high, g4_low, g8_nine, g8_high, g8_low) \
static inline void \
brw_inst_set_##reg##_ia1_addr_imm(const struct brw_context *brw, \
- struct brw_instruction *inst, \
+ brw_inst *inst, \
unsigned value) \
{ \
assert((value & ~0x3ff) == 0); \
} \
static inline unsigned \
brw_inst_##reg##_ia1_addr_imm(const struct brw_context *brw, \
- struct brw_instruction *inst) \
+ brw_inst *inst) \
{ \
if (brw->gen >= 8) { \
return brw_inst_bits(inst, g8_high, g8_low) | \
#define BRW_IA16_ADDR_IMM(reg, g4_high, g4_low, g8_nine, g8_high, g8_low) \
static inline void \
brw_inst_set_##reg##_ia16_addr_imm(const struct brw_context *brw, \
- struct brw_instruction *inst, \
- unsigned value) \
+ brw_inst *inst, unsigned value) \
{ \
assert((value & ~0x3ff) == 0); \
if (brw->gen >= 8) { \
} \
static inline unsigned \
brw_inst_##reg##_ia16_addr_imm(const struct brw_context *brw, \
- struct brw_instruction *inst) \
+ brw_inst *inst) \
{ \
if (brw->gen >= 8) { \
return brw_inst_bits(inst, g8_high, g8_low) | \
* Bits indices range from 0..127; fields may not cross 64-bit boundaries.
*/
static inline uint64_t
-brw_inst_bits(struct brw_instruction *insn, unsigned high, unsigned low)
+brw_inst_bits(brw_inst *inst, unsigned high, unsigned low)
{
- brw_inst *inst = (brw_inst *) insn;
-
/* We assume the field doesn't cross 64-bit boundaries. */
const unsigned word = high / 64;
assert(word == low / 64);
* Bits indices range from 0..127; fields may not cross 64-bit boundaries.
*/
static inline void
-brw_inst_set_bits(struct brw_instruction *insn,
- unsigned high, unsigned low,
- uint64_t value)
+brw_inst_set_bits(brw_inst *inst, unsigned high, unsigned low, uint64_t value)
{
- brw_inst *inst = (brw_inst *) insn;
-
const unsigned word = high / 64;
assert(word == low / 64);
/* Instruction format for the execution units:
*/
-struct brw_instruction
-{
- uint64_t data[2];
-};
-
struct brw_compact_instruction {
struct {
unsigned opcode:7; /* 0- 6 */
/* Each of the 8 channel enables is considered for whether each
* dword is written.
*/
- struct brw_instruction *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, send, dst);
brw_set_src0(p, send, header);
if (brw->gen < 6)
/* Each of the 8 channel enables is considered for whether each
* dword is written.
*/
- struct brw_instruction *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, send, dst);
brw_set_src0(p, send, header);
if (brw->gen < 6)
/* Each of the 8 channel enables is considered for whether each
* dword is written.
*/
- struct brw_instruction *send = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *send = brw_next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, send, dst);
brw_set_src0(p, send, header);
if (brw->gen < 6)
assert(surf_index.file == BRW_IMMEDIATE_VALUE &&
surf_index.type == BRW_REGISTER_TYPE_UD);
- brw_instruction *insn = brw_next_insn(p, BRW_OPCODE_SEND);
+ brw_inst *insn = brw_next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, insn, dst);
brw_set_src0(p, insn, offset);
brw_set_sampler_message(p, insn,
assert(brw->gen == 6);
gen6_IF(p, inst->conditional_mod, src[0], src[1]);
} else {
- struct brw_instruction *if_inst = brw_IF(p, BRW_EXECUTE_8);
+ brw_inst *if_inst = brw_IF(p, BRW_EXECUTE_8);
brw_inst_set_pred_control(brw, if_inst, inst->predicate);
}
break;
!"conditional_mod, no_dd_check, or no_dd_clear set for IR "
"emitting more than 1 instruction");
- struct brw_instruction *last = &p->store[pre_emit_nr_insn];
+ brw_inst *last = &p->store[pre_emit_nr_insn];
if (inst->conditional_mod)
brw_inst_set_cond_modifier(brw, last, inst->conditional_mod);
#include "brw_eu.h"
static bool
-test_compact_instruction(struct brw_compile *p, struct brw_instruction src)
+test_compact_instruction(struct brw_compile *p, brw_inst src)
{
struct brw_context *brw = p->brw;
memset(&dst, 0xd0, sizeof(dst));
if (brw_try_compact_instruction(p, &dst, &src)) {
- struct brw_instruction uncompacted;
+ brw_inst uncompacted;
brw_uncompact_instruction(brw, &uncompacted, &dst);
if (memcmp(&uncompacted, &src, sizeof(src))) {
* become meaningless once fuzzing twiddles a related bit.
*/
static void
-clear_pad_bits(const struct brw_context *brw, struct brw_instruction *inst)
+clear_pad_bits(const struct brw_context *brw, brw_inst *inst)
{
if (brw_inst_opcode(brw, inst) != BRW_OPCODE_SEND &&
brw_inst_opcode(brw, inst) != BRW_OPCODE_SENDC &&
}
static bool
-skip_bit(const struct brw_context *brw, struct brw_instruction *src, int bit)
+skip_bit(const struct brw_context *brw, brw_inst *src, int bit)
{
/* pad bit */
if (bit == 7)
}
static bool
-test_fuzz_compact_instruction(struct brw_compile *p,
- struct brw_instruction src)
+test_fuzz_compact_instruction(struct brw_compile *p, brw_inst src)
{
for (int bit0 = 0; bit0 < 128; bit0++) {
if (skip_bit(p->brw, &src, bit0))
continue;
for (int bit1 = 0; bit1 < 128; bit1++) {
- struct brw_instruction instr = src;
+ brw_inst instr = src;
uint32_t *bits = (uint32_t *)&instr;
if (skip_bit(p->brw, &src, bit1))
brw_push_insn_state(p);
brw_set_default_predicate_control(p, true);
- struct brw_instruction *mov = brw_MOV(p, g0, g2);
+ brw_inst *mov = brw_MOV(p, g0, g2);
brw_inst_set_flag_subreg_nr(p->brw, mov, 1);
brw_pop_insn_state(p);
}