From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: kbastian@mail.uni-paderborn.de, f4bug@amsat.org
Subject: [Qemu-devel] [PATCH v2 5/8] decodetree: Do not unconditionaly return from Pattern.output_code
Date: Wed, 27 Feb 2019 21:24:29 -0800 [thread overview]
Message-ID: <20190228052432.32571-6-richard.henderson@linaro.org> (raw)
In-Reply-To: <20190228052432.32571-1-richard.henderson@linaro.org>
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.
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
scripts/decodetree.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index e26d8253f2..cc5fa1a8ab 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')
--
2.17.2
next prev parent reply other threads:[~2019-02-28 5:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-28 5:24 [Qemu-devel] [PATCH v2 0/8] decodetree enhancements Richard Henderson
2019-02-28 5:24 ` [Qemu-devel] [PATCH v2 1/8] MAINTAINERS: Add scripts/decodetree.py to the TCG section Richard Henderson
2019-02-28 5:24 ` [Qemu-devel] [PATCH v2 2/8] decodetree: Move documentation to docs/devel/decodetree.rst Richard Henderson
2019-02-28 8:01 ` Bastian Koppelmann
2019-02-28 5:24 ` [Qemu-devel] [PATCH v2 3/8] decodetree: Document the usefulness of argument sets Richard Henderson
2019-02-28 8:02 ` Bastian Koppelmann
2019-02-28 5:24 ` [Qemu-devel] [PATCH v2 4/8] decodetree: Ensure build_tree does not include values outside insnmask Richard Henderson
2019-02-28 5:24 ` Richard Henderson [this message]
2019-02-28 5:24 ` [Qemu-devel] [PATCH v2 6/8] decodetree: Allow grouping of overlapping patterns Richard Henderson
2019-02-28 5:24 ` [Qemu-devel] [PATCH v2 7/8] test/decode: Add tests for PatternGroups Richard Henderson
2019-02-28 5:24 ` [Qemu-devel] [PATCH v2 8/8] decodetree: Add --static-decode option Richard Henderson
2019-02-28 5:40 ` [Qemu-devel] [PATCH 9/8] decodetree: Produce clean output for an empty input file Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190228052432.32571-6-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=f4bug@amsat.org \
--cc=kbastian@mail.uni-paderborn.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).