[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/8] decodetree: Allow group covering the entire insn space
From: |
Richard Henderson |
Subject: |
Re: [PATCH 5/8] decodetree: Allow group covering the entire insn space |
Date: |
Tue, 2 Jun 2020 08:15:57 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
On 6/2/20 7:35 AM, Peter Maydell wrote:
> On Mon, 18 May 2020 at 17:41, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> This is an edge case for sure, but the logic that disallowed
>> this case was faulty. Further, a few fixes scattered about
>> can allow this to work.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>> ...est1.decode => succ_pattern_group_nest2.decode} | 2 +-
>> scripts/decodetree.py | 14 +++++++++++---
>> 2 files changed, 12 insertions(+), 4 deletions(-)
>> rename tests/decode/{err_pattern_group_nest1.decode =>
>> succ_pattern_group_nest2.decode} (85%)
>
>> @@ -978,6 +980,12 @@ def build_tree(pats, outerbits, outermask):
>> innermask &= i.fixedmask
>>
>> if innermask == 0:
>> + # Edge condition: One pattern covers the entire insnmask
>> + if len(pats) == 1:
>> + t = Tree(outermask, innermask)
>> + t.subs.append((0, pats[0]))
>> + return t
>> +
>> text = 'overlapping patterns:'
>> for p in pats:
>> text += '\n' + p.file + ':' + str(p.lineno) + ': ' + str(p)
>
> I don't really understand this code, but does the similar
> looking build_size_tree() also need a change to handle a
> length-one pats ?
I don't think so, because in that case we'd exit earlier with
if onewidth:
return SizeLeaf(innermask, minwidth)
r~