From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820310; cv=none; d=zohomail.com; s=zohoarc; b=AbsIQFHAZPtL7tOepVU8osXQuLpo8iV7YbYizNBkY9c5qxHBwaWwhOKK21Hrd2VptpgWmZMuo/YyqdxGBFEye01r6Y9MH7MPpTBsDerpAwQgt1ss03Bn8VobSO9EnPmhJ+OJkc9bhkhT4xx7tnkU5/ZCZ027KGvFd9fD0WIsMzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820310; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uFTRRQZQW7zKIC58JAMoD76cKh/Xgd23HtxsN8e+2Qk=; b=Vsdo+dxvwu2XEFvoJkXA6VeOAvwkq9Kmhy7EUSBfp5J2lVGVnqwClQYVK4OUhYydpHtBjqQqrzVYIvx13RPuuesA1+1wqWNoK26nOQ9p0Mm3vPkV6xlhUfw0dtZ4bcXtLlaO7mACzLjH8rkoGNQ/KZEnDb7TdZzTDtqpzfXqWoA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589820310472743.8110856462802; Mon, 18 May 2020 09:45:10 -0700 (PDT) Received: from localhost ([::1]:32940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jait3-0000Xv-1R for importer@patchew.org; Mon, 18 May 2020 12:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaip0-0001wB-Lh for qemu-devel@nongnu.org; Mon, 18 May 2020 12:40:58 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:36861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaioz-0005pH-Kg for qemu-devel@nongnu.org; Mon, 18 May 2020 12:40:58 -0400 Received: by mail-pl1-x630.google.com with SMTP id f15so4451133plr.3 for ; Mon, 18 May 2020 09:40:57 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uFTRRQZQW7zKIC58JAMoD76cKh/Xgd23HtxsN8e+2Qk=; b=BN6CrBuU1DRAEwPUwW5flubL4z1nKZQ9L5ZB+miR0mfZ9zyNi3WpsQhKOhc7tl6jJ+ qZlIKK1Vwe1JLQJCtkvVCxAbqCMCm1VdVcV7vQemfaokSSJQEG60EUxIMJhxlmysVP/x E1KEaYXfYsFm9jQExDtslSPn6R12iI6Rm9iJk3CF2AUplAiqcheD8uuFROnOFvHrdeYt BsGlrBQ2rM4lwp0ayNXwmj52XvB3iqxj4eBkANgrBXWdI8n7ZvIdeLEyu2+++OtvzVkA ZIutUpJFGIpotVWYnitksSKQjZMhfOp+/OvHaC4hOSOLtuEBfVh4lZnU6DVlNbEFEIeC ETnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uFTRRQZQW7zKIC58JAMoD76cKh/Xgd23HtxsN8e+2Qk=; b=VXtrc8Fmqi0cZ1CP5Ew1EULcCBMqMetbrP6AHPDetUfQ6mTBOKdw4jCASmMYDfNVUb 5KwRL4AN8yhuY3h3LQspk6PimdHPcQn2OgUjhRC0D76QCuVXPz4vXlR3KkXE3ycMUql0 Yoez5gxVQKTEuAD74YVlmdAm2/QlR3Hl4/YBzA4lf6kAvo7syE2JM/Bk8T+nXFp1ED7e wkN2H2KnueAM+TsLUq1YBQq1ABQIpT8BmfJyIb+FfG/CQfqbM9lr1Juu1L4hOtr0hiNA r8cBeP1JzOQl0D6jscAzK51kdxn3o4u39YTUMgWpZoCrQ0MpX8phWV1fzB5/un9unwA1 Jizg== X-Gm-Message-State: AOAM532OMBxHXoVYTTKrNB5jSjWQmTKgeDi9T3hxYZf7ZtVzDfmvl/Vd rDsNH0PcIU4hdpB0ngTAmu/opCrbqhc= X-Google-Smtp-Source: ABdhPJxuvDc/OGdYTXzl1bkX6q3cHugxdzrF/UVGZSOivxc+94gDcMqyOIo559rW5z7KFtLyma+emQ== X-Received: by 2002:a17:90a:8c01:: with SMTP id a1mr255381pjo.127.1589820055721; Mon, 18 May 2020 09:40:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/8] decodetree: Remove python 3.4 check Date: Mon, 18 May 2020 09:40:45 -0700 Message-Id: <20200518164052.18689-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" We are now guaranteed python 3.5 or later. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/decodetree.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 46ab917807..f9d204aa36 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -75,13 +75,6 @@ def output(*args): output_fd.write(a) =20 =20 -if sys.version_info >=3D (3, 4): - re_fullmatch =3D re.fullmatch -else: - def re_fullmatch(pat, str): - return re.match('^' + pat + '$', str) - - def output_autogen(): output('/* This file is autogenerated by scripts/decodetree.py. */\n\= n') =20 @@ -428,18 +421,18 @@ def parse_field(lineno, name, toks): width =3D 0 func =3D None for t in toks: - if re_fullmatch('!function=3D' + re_ident, t): + if re.fullmatch('!function=3D' + re_ident, t): if func: error(lineno, 'duplicate function') func =3D t.split('=3D') func =3D func[1] continue =20 - if re_fullmatch('[0-9]+:s[0-9]+', t): + if re.fullmatch('[0-9]+:s[0-9]+', t): # Signed field extract subtoks =3D t.split(':s') sign =3D True - elif re_fullmatch('[0-9]+:[0-9]+', t): + elif re.fullmatch('[0-9]+:[0-9]+', t): # Unsigned field extract subtoks =3D t.split(':') sign =3D False @@ -488,11 +481,11 @@ def parse_arguments(lineno, name, toks): flds =3D [] extern =3D False for t in toks: - if re_fullmatch('!extern', t): + if re.fullmatch('!extern', t): extern =3D True anyextern =3D True continue - if not re_fullmatch(re_ident, t): + if not re.fullmatch(re_ident, t): error(lineno, 'invalid argument set token "{0}"'.format(t)) if t in flds: error(lineno, 'duplicate argument "{0}"'.format(t)) @@ -621,13 +614,13 @@ def parse_generic(lineno, is_format, name, toks): continue =20 # 'Foo=3D%Bar' imports a field with a different name. - if re_fullmatch(re_ident + '=3D%' + re_ident, t): + if re.fullmatch(re_ident + '=3D%' + re_ident, t): (fname, iname) =3D t.split('=3D%') flds =3D add_field_byname(lineno, flds, fname, iname) continue =20 # 'Foo=3Dnumber' sets an argument field to a constant value - if re_fullmatch(re_ident + '=3D[+-]?[0-9]+', t): + if re.fullmatch(re_ident + '=3D[+-]?[0-9]+', t): (fname, value) =3D t.split('=3D') value =3D int(value) flds =3D add_field(lineno, flds, fname, ConstField(value)) @@ -635,7 +628,7 @@ def parse_generic(lineno, is_format, name, toks): =20 # Pattern of 0s, 1s, dots and dashes indicate required zeros, # required ones, or dont-cares. - if re_fullmatch('[01.-]+', t): + if re.fullmatch('[01.-]+', t): shift =3D len(t) fms =3D t.replace('0', '1') fms =3D fms.replace('.', '0') @@ -652,7 +645,7 @@ def parse_generic(lineno, is_format, name, toks): fixedmask =3D (fixedmask << shift) | fms undefmask =3D (undefmask << shift) | ubm # Otherwise, fieldname:fieldwidth - elif re_fullmatch(re_ident + ':s?[0-9]+', t): + elif re.fullmatch(re_ident + ':s?[0-9]+', t): (fname, flen) =3D t.split(':') sign =3D False if flen[0] =3D=3D 's': --=20 2.20.1 From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820436; cv=none; d=zohomail.com; s=zohoarc; b=F6faMDBG09KTuPWjS0X0UWobpHo7AnWsza4kTvTPWnncDbUIXLI7ZqQCgJzoql1kmQgiIuL75wpmS77NPyCv4QLds/hLofXijtdkU4socDG2+o4FzY97jBW0G5qHBWQnOWuRe7djkeYCpRURVSrmoQ9SqQMfY7Hg0fw9knPoxN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820436; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=23ujhSNHwAa6m2PV/44zvOLpUgf1M+P1yqoPvCdPMfY=; b=YQ/ZuOvXjaFHwXWnfYUTvLx2dPJg9JzYqqEJOOs+7s1/K73aLJn9xOwRtiy+yLZ6nSVIeu+Fx9SrlHDtzlIM+VsEArz+45VjHrK7uKjcXHsm8a83aaohNV2LTaqYSdndVNcNQZhRMqjtLyQFu8+f484LlWvYBo73SFE6aggdlB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589820436560666.4930032446964; Mon, 18 May 2020 09:47:16 -0700 (PDT) Received: from localhost ([::1]:39040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaiv5-0003Fx-9I for importer@patchew.org; Mon, 18 May 2020 12:47:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaip2-0001yt-Ak for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:00 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:50989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaip1-0005pj-73 for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:00 -0400 Received: by mail-pj1-x102e.google.com with SMTP id nu7so84693pjb.0 for ; Mon, 18 May 2020 09:40:58 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=23ujhSNHwAa6m2PV/44zvOLpUgf1M+P1yqoPvCdPMfY=; b=e9Cv00AaKl1LCY9WqohCEiRKz1OrlndQHn+JPCOweENat+0toMfJxMg5CumlBmXvxd hUC5RLplZiB4EFPPexZIsv4hDojSJ4qlB9ftV6GfWwFoDRiUVhmvl+qdtm6AYXLYJjq7 KpVTeE1YzZ8qjM0/Bc2c65CcZivBPJjcjzD+WDBSdkpxuaAfgVo23oFfeGDixC/IE18i DZo9w+zKUrVx4LpWtv33/Cx2WwNTIEutYFiTV6lSJPYPTtjgDMa4K8BDXNpVIrZP6nOf kOHE/EEXo/shb/yBgMVWrnT3aDSbu89DDsRmjzF3oylNXcUs7Peb9SWesRKARk+YVr86 wIbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=23ujhSNHwAa6m2PV/44zvOLpUgf1M+P1yqoPvCdPMfY=; b=RnuL0hFz+PvkwrtkgHpSWlcL+bScrQeDTDylQr+ZlcfLPHO/NPRNRp7oBU6fh3D+eZ InO34UgW3mFZyCWjVMxDlhNdFD9Eve42M9pD5WMHm8PqplVkNDWaoD5BmR61V6J9A69e vbFs3otgcoxmkzAl1iCpaGbWH3ekXMGTeGdNY0aun1Gi6LP7nboOOTs6qdawOlvT6JEH NzNTQVECu7n+QfgpdyyvuxG0oeJCILRXPKA5+ZPcX1OnDSeKZ/G2z3pVlRBptc3UkSUV 0rx2O06GzwosMGi98M7fwpYc9bLSZYQXYhKZc/AmNKUVvXgHtlG2McNjpJTgLyBXoosJ oAXQ== X-Gm-Message-State: AOAM531cygHL5pooGbkgknDOPVushe1//3I1NirWmX9xb0GVEDWykFEM aVY9kpT6RB0BnZaY3fiD/dUBL9s2jcw= X-Google-Smtp-Source: ABdhPJyV4aVyh8kLIouKAbUVdQbIZS7R9friQa7pJTK0HlWF3K2n9Fi7xx/ZcVQkh4sb1qYQJxPGSg== X-Received: by 2002:a17:902:6949:: with SMTP id k9mr17288565plt.47.1589820057328; Mon, 18 May 2020 09:40:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/8] decodetree: Tidy error_with_file Date: Mon, 18 May 2020 09:40:46 -0700 Message-Id: <20200518164052.18689-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Use proper varargs to print the arguments. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- scripts/decodetree.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index f9d204aa36..b559db3086 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -51,23 +51,27 @@ def error_with_file(file, lineno, *args): global output_file global output_fd =20 + prefix =3D '' + if file: + prefix +=3D '{0}:'.format(file) if lineno: - r =3D '{0}:{1}: error:'.format(file, lineno) - elif input_file: - r =3D '{0}: error:'.format(file) - else: - r =3D 'error:' - for a in args: - r +=3D ' ' + str(a) - r +=3D '\n' - sys.stderr.write(r) + prefix +=3D '{0}:'.format(lineno) + if prefix: + prefix +=3D ' ' + print(prefix, end=3D'error: ', file=3Dsys.stderr) + print(*args, file=3Dsys.stderr) + if output_file and output_fd: output_fd.close() os.remove(output_file) exit(1) +# end error_with_file + =20 def error(lineno, *args): - error_with_file(input_file, lineno, args) + error_with_file(input_file, lineno, *args) +# end error + =20 def output(*args): global output_fd --=20 2.20.1 From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820202; cv=none; d=zohomail.com; s=zohoarc; b=b/j73RZyC8JuPCRS6ONoYveiKdnenm8xwWyFyD/aGg/eEZ2uZ3i65uffK/gFGwnAxD8ZRIpzSodKpDR6Nt4h/SwYCukBToBW6x/6safbQVkA/O5ZYpEODD4sY8PbZqHz4+06mEAbwiUmVg+HDFpTxCEOXOumEIkCIQ6uNwjj3fQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820202; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mRcK8czV/oom/pkIx79cPTpR+Nhj4Hg+rOsk6vM94j4=; b=Z65eWVkcaWTWl0/01/2yuWcsQ5NZ5ZvfrQ8Jy43c5r9E5nb6apNnkXWzRqLZ9rGASFjw5CqVZcxkiHaax5thWuQjshL78M0mx59gO9bdFSySCicRQmwnUNkMHCzfj/+uBpe5Qe1mcV5WpxEuw6v8j2jONWS9/YpVFjs/5toXZdQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589820202642756.8358041774383; Mon, 18 May 2020 09:43:22 -0700 (PDT) Received: from localhost ([::1]:55032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jairJ-0006I7-9o for importer@patchew.org; Mon, 18 May 2020 12:43:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaip3-000212-CR for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:01 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:34692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaip2-0005pw-GJ for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:01 -0400 Received: by mail-pl1-x62b.google.com with SMTP id g11so4453983plp.1 for ; Mon, 18 May 2020 09:41:00 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mRcK8czV/oom/pkIx79cPTpR+Nhj4Hg+rOsk6vM94j4=; b=cNbsIj9eglGL5hwv9PKqKn/U1sEOD3nRLjBRyV0j8hserxzrN3sLVX3BM3R+jJRLX3 eVCpcWHep/pXovhC84H+1dLpsjkChFKlXNUuBLpqMzidhMXrXC24XX65QDSQqQkx4yE7 VJdPUkUjFR1AMzYVd1DJCBCU3+hhH1heQTZ443oFqQVNuZ57aHon2+nTIL3VVuYL+kI1 ETVQpuV/EgNFIbDzwM1V/30RV/53hlAQ1xH4Cl9csYFt/b+/K2jDXP1WRNmOLImkYur/ OT9oKQ3fiolNVgQ7iSB4+ODMBi2UVOYX5esqWjZmkgxEIBLAJld9QUqE5xCK+Zi3o8kn u2lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mRcK8czV/oom/pkIx79cPTpR+Nhj4Hg+rOsk6vM94j4=; b=rpRpBqtv5Y6JWPF6pvMeDfKz7VpHOhQ3FdKVcYFFQJtDnyJ9DMNd7r+vO1jd1hX/fx 92XRpEp07+083JpawjgkesFqrN1ahcBKe+DmFzfJgCvAxyHkKIvSI1GAOhAyDJ0purIY 6DmLB5Vkv9x1FKAcd7FCNsDbsXL5XXMNN6h5kbQeElgtPxrn4pNwrQNw1xSMPOJe1OTo 6yU/Zj31STWKW0Cj4HD+xSZHLPfSc7PBOZzLwZ1Ovh4s/PBu4eGJsaU1ZTYLVtd0/c8f ijxFMnjhR4dYhtziyihD6foWyiaQ0d3ueIi2VXABj1hQ+Y6pBqGKnMDsQaIHFBW4qu87 gQFw== X-Gm-Message-State: AOAM5319HVo2tIFgAb8sUsNSsv2P0ozTZZjc5R0WJ9p5+VxukyFjYWOG HeyZyvfHhMVnK/faCQG5MIQZOYx/c+c= X-Google-Smtp-Source: ABdhPJyPHWxMOxYfyRF+BHa8WEmZOSrv9LDtSAXdNWqV971szryGbNrxyNZDGHeO8a0SM7liM+4AzQ== X-Received: by 2002:a17:90a:a402:: with SMTP id y2mr291192pjp.24.1589820058605; Mon, 18 May 2020 09:40:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/8] decodetree: Rename MultiPattern to IncMultiPattern Date: Mon, 18 May 2020 09:40:47 -0700 Message-Id: <20200518164052.18689-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Name the current node for "inclusive" multi-pattern, in preparation for adding a node for "exclusive" multi-pattern. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/decodetree.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index b559db3086..7af6b3056d 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -371,7 +371,7 @@ class Pattern(General): # end Pattern =20 =20 -class MultiPattern(General): +class IncMultiPattern(General): """Class representing an overlapping set of instruction patterns""" =20 def __init__(self, lineno, pats, fixb, fixm, udfm, w): @@ -410,7 +410,7 @@ class MultiPattern(General): output(ind, '}\n') else: p.output_code(i, extracted, p.fixedbits, p.fixedmask) -#end MultiPattern +#end IncMultiPattern =20 =20 def parse_field(lineno, name, toks): @@ -751,8 +751,8 @@ def parse_generic(lineno, is_format, name, toks): .format(allbits ^ insnmask)) # end parse_general =20 -def build_multi_pattern(lineno, pats): - """Validate the Patterns going into a MultiPattern.""" +def build_incmulti_pattern(lineno, pats): + """Validate the Patterns going into a IncMultiPattern.""" global patterns global insnmask =20 @@ -792,9 +792,9 @@ def build_multi_pattern(lineno, pats): else: repeat =3D False =20 - mp =3D MultiPattern(lineno, pats, fixedbits, fixedmask, undefmask, wid= th) + mp =3D IncMultiPattern(lineno, pats, fixedbits, fixedmask, undefmask, = width) patterns.append(mp) -# end build_multi_pattern +# end build_incmulti_pattern =20 def parse_file(f): """Parse all of the patterns within a file""" @@ -860,7 +860,7 @@ def parse_file(f): error(start_lineno, 'indentation ', indent, ' !=3D ', nest= ing) pats =3D patterns patterns =3D saved_pats.pop() - build_multi_pattern(lineno, pats) + build_incmulti_pattern(lineno, pats) toks =3D [] continue =20 --=20 2.20.1 From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820303; cv=none; d=zohomail.com; s=zohoarc; b=B7yiTv4Lou4c/js6cRH8UbrFJNAwWexS543AmWTKe20Syags4EReWLXn+fY0uLh8vEAOm5yirvBJ+Du1+xQuhXvWg4KDu7NvtKipnSeihf5vBDQNmXv82h88cQWgHIKN1IIGoovGPb7u/lURGM4ZROlGHrz8Ymez90yPReEmwn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820303; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DXF5hhG17BDEOETPzoe+bSK9+O1lQ05HYEEgNG7hh+w=; b=fNXshTgbzmLLUmRT8K2pevy3ZQndWIgOLgvmozwR+/UPEfVpQrjYVqvj9YN5IOSLoStMHG+IVLsfw/vElmeF8T/22Crdh93JGTrtDnUoshFVy+xCC59UVYXg0sXVDsYvAhmtg4chhIroTvX9fI6F+wZMIgN3tyDF7gcPHVg0Dvg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589820303587578.6996029651741; Mon, 18 May 2020 09:45:03 -0700 (PDT) Received: from localhost ([::1]:60818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaisw-0000Os-2r for importer@patchew.org; Mon, 18 May 2020 12:45:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaip5-00025C-LA for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:03 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:46135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaip4-0005qu-ME for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:03 -0400 Received: by mail-pl1-x629.google.com with SMTP id b12so4430219plz.13 for ; Mon, 18 May 2020 09:41:02 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DXF5hhG17BDEOETPzoe+bSK9+O1lQ05HYEEgNG7hh+w=; b=FjihzZwM2wYtERi0Zws7yos2C7KGw20k78/MJFU1LrZ+TmbscZxA63HJVgPAJsmHFp F4FBLdZqtGUGycqOLe8S7ZaVCK6hpDvQZ+M+0q7u6KiRhn1z2XVGh2qRmPQoZ7Zp3zL6 DHScloroEExBlpVlx7ZUTHKQBMYe/lAE1MbsNks1Dw4epwKA1TfwDT1LPOqnjcstQFeg C7HqdDxicOgVUoNNtmlBj+GnH15B5bP1u+dIB6iqIoNf33MQL5iGWWNbwK2NzHd8x6i6 yMFc2hmZPaRISftqap7jE0VpMTxqls3hSKI8B0OxMZBd5dJnpmdU2LsuOAGTg3ga6SEg TkSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DXF5hhG17BDEOETPzoe+bSK9+O1lQ05HYEEgNG7hh+w=; b=XwW+f5EMJv/IIxd0fHYtyM2UswB3Bt5MIhU2FZjA+T+MwjxONN6Uc3JSQt75xBcqa1 iD3KzwPHXGMPj1FeL4pvvqqUEnJ7HpJGD7fDP4zEfqWpDELoKyRqMO9GHuwTnHNHtsj9 9kajFeNz0Za+WQE/kh+gMF5Ir+gpv4TQid0zgqnEeo+31MmYy0SCaXTTG1bJhDQ+7uAn RoCiAuvxGAnrvRk0op1B2X4E18epCozZS4ktmUR6sSq+rgBOGfOyPP+EN7oUSHmO2FSb G/+m2MobmYwEpu7RY0lN3ZhLQ2EMt4qtJyxZpkPA9eeI9lgebIZna7XiBm6uL4IGxQ5z +DSw== X-Gm-Message-State: AOAM530A0Pm8FSb/0z80ORsGhSdwaNc5+i3oQlDNkCpVbXwPBSl92MqT DXPEdNWZD0ojgmGPCQJg1zlvpf8W/5A= X-Google-Smtp-Source: ABdhPJynd/2Be65qIgIa3vW4+ZGuWClcnIbZKlqM5zJMqMaeLiHdBgLxJ66ZQHfzAV8SlKX2Qg0fiw== X-Received: by 2002:a17:90a:dd45:: with SMTP id u5mr302350pjv.156.1589820060313; Mon, 18 May 2020 09:41:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/8] decodetree: Split out MultiPattern from IncMultiPattern Date: Mon, 18 May 2020 09:40:48 -0700 Message-Id: <20200518164052.18689-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/decodetree.py | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 7af6b3056d..ea313bcdea 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -371,7 +371,32 @@ class Pattern(General): # end Pattern =20 =20 -class IncMultiPattern(General): +class MultiPattern(General): + """Class representing a set of instruction patterns""" + + def __init__(self, lineno, pats): + self.file =3D input_file + self.lineno =3D lineno + self.pats =3D pats + self.base =3D None + self.fixedbits =3D 0 + self.fixedmask =3D 0 + self.undefmask =3D 0 + self.width =3D None + + def __str__(self): + r =3D 'group' + if self.fixedbits is not None: + r +=3D ' ' + str_match_bits(self.fixedbits, self.fixedmask) + return r + + def output_decl(self): + for p in self.pats: + p.output_decl() +# end MultiPattern + + +class IncMultiPattern(MultiPattern): """Class representing an overlapping set of instruction patterns""" =20 def __init__(self, lineno, pats, fixb, fixm, udfm, w): @@ -384,16 +409,6 @@ class IncMultiPattern(General): self.undefmask =3D udfm self.width =3D w =20 - def __str__(self): - r =3D "{" - for p in self.pats: - r =3D r + ' ' + str(p) - return r + "}" - - def output_decl(self): - for p in self.pats: - p.output_decl() - def output_code(self, i, extracted, outerbits, outermask): global translate_prefix ind =3D str_indent(i) --=20 2.20.1 From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820543; cv=none; d=zohomail.com; s=zohoarc; b=bjwPx5XhplX7Z9qv3cc0KuNEUHAgriqXS5Il9BNbZayXs+eAmZJix+mCp1nxVsLtlMOw1vWmi54L2gFlk6Ezj2klBDxMgzl6c1Nbu0yQ2EbxF+Y22KXxzKrRDVBBHR5F1wj9iCCmxXgr9OkyYoigPp8279vwFyDgQTV+a9eT9bQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820543; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z/u2gGUYvwpC8sb/rqLeX8kHv104pan4Dnbe4hQpH4A=; b=kmKnLPuHgLDbP8iO2CkD6NQQVMrBAUHXfslMumREjQswXoTyG5oSZQ/zvnyqbvnuDlniaG4SEpc3+51dRSAl1Vj403iDU1fodR5yGgtT6McZkRF3SZw0F59mEGn63crlJwpuSKDRjdAesgptKgXChxIzAzEatwRrI4jJ16XLqmU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589820542977184.29882177490083; Mon, 18 May 2020 09:49:02 -0700 (PDT) Received: from localhost ([::1]:45856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaiwn-00065k-MQ for importer@patchew.org; Mon, 18 May 2020 12:49:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaip7-00027l-97 for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:05 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:42784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaip6-0005rH-A8 for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:04 -0400 Received: by mail-pl1-x642.google.com with SMTP id k19so4440130pll.9 for ; Mon, 18 May 2020 09:41:03 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z/u2gGUYvwpC8sb/rqLeX8kHv104pan4Dnbe4hQpH4A=; b=I14a1WbnGlHu8xISviWfGDFF/LvZVLn6s7gKLC63sw8bpfRtHKks98Le1odBnra35W 7iqhjfY3cOk3Ew61Nu7s2hAOcpO11LEdQDOcqFpChJf3E4PGWEKtDZ6c8vr3Pg7kjkMk Hdzpstf6qYItl5QAlLnakEwcqtLW9KvJHjLVq8idfyy3jycUl/S1Jqyn0zZlJjTyzDZI nBr6ByKIWB17i+bKT0tJtP6xQpR9T/dOyD75lLDB+DoeF1+zHt5QyN8/Ty1GAWWZAFT8 zldko/x1v8bPXu2B/N/c/mGF5+4u0g10Lqc53RCNtlMJ2N+Ws/eXauzlaDZhs3SdRG1x TQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z/u2gGUYvwpC8sb/rqLeX8kHv104pan4Dnbe4hQpH4A=; b=XSrglVFTuH0msLayoOCXSRbRBkmSlUTy/3CF+IqpQNTdcm/BjEDlELiz/RDD9u3PS8 g69MnQPqTDDGHdGjyDEYa6q5R1Jkl3GOITQtqLKLBuKyMdLgI5JOby+SXBosIidhTsC5 QeYgC4KsjCuD5aZcWRGlclMbChNZZxQn73FhTsyT026WTBOYQAAnQPGCNoNT/SDj4xPK jYZ+lczYv7TNuOQ3kNxwDzpl0kfJD+hNy8Mu2lNfLOEaXl23ppSCi0ivwcLzRj8mTFtq 5L3S7PrUgiwfEWNiwmJQ4Xek7BEdGOzkCs1hjU7HbUYIrjLK+am1qVbU/ZMv0NgyHFnC qxJg== X-Gm-Message-State: AOAM532oPCqjdO09YEvrZyYiMdLhliUMih3e3V/VKSLzmumgolTAdL/T M0JgWF/6+kIZJptUF7RdCItgMkBiVWo= X-Google-Smtp-Source: ABdhPJy6AaIPJE6uXvnmYrIYQRlYrUgrTkShssYhzAjxLUh7vXsbA4VWMRIlGz7OLvBf52OntUwbww== X-Received: by 2002:a17:902:502:: with SMTP id 2mr12036921plf.134.1589820062371; Mon, 18 May 2020 09:41:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/8] decodetree: Allow group covering the entire insn space Date: Mon, 18 May 2020 09:40:49 -0700 Message-Id: <20200518164052.18689-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Peter Maydell --- ...est1.decode =3D> 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 =3D> succ_pattern_grou= p_nest2.decode} (85%) diff --git a/tests/decode/err_pattern_group_nest1.decode b/tests/decode/suc= c_pattern_group_nest2.decode similarity index 85% rename from tests/decode/err_pattern_group_nest1.decode rename to tests/decode/succ_pattern_group_nest2.decode index 92e971c3c5..8d5ab4b2d3 100644 --- a/tests/decode/err_pattern_group_nest1.decode +++ b/tests/decode/succ_pattern_group_nest2.decode @@ -6,7 +6,7 @@ %sub3 16:8 %sub4 24:8 =20 -# Groups with no overlap are supposed to fail +# Group with complete overlap of the two patterns { top 00000000 00000000 00000000 00000000 sub4 ........ ........ ........ ........ %sub1 %sub2 %sub3 %sub4 diff --git a/scripts/decodetree.py b/scripts/decodetree.py index ea313bcdea..3307c74c30 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -124,6 +124,7 @@ def is_pow2(x): =20 def ctz(x): """Return the number of times 2 factors into X.""" + assert x !=3D 0 r =3D 0 while ((x >> r) & 1) =3D=3D 0: r +=3D 1 @@ -131,6 +132,8 @@ def ctz(x): =20 =20 def is_contiguous(bits): + if bits =3D=3D 0: + return -1 shift =3D ctz(bits) if is_pow2((bits >> shift) + 1): return shift @@ -793,9 +796,8 @@ def build_incmulti_pattern(lineno, pats): error(lineno, 'width mismatch in patterns within braces') =20 repeat =3D True - while repeat: - if fixedmask =3D=3D 0: - error(lineno, 'no overlap in patterns within braces') + fixedbits =3D 0 + while repeat and fixedmask !=3D 0: fixedbits =3D None for p in pats: thisbits =3D p.fixedbits & fixedmask @@ -978,6 +980,12 @@ def build_tree(pats, outerbits, outermask): innermask &=3D i.fixedmask =20 if innermask =3D=3D 0: + # Edge condition: One pattern covers the entire insnmask + if len(pats) =3D=3D 1: + t =3D Tree(outermask, innermask) + t.subs.append((0, pats[0])) + return t + text =3D 'overlapping patterns:' for p in pats: text +=3D '\n' + p.file + ':' + str(p.lineno) + ': ' + str(p) --=20 2.20.1 From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820802; cv=none; d=zohomail.com; s=zohoarc; b=CWM4fLa0dItavnMv+j+eATjomG0TOsCtlrtp4xzioC58NfBfaJu3KB0mmdX9XtUcssNWWI/c2sovjEPdhTvO8D2scBhm4PWsbdcLO5e7NmosFJuW+q5dpQ05ds2I4ZT4JC8r53M5+e8AuUPYDK6qnjg7O+x5Gai6cpOnIg0bvvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820802; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MPJKFuko3o4wPQ/LQBUVo3W7uSIJWuyYbNATR0QRJU4=; b=oC+e4ubKHlo5P7KZlUvA1ABnSoztUzis15BJ4silNCvqbdasnQTm+l9YbXxGXe+eP7uW7GMTY73vZnhn5P9jPtTIlAMwgcvE2yBqygq7j7dPmbu3syNx67lmOaDJYWJrQYR78l+xWtYIvwGkXUUTDdvvE5sI9VDFyvmCTHQMc5g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158982080263090.69476037871789; Mon, 18 May 2020 09:53:22 -0700 (PDT) Received: from localhost ([::1]:32990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaj0z-0004EP-5O for importer@patchew.org; Mon, 18 May 2020 12:53:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaipA-0002DA-6R for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:08 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:41386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaip8-0005ry-AR for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:07 -0400 Received: by mail-pg1-x544.google.com with SMTP id r10so5085943pgv.8 for ; Mon, 18 May 2020 09:41:05 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MPJKFuko3o4wPQ/LQBUVo3W7uSIJWuyYbNATR0QRJU4=; b=Rdr/B7ZI/okB7UoaMC0ANOO8pcLb4y2+yJb4AZ8lHDtbc1vZ6Ydynhd1w0//6u3z78 tvQWjGkAl4i+4nLGwjgWmdOzLlb1jsRzVCNN25MaIasUxPETksYb+LDD9p78FlWTxI+t jnh4C6BSeulQVABfCyUvCfOEMk3wI0aI77udHiAv/OeS366KVUvYQcz88ecUDWjE3DMe C8lkZpx1UzfLZNRDjfl6B0YctF8rQy09zHS4iuwL0WDQ1Vzsm3UObH6XFlRjVmrTN8WG xh3uW/+DPSWUCAnOecFjmJssnA79cGFzrUFs1Znwqs04iCeXgN5oJfOAyGOOSdJFkaSS n8yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MPJKFuko3o4wPQ/LQBUVo3W7uSIJWuyYbNATR0QRJU4=; b=H8l3A60tTXPHXYaTT85iT5SdQONtut8iqyzuMtEI4hLxrjCP9Gu2nr7u2LDonSw0IA U9D7uKuB1kX1ZySzm3r6V6funDr21bB6W/jvf6UXoLPZX/lhGiaFtSLOtVcVl+LffxBo VEqrFXVVAyKJ2LcfLFycxo1G+uBlKuUrW6TPtPWxnmL3rkn6f1IijyNlQIAN0ar9UG57 5O36KcyBmx3i44NA5D2m+tOwCBDx3fHl+gGGj7iIlkfFQbH9Y9T76Bq51eKYSeyxfIlZ jSE6t+cPi27mI7SzNAcbKXj8vzefjxF2Inw4hgg991dVXMT4rbh6niHiGaHZ9UZjjDDC Y1+A== X-Gm-Message-State: AOAM530wiHry6pAeuSKHbuCU/pbTngK2gDrDQngn++buTgNaaC88EjAX YdxduRPpGjzjuF71tpfqnA8nLNw7B7g= X-Google-Smtp-Source: ABdhPJxPJet6MvjTYXfJlV53qIyCERGwJtOesZp2bAT+EWwAhT2pADLLcNxpvdlAMXdbbLJDLZcjYw== X-Received: by 2002:aa7:939c:: with SMTP id t28mr17528853pfe.38.1589820063706; Mon, 18 May 2020 09:41:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 6/8] decodetree: Move semantic propagation into classes Date: Mon, 18 May 2020 09:40:50 -0700 Message-Id: <20200518164052.18689-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Create ExcMultiPattern to hold an set of non-overlapping patterns. The body of build_tree, prop_format become member functions on this class. Add minimal member functions to Pattern and MultiPattern to allow recusion through the tree. Move the bulk of build_incmulti_pattern to prop_masks and prop_width in MultiPattern, since we will need this for both kinds of containers. Only perform prop_width for variablewidth. Remove global patterns variable, and pass down container object into parse_file from main. No functional change in all of this. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- scripts/decodetree.py | 464 +++++++++++++++++++++++------------------- 1 file changed, 253 insertions(+), 211 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 3307c74c30..0ba01e049c 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -31,7 +31,6 @@ variablewidth =3D False fields =3D {} arguments =3D {} formats =3D {} -patterns =3D [] allpatterns =3D [] anyextern =3D False =20 @@ -371,16 +370,27 @@ class Pattern(General): output(ind, 'u.f_', arg, '.', n, ' =3D ', f.str_extract(), ';\= n') output(ind, 'if (', translate_prefix, '_', self.name, '(ctx, &u.f_', arg, ')) return true;\n') + + # Normal patterns do not have children. + def build_tree(self): + return + def prop_masks(self): + return + def prop_format(self): + return + def prop_width(self): + return + # end Pattern =20 =20 class MultiPattern(General): """Class representing a set of instruction patterns""" =20 - def __init__(self, lineno, pats): + def __init__(self, lineno): self.file =3D input_file self.lineno =3D lineno - self.pats =3D pats + self.pats =3D [] self.base =3D None self.fixedbits =3D 0 self.fixedmask =3D 0 @@ -396,22 +406,63 @@ class MultiPattern(General): def output_decl(self): for p in self.pats: p.output_decl() + + def prop_masks(self): + global insnmask + + fixedmask =3D insnmask + undefmask =3D insnmask + + # Collect fixedmask/undefmask for all of the children. + for p in self.pats: + p.prop_masks() + fixedmask &=3D p.fixedmask + undefmask &=3D p.undefmask + + # Widen fixedmask until all fixedbits match + repeat =3D True + fixedbits =3D 0 + while repeat and fixedmask !=3D 0: + fixedbits =3D None + for p in self.pats: + thisbits =3D p.fixedbits & fixedmask + if fixedbits is None: + fixedbits =3D thisbits + elif fixedbits !=3D thisbits: + fixedmask &=3D ~(fixedbits ^ thisbits) + break + else: + repeat =3D False + + self.fixedbits =3D fixedbits + self.fixedmask =3D fixedmask + self.undefmask =3D undefmask + + def build_tree(self): + for p in self.pats: + p.build_tree() + + def prop_format(self): + for p in self.pats: + p.build_tree() + + def prop_width(self): + width =3D None + for p in self.pats: + p.prop_width() + if width is None: + width =3D p.width + elif width !=3D p.width: + error_with_file(self.file, self.lineno, + 'width mismatch in patterns within braces') + self.width =3D width + # end MultiPattern =20 =20 class IncMultiPattern(MultiPattern): """Class representing an overlapping set of instruction patterns""" =20 - def __init__(self, lineno, pats, fixb, fixm, udfm, w): - self.file =3D input_file - self.lineno =3D lineno - self.pats =3D pats - self.base =3D None - self.fixedbits =3D fixb - self.fixedmask =3D fixm - self.undefmask =3D udfm - self.width =3D w - def output_code(self, i, extracted, outerbits, outermask): global translate_prefix ind =3D str_indent(i) @@ -431,6 +482,153 @@ class IncMultiPattern(MultiPattern): #end IncMultiPattern =20 =20 +class Tree: + """Class representing a node in a decode tree""" + + def __init__(self, fm, tm): + self.fixedmask =3D fm + self.thismask =3D tm + self.subs =3D [] + self.base =3D None + + def str1(self, i): + ind =3D str_indent(i) + r =3D '{0}{1:08x}'.format(ind, self.fixedmask) + if self.format: + r +=3D ' ' + self.format.name + r +=3D ' [\n' + for (b, s) in self.subs: + r +=3D '{0} {1:08x}:\n'.format(ind, b) + r +=3D s.str1(i + 4) + '\n' + r +=3D ind + ']' + return r + + def __str__(self): + return self.str1(0) + + def output_code(self, i, extracted, outerbits, outermask): + ind =3D str_indent(i) + + # If we identified all nodes below have the same format, + # extract the fields now. + if not extracted and self.base: + output(ind, self.base.extract_name(), + '(ctx, &u.f_', self.base.base.name, ', insn);\n') + extracted =3D True + + # Attempt to aid the compiler in producing compact switch statemen= ts. + # If the bits in the mask are contiguous, extract them. + sh =3D is_contiguous(self.thismask) + if sh > 0: + # Propagate SH down into the local functions. + def str_switch(b, sh=3Dsh): + return '(insn >> {0}) & 0x{1:x}'.format(sh, b >> sh) + + def str_case(b, sh=3Dsh): + return '0x{0:x}'.format(b >> sh) + else: + def str_switch(b): + return 'insn & 0x{0:08x}'.format(b) + + def str_case(b): + return '0x{0:08x}'.format(b) + + output(ind, 'switch (', str_switch(self.thismask), ') {\n') + for b, s in sorted(self.subs): + assert (self.thismask & ~s.fixedmask) =3D=3D 0 + innermask =3D outermask | self.thismask + innerbits =3D outerbits | b + output(ind, 'case ', str_case(b), ':\n') + output(ind, ' /* ', + str_match_bits(innerbits, innermask), ' */\n') + s.output_code(i + 4, extracted, innerbits, innermask) + output(ind, ' return false;\n') + output(ind, '}\n') +# end Tree + + +class ExcMultiPattern(MultiPattern): + """Class representing a non-overlapping set of instruction patterns""" + + def output_code(self, i, extracted, outerbits, outermask): + # Defer everything to our decomposed Tree node + self.tree.output_code(i, extracted, outerbits, outermask) + + @staticmethod + def __build_tree(pats, outerbits, outermask): + # Find the intersection of all remaining fixedmask. + innermask =3D ~outermask & insnmask + for i in pats: + innermask &=3D i.fixedmask + + if innermask =3D=3D 0: + # Edge condition: One pattern covers the entire insnmask + if len(pats) =3D=3D 1: + t =3D Tree(outermask, innermask) + t.subs.append((0, pats[0])) + return t + + text =3D 'overlapping patterns:' + for p in pats: + text +=3D '\n' + p.file + ':' + str(p.lineno) + ': ' + str= (p) + error_with_file(pats[0].file, pats[0].lineno, text) + + fullmask =3D outermask | innermask + + # Sort each element of pats into the bin selected by the mask. + bins =3D {} + for i in pats: + fb =3D i.fixedbits & innermask + if fb in bins: + bins[fb].append(i) + else: + bins[fb] =3D [i] + + # We must recurse if any bin has more than one element or if + # the single element in the bin has not been fully matched. + t =3D Tree(fullmask, innermask) + + for b, l in bins.items(): + s =3D l[0] + if len(l) > 1 or s.fixedmask & ~fullmask !=3D 0: + s =3D ExcMultiPattern.__build_tree(l, b | outerbits, fullm= ask) + t.subs.append((b, s)) + + return t + + def build_tree(self): + super().prop_format() + self.tree =3D self.__build_tree(self.pats, self.fixedbits, + self.fixedmask) + + @staticmethod + def __prop_format(tree): + """Propagate Format objects into the decode tree""" + + # Depth first search. + for (b, s) in tree.subs: + if isinstance(s, Tree): + ExcMultiPattern.__prop_format(s) + + # If all entries in SUBS have the same format, then + # propagate that into the tree. + f =3D None + for (b, s) in tree.subs: + if f is None: + f =3D s.base + if f is None: + return + if f is not s.base: + return + tree.base =3D f + + def prop_format(self): + super().prop_format() + self.__prop_format(self.tree) + +# end ExcMultiPattern + + def parse_field(lineno, name, toks): """Parse one instruction field from TOKS at LINENO""" global fields @@ -587,18 +785,19 @@ def infer_format(arg, fieldmask, flds, width): # end infer_format =20 =20 -def parse_generic(lineno, is_format, name, toks): +def parse_generic(lineno, parent_pat, name, toks): """Parse one instruction format from TOKS at LINENO""" global fields global arguments global formats - global patterns global allpatterns global re_ident global insnwidth global insnmask global variablewidth =20 + is_format =3D parent_pat is None + fixedmask =3D 0 fixedbits =3D 0 undefmask =3D 0 @@ -749,7 +948,7 @@ def parse_generic(lineno, is_format, name, toks): error(lineno, 'field {0} not initialized'.format(f)) pat =3D Pattern(name, lineno, fmt, fixedbits, fixedmask, undefmask, fieldmask, flds, width) - patterns.append(pat) + parent_pat.pats.append(pat) allpatterns.append(pat) =20 # Validate the masks that we have assembled. @@ -769,61 +968,16 @@ def parse_generic(lineno, is_format, name, toks): .format(allbits ^ insnmask)) # end parse_general =20 -def build_incmulti_pattern(lineno, pats): - """Validate the Patterns going into a IncMultiPattern.""" - global patterns - global insnmask =20 - if len(pats) < 2: - error(lineno, 'less than two patterns within braces') - - fixedmask =3D insnmask - undefmask =3D insnmask - - # Collect fixed/undefmask for all of the children. - # Move the defining lineno back to that of the first child. - for p in pats: - fixedmask &=3D p.fixedmask - undefmask &=3D p.undefmask - if p.lineno < lineno: - lineno =3D p.lineno - - width =3D None - for p in pats: - if width is None: - width =3D p.width - elif width !=3D p.width: - error(lineno, 'width mismatch in patterns within braces') - - repeat =3D True - fixedbits =3D 0 - while repeat and fixedmask !=3D 0: - fixedbits =3D None - for p in pats: - thisbits =3D p.fixedbits & fixedmask - if fixedbits is None: - fixedbits =3D thisbits - elif fixedbits !=3D thisbits: - fixedmask &=3D ~(fixedbits ^ thisbits) - break - else: - repeat =3D False - - mp =3D IncMultiPattern(lineno, pats, fixedbits, fixedmask, undefmask, = width) - patterns.append(mp) -# end build_incmulti_pattern - -def parse_file(f): +def parse_file(f, parent_pat): """Parse all of the patterns within a file""" =20 - global patterns - # Read all of the lines of the file. Concatenate lines # ending in backslash; discard empty lines and comments. toks =3D [] lineno =3D 0 nesting =3D 0 - saved_pats =3D [] + nesting_pats =3D [] =20 for line in f: lineno +=3D 1 @@ -868,16 +1022,20 @@ def parse_file(f): =20 # End nesting? if name =3D=3D '}': - if nesting =3D=3D 0: - error(start_lineno, 'mismatched close brace') if len(toks) !=3D 0: error(start_lineno, 'extra tokens after close brace') + if len(parent_pat.pats) < 2: + error(lineno, 'less than two patterns within braces') + + try: + parent_pat =3D nesting_pats.pop() + except: + error(lineno, 'mismatched close brace') + nesting -=3D 2 if indent !=3D nesting: - error(start_lineno, 'indentation ', indent, ' !=3D ', nest= ing) - pats =3D patterns - patterns =3D saved_pats.pop() - build_incmulti_pattern(lineno, pats) + error(lineno, 'indentation ', indent, ' !=3D ', nesting) + toks =3D [] continue =20 @@ -889,8 +1047,12 @@ def parse_file(f): if name =3D=3D '{': if len(toks) !=3D 0: error(start_lineno, 'extra tokens after open brace') - saved_pats.append(patterns) - patterns =3D [] + + nested_pat =3D IncMultiPattern(start_lineno) + parent_pat.pats.append(nested_pat) + nesting_pats.append(parent_pat) + parent_pat =3D nested_pat + nesting +=3D 2 toks =3D [] continue @@ -901,121 +1063,13 @@ def parse_file(f): elif name[0] =3D=3D '&': parse_arguments(start_lineno, name[1:], toks) elif name[0] =3D=3D '@': - parse_generic(start_lineno, True, name[1:], toks) + parse_generic(start_lineno, None, name[1:], toks) else: - parse_generic(start_lineno, False, name, toks) + parse_generic(start_lineno, parent_pat, name, toks) toks =3D [] # end parse_file =20 =20 -class Tree: - """Class representing a node in a decode tree""" - - def __init__(self, fm, tm): - self.fixedmask =3D fm - self.thismask =3D tm - self.subs =3D [] - self.base =3D None - - def str1(self, i): - ind =3D str_indent(i) - r =3D '{0}{1:08x}'.format(ind, self.fixedmask) - if self.format: - r +=3D ' ' + self.format.name - r +=3D ' [\n' - for (b, s) in self.subs: - r +=3D '{0} {1:08x}:\n'.format(ind, b) - r +=3D s.str1(i + 4) + '\n' - r +=3D ind + ']' - return r - - def __str__(self): - return self.str1(0) - - def output_code(self, i, extracted, outerbits, outermask): - ind =3D str_indent(i) - - # If we identified all nodes below have the same format, - # extract the fields now. - if not extracted and self.base: - output(ind, self.base.extract_name(), - '(ctx, &u.f_', self.base.base.name, ', insn);\n') - extracted =3D True - - # Attempt to aid the compiler in producing compact switch statemen= ts. - # If the bits in the mask are contiguous, extract them. - sh =3D is_contiguous(self.thismask) - if sh > 0: - # Propagate SH down into the local functions. - def str_switch(b, sh=3Dsh): - return '(insn >> {0}) & 0x{1:x}'.format(sh, b >> sh) - - def str_case(b, sh=3Dsh): - return '0x{0:x}'.format(b >> sh) - else: - def str_switch(b): - return 'insn & 0x{0:08x}'.format(b) - - def str_case(b): - return '0x{0:08x}'.format(b) - - output(ind, 'switch (', str_switch(self.thismask), ') {\n') - for b, s in sorted(self.subs): - assert (self.thismask & ~s.fixedmask) =3D=3D 0 - innermask =3D outermask | self.thismask - innerbits =3D outerbits | b - output(ind, 'case ', str_case(b), ':\n') - output(ind, ' /* ', - str_match_bits(innerbits, innermask), ' */\n') - s.output_code(i + 4, extracted, innerbits, innermask) - output(ind, ' return false;\n') - output(ind, '}\n') -# end Tree - - -def build_tree(pats, outerbits, outermask): - # Find the intersection of all remaining fixedmask. - innermask =3D ~outermask & insnmask - for i in pats: - innermask &=3D i.fixedmask - - if innermask =3D=3D 0: - # Edge condition: One pattern covers the entire insnmask - if len(pats) =3D=3D 1: - t =3D Tree(outermask, innermask) - t.subs.append((0, pats[0])) - return t - - text =3D 'overlapping patterns:' - for p in pats: - text +=3D '\n' + p.file + ':' + str(p.lineno) + ': ' + str(p) - error_with_file(pats[0].file, pats[0].lineno, text) - - fullmask =3D outermask | innermask - - # Sort each element of pats into the bin selected by the mask. - bins =3D {} - for i in pats: - fb =3D i.fixedbits & innermask - if fb in bins: - bins[fb].append(i) - else: - bins[fb] =3D [i] - - # We must recurse if any bin has more than one element or if - # the single element in the bin has not been fully matched. - t =3D Tree(fullmask, innermask) - - for b, l in bins.items(): - s =3D l[0] - if len(l) > 1 or s.fixedmask & ~fullmask !=3D 0: - s =3D build_tree(l, b | outerbits, fullmask) - t.subs.append((b, s)) - - return t -# end build_tree - - class SizeTree: """Class representing a node in a size decode tree""" =20 @@ -1157,28 +1211,6 @@ def build_size_tree(pats, width, outerbits, outermas= k): # end build_size_tree =20 =20 -def prop_format(tree): - """Propagate Format objects into the decode tree""" - - # Depth first search. - for (b, s) in tree.subs: - if isinstance(s, Tree): - prop_format(s) - - # If all entries in SUBS have the same format, then - # propagate that into the tree. - f =3D None - for (b, s) in tree.subs: - if f is None: - f =3D s.base - if f is None: - return - if f is not s.base: - return - tree.base =3D f -# end prop_format - - def prop_size(tree): """Propagate minimum widths up the decode size tree""" =20 @@ -1199,7 +1231,6 @@ def prop_size(tree): def main(): global arguments global formats - global patterns global allpatterns global translate_scope global translate_prefix @@ -1246,18 +1277,29 @@ def main(): =20 if len(args) < 1: error(0, 'missing input file') + + toppat =3D ExcMultiPattern(0) + for filename in args: input_file =3D filename f =3D open(filename, 'r') - parse_file(f) + parse_file(f, toppat) f.close() =20 - if variablewidth: - stree =3D build_size_tree(patterns, 8, 0, 0) - prop_size(stree) + # We do not want to compute masks for toppat, because those masks + # are used as a starting point for build_tree. For toppat, we must + # insist that decode begins from naught. + for i in toppat.pats: + i.prop_masks() =20 - dtree =3D build_tree(patterns, 0, 0) - prop_format(dtree) + toppat.build_tree() + toppat.prop_format() + + if variablewidth: + for i in toppat.pats: + i.prop_width() + stree =3D build_size_tree(toppat.pats, 8, 0, 0) + prop_size(stree) =20 if output_file: output_fd =3D open(output_file, 'w') @@ -1316,7 +1358,7 @@ def main(): f =3D arguments[n] output(i4, i4, f.struct_name(), ' f_', f.name, ';\n') output(i4, '} u;\n\n') - dtree.output_code(4, False, 0, 0) + toppat.output_code(4, False, 0, 0) =20 output(i4, 'return false;\n') output('}\n') --=20 2.20.1 From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820683; cv=none; d=zohomail.com; s=zohoarc; b=BxxGZLaN+Ma1cU+bYI+eSm2yDOD4RrGfjJEnPZyFpjUDva1UyZUmdmOCo1h+8282H/RbLdCLk7WQL4ESjLJZ3+8pp8AEn3SHNWYHnu0jxo4lcwS1/wm5d8NQkNw61kOQcR0C93iByCyn0l3tADmY/YCI0L/f2t25+HOiK0ycbcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820683; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PDxSs9xf1b7EFL4pA0grZqMFDbD8BMz/GvRTlqeyA2I=; b=MM7FDsjRBevn2PcqkLYAgOlkSVv5NrXjEQ5cmId/AF8cNudX2Cc1Sc0E8HJedj7z6Zp4+M39PVWTFik3CCuwGfCBdR8hteNkQplgnIR7du9RV63I9iUKscPEoOlJ5xTudotXtD4zjXsWKkRL7gpa3vVaP3nwsIJDo+riFGC3Nak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589820683357822.1272241347737; Mon, 18 May 2020 09:51:23 -0700 (PDT) Received: from localhost ([::1]:53798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaiz4-00014t-5o for importer@patchew.org; Mon, 18 May 2020 12:51:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaip9-0002CR-SE for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:07 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:33996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaip8-0005s9-PQ for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:07 -0400 Received: by mail-pf1-x42f.google.com with SMTP id x15so5222551pfa.1 for ; Mon, 18 May 2020 09:41:06 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PDxSs9xf1b7EFL4pA0grZqMFDbD8BMz/GvRTlqeyA2I=; b=e2AxxJupJagi8K3bYFhRin1ja+XNx7qEOSklYn7bX3V3sasqPk3DKCZ7y4K6VoFE/l PAKSQlGoY4mJDxOTXf5daCf8qEmo/vQmJTxqljcHaAbTURf/cwidT9AvTUQdeP9NjEUK G0dRiJs0EvWeqi3ajkRobYvC8+oyFJ3+DVkI6j2SR7VReEnMXGlh9uNTkxewEQ0JghSt LlaqmccdYMeQwqDGO3sLFLvm8sc1S0pKfEHKc/NFSPAb2VABOgb8WQHqoobpfr0FJSAR 18yUyegB6NxX2vl4s63VPid8OXZfelZmswCxBkukTs6RqL5ZKr1WGvSaBF2Ublw5DcBo eXmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PDxSs9xf1b7EFL4pA0grZqMFDbD8BMz/GvRTlqeyA2I=; b=LeVMy7V4AOQkz8ny5dH+ozh3pv8jajEJfCgh4crH8+tYuGqFfU3q/+zbaZCXX2zsva rkFVlH/1zEmHApXEno9ntfov+Kyvx5oTJ4t9D7mpj0laelsxYzJ6Png/8RCQXbRyno42 Kq6a73gEEIUSPdzZUbf6ZpJc1rKCSgBrH4qw+XV77XcQRnOrhuTDitTeUhitKzeXdXHv jJStOUc78oIoZ+XJgRiwcRKW0qc7dDntYhez+OTXh0CKSCcN3ppaM/oJgBRVU+JOgROg s0E9bPhCbjP+4+NtXXyE0YWW/+bL+GMIae+0Hhgrv5RlbHRAJfUdUEtRwIlb/Cwgknl/ B9fA== X-Gm-Message-State: AOAM5318rGv5dCdvUKyr/UlFAKhTJ/UprEvh9uWqN7LgraG2x9IXhymR fCJ8qXc2PhLxUTIE/vTX/NHfDpBaxyQ= X-Google-Smtp-Source: ABdhPJz2mNM3Vx1I4JTL/IA+nLTzTH0DX3NuB5L1MrwaoOxh80fouh+qK87vSy+osu8KmCf9NNnTEQ== X-Received: by 2002:a62:cd4a:: with SMTP id o71mr17915345pfg.115.1589820064970; Mon, 18 May 2020 09:41:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/8] decodetree: Implement non-overlapping groups Date: Mon, 18 May 2020 09:40:51 -0700 Message-Id: <20200518164052.18689-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Intended to be nested within overlapping groups. Suggested-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/decodetree.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 0ba01e049c..a9739f671d 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1021,21 +1021,22 @@ def parse_file(f, parent_pat): del toks[0] =20 # End nesting? - if name =3D=3D '}': + if name =3D=3D '}' or name =3D=3D ']': if len(toks) !=3D 0: error(start_lineno, 'extra tokens after close brace') if len(parent_pat.pats) < 2: error(lineno, 'less than two patterns within braces') =20 + # Make sure { } and [ ] nest properly. + if (name =3D=3D '}') !=3D isinstance(parent_pat, IncMultiPatte= rn): + error(lineno, 'mismatched close brace') + try: parent_pat =3D nesting_pats.pop() except: - error(lineno, 'mismatched close brace') + error(lineno, 'extra close brace') =20 nesting -=3D 2 - if indent !=3D nesting: - error(lineno, 'indentation ', indent, ' !=3D ', nesting) - toks =3D [] continue =20 @@ -1044,11 +1045,14 @@ def parse_file(f, parent_pat): error(start_lineno, 'indentation ', indent, ' !=3D ', nesting) =20 # Start nesting? - if name =3D=3D '{': + if name =3D=3D '{' or name =3D=3D '[': if len(toks) !=3D 0: error(start_lineno, 'extra tokens after open brace') =20 - nested_pat =3D IncMultiPattern(start_lineno) + if name =3D=3D '{': + nested_pat =3D IncMultiPattern(start_lineno) + else: + nested_pat =3D ExcMultiPattern(start_lineno) parent_pat.pats.append(nested_pat) nesting_pats.append(parent_pat) parent_pat =3D nested_pat @@ -1067,6 +1071,9 @@ def parse_file(f, parent_pat): else: parse_generic(start_lineno, parent_pat, name, toks) toks =3D [] + + if nesting !=3D 0: + error(lineno, 'missing close brace') # end parse_file =20 =20 --=20 2.20.1 From nobody Fri Nov 14 18:04:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589820122; cv=none; d=zohomail.com; s=zohoarc; b=nM+AUakhSVuoeQ0PXYv9r39/mNWtac7INoSaEOVmzCXK01R18wx9FeAKG2nJF++ZPhaWX2tWHTtLbtrrdz9ETZyoK6BGRT1z80OfPtP9Z77+Az5HSZR/j7SuKcMyU1AJlnhQw3TSHUoCoYXT7ZzGra7uLC27WXK/7KUhJiWx8jk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589820122; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YR8AXhnmaa7YBf0c5Txz/pTDpNw3zZphMDFYyOMiCJ8=; b=QQh0nzXfS+FRVVVeE3t8evabbRWGl8IxN7YVziobr2NLCO4/3jGEJtICO1VOLawVEzxdrsM47et6rrmKD8sq5RM89EUlaNE+yFocVplPr/6sYyciNvfzYN1nkXfDxPWbdry7sYFj2zO2+8G790rw8loUx042wlpmW0ftwBtAU3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158982012255067.79909537861818; Mon, 18 May 2020 09:42:02 -0700 (PDT) Received: from localhost ([::1]:48410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaiq1-0003YF-9e for importer@patchew.org; Mon, 18 May 2020 12:42:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaipB-0002Ev-5t for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:09 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:38609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaipA-0005sT-Be for qemu-devel@nongnu.org; Mon, 18 May 2020 12:41:08 -0400 Received: by mail-pj1-x1041.google.com with SMTP id t40so72605pjb.3 for ; Mon, 18 May 2020 09:41:07 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:41:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YR8AXhnmaa7YBf0c5Txz/pTDpNw3zZphMDFYyOMiCJ8=; b=m6TbyN5laTTBvFTy6dbGCymQ8XGAHSt9MWDS9wOC1JRSL0jOjRlcPbDDX0LYFJQ54/ zuKCGzuYx5MDQ7UfFtnXtJCV2wq3Jakp0TGdhwWk5OTj6J8nr/07jBcjmtJ+ZzZH0uLN 63Q9xN98GjPEOntQYXBS+u/1vIfZ38F7mRp8NeBNXa87UGzZmw8KPnvjQy3hxOLhQsCK +e0cOd/3o98BsSuFdIZZ9hST7kKzFu12E36RrP3RCcQtbVRXVpjOUEFlNxGzyHKg2Gxw 3Z+U39QBEaWotqlkjt+aUlfnSxV6f9mpPROfVRTR0JJ0RnYFyEOp0hIyQI1LfDbyFClD euOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YR8AXhnmaa7YBf0c5Txz/pTDpNw3zZphMDFYyOMiCJ8=; b=N9oTc6RyYHawOlKNuAOJxwjPHtxqmR8qm9RMMpF23TWStFOWYU0J1bMOdkRUCWWrPr DUwD7jllyHAmS2oCCZ40ulG8qlvhzJ84rsaCb/9Ce1LIXnAliLLfoDi5BdwuM80Ek0Pg 7eDcQXp24VrAP+7aBD9kNNgg9BxU+mcv8iJxDGPeAjUJ8eEI1Nda5N8V8YIQQS2HQdrq v+bl50iTm1QrbqEVLDQ/im4CXX3R76jfIAI0XI8amrvtGOByDVeKVwybkUVUjDMqB4/W dYgn6pxokLZtYgtdjb7tKNlYZjf3WXSFp4nKdE5jEn4DT0CmBMZHqaoHOd1+YAvyCdzS juYQ== X-Gm-Message-State: AOAM532jpH3jqGoG4tQ+xUQl8AMxiuQ/0uB3UC5dNjtWtATPXrEqA4gY uX9n87j/bum4/IfDJZRvhliG+yvrH3A= X-Google-Smtp-Source: ABdhPJyC2WcR8cpD4mCsJcmm9co/3LKICqp5LpiByFkGYddzLBX2jgUxOv3PeeUsp7eJSj8muOkjXg== X-Received: by 2002:a17:90a:589:: with SMTP id i9mr274327pji.156.1589820066767; Mon, 18 May 2020 09:41:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 8/8] target/arm: Use a non-overlapping group for misc control Date: Mon, 18 May 2020 09:40:52 -0700 Message-Id: <20200518164052.18689-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1041.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" This sub-group in the t32 deocode are mutually exclusive. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/t32.decode | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/t32.decode b/target/arm/t32.decode index c63082fc9c..c21a988f97 100644 --- a/target/arm/t32.decode +++ b/target/arm/t32.decode @@ -312,13 +312,13 @@ CLZ 1111 1010 1011 ---- 1111 .... 1000 .= ... @rdm &cps =20 # Miscellaneous control - { + [ CLREX 1111 0011 1011 1111 1000 1111 0010 1111 DSB 1111 0011 1011 1111 1000 1111 0100 ---- DMB 1111 0011 1011 1111 1000 1111 0101 ---- ISB 1111 0011 1011 1111 1000 1111 0110 ---- SB 1111 0011 1011 1111 1000 1111 0111 0000 - } + ] =20 # Note that the v7m insn overlaps both the normal and banked insn. { --=20 2.20.1