Skip to content

Commit

Permalink
decodetree: Remove "insn" argument from trans_* expanders
Browse files Browse the repository at this point in the history
This allows trans_* expanders to be shared between decoders
for 32 and 16-bit insns, by not tying the expander to the
size of the insn that produced it.

This change requires adjusting the two existing users to match.

Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
  • Loading branch information
rth7680 committed Oct 31, 2018
1 parent abd04f9 commit 3a7be55
Show file tree
Hide file tree
Showing 4 changed files with 357 additions and 378 deletions.
5 changes: 2 additions & 3 deletions scripts/decodetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,7 @@ def output_decl(self):
output('typedef ', self.base.base.struct_name(),
' arg_', self.name, ';\n')
output(translate_scope, 'bool ', translate_prefix, '_', self.name,
'(DisasContext *ctx, arg_', self.name,
' *a, ', insntype, ' insn);\n')
'(DisasContext *ctx, arg_', self.name, ' *a);\n')

def output_code(self, i, extracted, outerbits, outermask):
global translate_prefix
Expand All @@ -479,7 +478,7 @@ def output_code(self, i, extracted, outerbits, outermask):
for n, f in self.fields.items():
output(ind, 'u.f_', arg, '.', n, ' = ', f.str_extract(), ';\n')
output(ind, 'return ', translate_prefix, '_', self.name,
'(ctx, &u.f_', arg, ', insn);\n')
'(ctx, &u.f_', arg, ');\n')
# end Pattern


Expand Down
Loading

0 comments on commit 3a7be55

Please sign in to comment.