diff options
author | Francisco Jerez <[email protected]> | 2018-01-23 19:23:20 -0800 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2019-10-11 12:24:16 -0700 |
commit | 057902dcf8d287f0b110b03f67ae33d338a7497c (patch) | |
tree | 0d7666abc6739224fecac2154d98833ff1bb44b5 /src/intel/compiler/brw_eu_compact.c | |
parent | 25dd67099df301f09ce40b8f9c5a3bbc857e367c (diff) |
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 <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_eu_compact.c')
-rw-r--r-- | src/intel/compiler/brw_eu_compact.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/intel/compiler/brw_eu_compact.c b/src/intel/compiler/brw_eu_compact.c index 14b4bf2bf7e..6198ad63ba5 100644 --- a/src/intel/compiler/brw_eu_compact.c +++ b/src/intel/compiler/brw_eu_compact.c @@ -952,7 +952,7 @@ brw_try_compact_3src_instruction(const struct gen_device_info *devinfo, #define compact_a16(field) \ brw_compact_inst_set_3src_##field(devinfo, dst, brw_inst_3src_a16_##field(devinfo, src)) - compact(opcode); + compact(hw_opcode); if (!set_3src_control_index(devinfo, dst, src)) return false; @@ -1124,7 +1124,7 @@ brw_try_compact_instruction(const struct gen_device_info *devinfo, #define compact(field) \ brw_compact_inst_set_##field(devinfo, &temp, brw_inst_##field(devinfo, src)) - compact(opcode); + compact(hw_opcode); compact(debug_control); if (!set_control_index(devinfo, &temp, src)) @@ -1301,7 +1301,7 @@ brw_uncompact_3src_instruction(const struct gen_device_info *devinfo, #define uncompact_a16(field) \ brw_inst_set_3src_a16_##field(devinfo, dst, brw_compact_inst_3src_##field(devinfo, src)) - uncompact(opcode); + uncompact(hw_opcode); set_uncompacted_3src_control_index(devinfo, dst, src); set_uncompacted_3src_source_index(devinfo, dst, src); @@ -1331,7 +1331,8 @@ brw_uncompact_instruction(const struct gen_device_info *devinfo, brw_inst *dst, memset(dst, 0, sizeof(*dst)); if (devinfo->gen >= 8 && - is_3src(devinfo, brw_compact_inst_3src_opcode(devinfo, src))) { + is_3src(devinfo, brw_opcode_decode( + devinfo, brw_compact_inst_3src_hw_opcode(devinfo, src)))) { brw_uncompact_3src_instruction(devinfo, dst, src); return; } @@ -1339,7 +1340,7 @@ brw_uncompact_instruction(const struct gen_device_info *devinfo, brw_inst *dst, #define uncompact(field) \ brw_inst_set_##field(devinfo, dst, brw_compact_inst_##field(devinfo, src)) - uncompact(opcode); + uncompact(hw_opcode); uncompact(debug_control); set_uncompacted_control(devinfo, dst, src); @@ -1587,7 +1588,8 @@ brw_compact_instructions(struct brw_codegen *p, int start_offset, if ((offset & sizeof(brw_compact_inst)) != 0 && devinfo->is_g4x){ brw_compact_inst *align = store + offset; memset(align, 0, sizeof(*align)); - brw_compact_inst_set_opcode(devinfo, align, BRW_OPCODE_NENOP); + brw_compact_inst_set_hw_opcode( + devinfo, align, brw_opcode_encode(devinfo, BRW_OPCODE_NENOP)); brw_compact_inst_set_cmpt_control(devinfo, align, true); offset += sizeof(brw_compact_inst); compacted_count--; @@ -1691,6 +1693,9 @@ brw_compact_instructions(struct brw_codegen *p, int start_offset, brw_inst_set_imm_ud(devinfo, insn, jump_compacted << shift); } break; + + default: + break; } } @@ -1702,7 +1707,8 @@ brw_compact_instructions(struct brw_codegen *p, int start_offset, if (p->next_insn_offset & sizeof(brw_compact_inst)) { brw_compact_inst *align = store + offset; memset(align, 0, sizeof(*align)); - brw_compact_inst_set_opcode(devinfo, align, BRW_OPCODE_NOP); + brw_compact_inst_set_hw_opcode( + devinfo, align, brw_opcode_encode(devinfo, BRW_OPCODE_NOP)); brw_compact_inst_set_cmpt_control(devinfo, align, true); p->next_insn_offset += sizeof(brw_compact_inst); } |