[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/5] decodetree: Do not unconditionaly return fr
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 4/5] decodetree: Do not unconditionaly return from Pattern.output_code |
Date: |
Sun, 24 Feb 2019 00:43:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 |
On 2/24/19 12:29 AM, Richard Henderson wrote:
> As a consequence, the 'return false' gets pushed up one level.
>
> This will allow us to perform some other action when the
> translator returns failure.
>
> Signed-off-by: Richard Henderson <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> scripts/decodetree.py | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/decodetree.py b/scripts/decodetree.py
> index fb9a0ab3ad..dd495096fc 100755
> --- a/scripts/decodetree.py
> +++ b/scripts/decodetree.py
> @@ -348,8 +348,8 @@ class Pattern(General):
> output(ind, self.base.extract_name(), '(&u.f_', arg, ',
> insn);\n')
> 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, ');\n')
> + output(ind, 'if (', translate_prefix, '_', self.name,
> + '(ctx, &u.f_', arg, ')) return true;\n')
> # end Pattern
>
>
> @@ -777,8 +777,8 @@ class Tree:
> output(ind, ' /* ',
> str_match_bits(innerbits, innermask), ' */\n')
> s.output_code(i + 4, extracted, innerbits, innermask)
> + output(ind, ' return false;\n')
> output(ind, '}\n')
> - output(ind, 'return false;\n')
> # end Tree
>
>
> @@ -932,6 +932,7 @@ def main():
> output(i4, '} u;\n\n')
>
> t.output_code(4, False, 0, 0)
> + output(i4, 'return false;\n')
>
> output('}\n')
>
>
- [Qemu-devel] [PATCH 0/5] decodetree enhancements, Richard Henderson, 2019/02/23
- [Qemu-devel] [PATCH 1/5] MAINTAINERS: Add scripts/decodetree.py to the TCG section, Richard Henderson, 2019/02/23
- [Qemu-devel] [RFC 6/7] target/hppa: Use pattern groups to decode OR, Richard Henderson, 2019/02/23
- [Qemu-devel] [PATCH 4/5] decodetree: Do not unconditionaly return from Pattern.output_code, Richard Henderson, 2019/02/23
- [Qemu-devel] [PATCH 3/5] decodetree: Ensure build_tree does not include values outside insnmask, Richard Henderson, 2019/02/23
- [Qemu-devel] [PATCH 2/5] decodetree: Move documentation to docs/decodetree.rst, Richard Henderson, 2019/02/23
- [Qemu-devel] [RFC 7/7] target/riscv: Use pattern groups for RVC, Richard Henderson, 2019/02/23
- [Qemu-devel] [PATCH 5/5] decodetree: Allow grouping of overlapping patterns, Richard Henderson, 2019/02/23