return resolved;
}
-static bool validate_dst_reg(struct brw_instruction *insn, struct brw_reg *reg)
+static inline int access_mode(struct brw_program_instruction *insn)
+{
+ if (IS_GENp(8))
+ return gen8_access_mode(GEN8(insn));
+ else
+ return GEN(insn)->header.access_mode;
+}
+
+static inline int exec_size(struct brw_program_instruction *insn)
+{
+ if (IS_GENp(8))
+ return gen8_exec_size(GEN8(insn));
+ else
+ return GEN(insn)->header.execution_size;
+}
+
+static bool validate_dst_reg(struct brw_program_instruction *insn, struct brw_reg *reg)
{
if (reg->address_mode == BRW_ADDRESS_DIRECT &&
- insn->header.access_mode == BRW_ALIGN_1 &&
+ access_mode(insn) == BRW_ALIGN_1 &&
reg->dw1.bits.writemask != 0 &&
reg->dw1.bits.writemask != BRW_WRITEMASK_XYZW)
{
return true;
}
-static bool validate_src_reg(struct brw_instruction *insn,
+static bool validate_src_reg(struct brw_program_instruction *insn,
struct brw_reg reg,
YYLTYPE *location)
{
if (reg.file == BRW_IMMEDIATE_VALUE)
return true;
- if (insn->header.access_mode == BRW_ALIGN_1 &&
+ if (access_mode(insn) == BRW_ALIGN_1 &&
SWIZZLE(reg) && SWIZZLE(reg) != BRW_SWIZZLE_NOOP)
{
error(location, "swizzle bits set in align1 instruction\n");
assert(reg.width >= 0 && reg.width < ARRAY_SIZE(width_for_reg));
width = width_for_reg[reg.width];
- assert(insn->header.execution_size >= 0 &&
- insn->header.execution_size < ARRAY_SIZE(execsize_for_reg));
- execsize = execsize_for_reg[insn->header.execution_size];
+ assert(exec_size(insn) >= 0 &&
+ exec_size(insn) < ARRAY_SIZE(execsize_for_reg));
+ execsize = execsize_for_reg[exec_size(insn)];
/* Register Region Restrictions */
static int set_instruction_dest(struct brw_program_instruction *instr,
struct brw_reg *dest)
{
- if (!validate_dst_reg(GEN(instr), dest))
+ if (!validate_dst_reg(instr, dest))
return 1;
/* the assembler support expressing subnr in bytes or in number of
if (advanced_flag)
reset_instruction_src_region(GEN(instr), src);
- if (!validate_src_reg(GEN(instr), src->reg, location))
+ if (!validate_src_reg(instr, src->reg, location))
return 1;
/* the assembler support expressing subnr in bytes or in number of
if (advanced_flag)
reset_instruction_src_region(GEN(instr), src);
- if (!validate_src_reg(GEN(instr), src->reg, location))
+ if (!validate_src_reg(instr, src->reg, location))
return 1;
/* the assembler support expressing subnr in bytes or in number of