mirror of
https://github.com/Ed94/perfaware.git
synced 2026-09-14 03:39:23 +00:00
simplifcation of encoding table, properly define compositionaly various encoding definitions.
This commit is contained in:
@@ -97,6 +97,13 @@ x8616_decode_gen_plan(X8616_Encoding_R encoding, U4 encoding_idx, X8616_InfoList
|
||||
if (encoding->fields.z.width) { plan.flags |= x8616_plan_has_z; plan.z_shift = encoding->fields.z.shift; }
|
||||
if (encoding->fields.reg.width) { plan.flags |= x8616_plan_has_reg; plan.reg_shift = encoding->fields.reg.shift; }
|
||||
if (encoding->fields.sr.width) { plan.flags |= x8616_plan_has_sr; plan.sr_shift = encoding->fields.sr.shift; }
|
||||
if (encoding->fields.alu.width) {
|
||||
plan.flags |= x8616_plan_has_alu;
|
||||
plan.alu_shift = encoding->fields.alu.shift;
|
||||
if ((plan.flags & x8616_plan_has_modrm) && encoding->fields.d.width == 0)
|
||||
plan.flags |= x8616_plan_alu_modrm;
|
||||
}
|
||||
if (encoding->fields.cc.width) { plan.flags |= x8616_plan_has_cc; plan.cc_shift = encoding->fields.cc.shift; }
|
||||
|
||||
if (x8616_decode_gen_operand_uses_rm(encoding->operands[0]) || x8616_decode_gen_operand_uses_rm(encoding->operands[1]))
|
||||
plan.flags |= x8616_plan_uses_rm;
|
||||
@@ -328,7 +335,8 @@ x8616_decode_gen_emit_plan(Str8Gen_R out, X8616_DecodePlan_R plan) { defer_rewin
|
||||
<payload>, <prefix_kind>,
|
||||
<d_shift>, <w_shift>, <s_shift>, <v_shift>, <z_shift>, <reg_shift>, <sr_shift>,
|
||||
{<mod_rm.bits>, <mod_rm.mask>},
|
||||
{<post_opcode.bits>, <post_opcode.mask>},
|
||||
{<post_opcode.bits>, <post_opcode.mask>},
|
||||
<alu_shift>, <cc_shift>,
|
||||
},\n
|
||||
);
|
||||
KTL_Slot_Str8 tbl[] = {
|
||||
@@ -352,6 +360,8 @@ x8616_decode_gen_emit_plan(Str8Gen_R out, X8616_DecodePlan_R plan) { defer_rewin
|
||||
entry("mod_rm.mask", hex_u1(plan->mod_rm.mask)),
|
||||
entry("post_opcode.bits", hex_u1(plan->post_opcode.bits)),
|
||||
entry("post_opcode.mask", hex_u1(plan->post_opcode.mask)),
|
||||
entry("alu_shift", dec(plan->alu_shift)),
|
||||
entry("cc_shift", dec(plan->cc_shift)),
|
||||
};
|
||||
str8gen_append_fmt(out, template, ktl_str8_from_arr(tbl));
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user