intel/eu: Encode and decode native instruction opcodes from/to IR opcodes.

Change brw_inst_set_opcode() and brw_inst_opcode() to call
brw_opcode_encode/decode() transparently in order to translate between
hardware and IR opcodes, and update the EU compaction code in order to
do the same as needed, so we can eventually drop the one-to-one
correspondence between hardware and IR opcodes.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Francisco Jerez
2018-01-23 19:23:20 -08:00
parent 25dd67099d
commit 057902dcf8
7 changed files with 41 additions and 15 deletions

View File

@@ -310,6 +310,8 @@ inst_uses_src_acc(const struct gen_device_info *devinfo, const brw_inst *inst)
case BRW_OPCODE_MACH:
case BRW_OPCODE_SADA2:
return true;
default:
break;
}
/* FIXME: support 3-src instructions */
@@ -389,7 +391,7 @@ static bool
is_unsupported_inst(const struct gen_device_info *devinfo,
const brw_inst *inst)
{
return brw_opcode_desc(devinfo, brw_inst_opcode(devinfo, inst)) == NULL;
return brw_inst_opcode(devinfo, inst) == BRW_OPCODE_ILLEGAL;
}
/**