[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 8/9] decodetree: Drop check for less than 2 patterns in a group
From: |
Richard Henderson |
Subject: |
[PULL 8/9] decodetree: Drop check for less than 2 patterns in a group |
Date: |
Tue, 9 Jun 2020 09:25:03 -0700 |
While it makes little sense for the end product to have a group
containing only a single pattern, avoiding this case within an
incremental patch set is troublesome.
Because this is expected to be a transient condition, do not
bother "optimizing" this case, e.g. by folding away the group.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tests/decode/succ_pattern_group_nest4.decode | 13 +++++++++++++
scripts/decodetree.py | 2 --
2 files changed, 13 insertions(+), 2 deletions(-)
create mode 100644 tests/decode/succ_pattern_group_nest4.decode
diff --git a/tests/decode/succ_pattern_group_nest4.decode
b/tests/decode/succ_pattern_group_nest4.decode
new file mode 100644
index 0000000000..dc54a1d285
--- /dev/null
+++ b/tests/decode/succ_pattern_group_nest4.decode
@@ -0,0 +1,13 @@
+# This work is licensed under the terms of the GNU LGPL, version 2 or later.
+# See the COPYING.LIB file in the top-level directory.
+
+# Verify deeper nesting, and a single element in the groups.
+{
+ [
+ {
+ [
+ sub1 00000000 a:8 b:8 c:8
+ ]
+ }
+ ]
+}
diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 7e3b1d1399..530d41ca62 100755
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -1024,8 +1024,6 @@ def parse_file(f, parent_pat):
if name == '}' or name == ']':
if len(toks) != 0:
error(start_lineno, 'extra tokens after close brace')
- if len(parent_pat.pats) < 2:
- error(lineno, 'less than two patterns within braces')
# Make sure { } and [ ] nest properly.
if (name == '}') != isinstance(parent_pat, IncMultiPattern):
--
2.25.1
- [PULL 0/9] decodetree: Add non-overlapping groups, Richard Henderson, 2020/06/09
- [PULL 2/9] decodetree: Rename MultiPattern to IncMultiPattern, Richard Henderson, 2020/06/09
- [PULL 1/9] decodetree: Tidy error_with_file, Richard Henderson, 2020/06/09
- [PULL 3/9] decodetree: Split out MultiPattern from IncMultiPattern, Richard Henderson, 2020/06/09
- [PULL 4/9] decodetree: Allow group covering the entire insn space, Richard Henderson, 2020/06/09
- [PULL 6/9] decodetree: Implement non-overlapping groups, Richard Henderson, 2020/06/09
- [PULL 5/9] decodetree: Move semantic propagation into classes, Richard Henderson, 2020/06/09
- [PULL 8/9] decodetree: Drop check for less than 2 patterns in a group,
Richard Henderson <=
- [PULL 7/9] tests/decode: Test non-overlapping groups, Richard Henderson, 2020/06/09
- [PULL 9/9] target/arm: Use a non-overlapping group for misc control, Richard Henderson, 2020/06/09
- Re: [PULL 0/9] decodetree: Add non-overlapping groups, Peter Maydell, 2020/06/11