From nobody Thu May 16 20:17:00 2024 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=1591142378; cv=none; d=zohomail.com; s=zohoarc; b=NYtcASqWUUJkSye7HP04AEVMl6+fh/2XAdsIxVVer1sl1/K3ZUzzCbnbqd/bIfr1q6awP5Oo9WmmItnVmRv5SdM5cKkox7Y2qED62mIFlt4EYJWl3Tqzet01l7ztpr1Cs9mRglKpo2BAUp2WUk10QcaC7ZxIIkx6tX4cJWII2iw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142378; 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=b/XVcjpntbxdGusUz05j9FBinJNgwBz4HL/Wlk1yj2E=; b=IRVbzWXdPCAZkz0hmJf20HZgD7uEE18wRuwhkhavdIKW+9hiWEAcXaKenonvaNYeCYyxbgKs7xvoO6uGkW7z3jHaJVFdkyusXqW5WtpYnYGJGaXJhjwiankpt75U0razbzFjRkQ9Q3qMpp1RcoGzLiUQU0In4nWx5QfJ4RPAH38= 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 1591142378384326.55421767091445; Tue, 2 Jun 2020 16:59:38 -0700 (PDT) Received: from localhost ([::1]:44124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGoj-00065g-4G for importer@patchew.org; Tue, 02 Jun 2020 19:59:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGno-0004gq-2f for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:40 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:34617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGnn-00023w-BG for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:39 -0400 Received: by mail-pf1-x42a.google.com with SMTP id z64so311547pfb.1 for ; Tue, 02 Jun 2020 16:58:38 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:36 -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=b/XVcjpntbxdGusUz05j9FBinJNgwBz4HL/Wlk1yj2E=; b=oc0q7LE8Ir+zgj8P7CjTLNYzDwOGofSquj4cPNWu4X2f55BBwaNOf4x6zIrp2h9W5b JseoxQooDeat3yLtserJmk+8bN3F5E9iRSxtnh9yi1DHGqt7abmk2aWu0wguPxuOUDd4 581QuzwySphwwiinxi62TH/IluBcbojUy4vBS640o+SJvDdJPnNSnUdMFI/BbUBL0cdb vzOsZ4xJ5G+CmtxahUk8h9oTk9GHpTxov95t6ONGAQY0xHt1OUCph30uxMrBSPViTZ1A 5pvl2+TNMeLernxhxksMwzid19YsCx6s1CWzICZSJrtAoFAONyW3acV4y3GRrxxKD7IM 3hhw== 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=b/XVcjpntbxdGusUz05j9FBinJNgwBz4HL/Wlk1yj2E=; b=UC17DxwqfHL8tEOZGg7T/t3sZZhLoZ5FkYSH9COD/Fpq4i8KPkP5KfUYWtptKNw7eT SUeQNo8I3AneRXdI1tH7k9xdCgfSDj+B6eavE9SDrPTWqKJRTN78sOfZlGHJRSu8qKP5 S29zSU/fXUqMRNhYDGbp8yFAJqtG/gsiM4PQsZ6XMykSgmN1dNgm06wIrLMfoaryX3OY o+m991+l8L2lZ8JtqsET80EA7/Vo8AeiGsaJSaFKeIGJVsWf/KlB94G++cHWrwPEDBmI J3oX8yXS+b7jincIrLUHc9k/AiNo8PcZzMTuDeRx3fo/z25yf7QFNevKgIdXtCqekWXc i95A== X-Gm-Message-State: AOAM533fO5OWXOnAqFhFsnFz3TFoXCgJ43iOzICQeBnGPr7KjAsPLBGL ipqpUoBER60ebxp9ZYneO+LofZOHxs0= X-Google-Smtp-Source: ABdhPJy6v3rHbv7l607aiZmTl5JiDkZV2JdtSX/Ym2LNkRDkmgqJakBTfwRugpyuBCaiZL0WPZh2xQ== X-Received: by 2002:a17:90b:4c44:: with SMTP id np4mr1821245pjb.63.1591142317535; Tue, 02 Jun 2020 16:58:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 1/8] decodetree: Tidy error_with_file Date: Tue, 2 Jun 2020 16:58:27 -0700 Message-Id: <20200602235834.470345-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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, philmd@redhat.com 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- 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.25.1 From nobody Thu May 16 20:17:00 2024 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=1591142499; cv=none; d=zohomail.com; s=zohoarc; b=JvLwhMUlk0GOSLit1cM6rL2h8uLECZSdwgbv0pbzVgNRxwuMZHkwax08LcRybUzef0SUjM9NVi/JmAZXn9UdfqUNDFQZe9cO54Ub0RKjoIci2cIUpImSiuqwEvp1UUOZ6aGCDV03vW4anXPh3Eo8oZDGN0X3R74fk5bNVNH+36k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142499; h=Content-Type: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=fuj4+EzL4ACqWfECVnWjXkyBK0NkdZBLVsNebnwCJQ0=; b=GAex/SElbpIL4fF0s7M4Z4VbLLhPqKZVEzhIQ1rZwMc1BJxO+LhNYC53wMN/J0aPnHg048rHDacLaMhxJE5Hb5BZjkl8RUnV0TNNuQs93FiUFZtFbRZdkWfIFLDLZesuv96FhvjJ8zLUfwbQ6hvfXqz8ecHhXWEj6Qo/1Aj8NvI= 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 1591142499082347.79919826437333; Tue, 2 Jun 2020 17:01:39 -0700 (PDT) Received: from localhost ([::1]:51976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGqf-0000xE-Q2 for importer@patchew.org; Tue, 02 Jun 2020 20:01:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGnp-0004it-Kv for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:41 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:33460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGno-000246-QK for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:41 -0400 Received: by mail-pf1-x42c.google.com with SMTP id b201so315399pfb.0 for ; Tue, 02 Jun 2020 16:58:40 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:38 -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=fuj4+EzL4ACqWfECVnWjXkyBK0NkdZBLVsNebnwCJQ0=; b=Gt1n7CgBAVrMefGoro/F1bQFx5YEOzJurEF9QGIvEHfvtgEkQqrePpJ2xWFgzsjo78 1IbscEfWU9ic1LEvFHQ88A+o/EBVwVG2AtVEKGFXveKeJgALy3JeYj/XOAI8qfz8roYi /eIrkrmI1x5CSta4qUL5VALtRFFIRvvWnSH2lUQrVc/kp8jFVHefLt16K83QbKNOk8iS MebHs6cgC6Ixv0hRS7KZbrkQHUshv1XGK7K44KPK59YuKdW1X5uM99d9dGks7l3vJ1gn BO1pIlf4geX1fsRszDYLP/erW+XM+GfZeQii4g6flo9kh3DKeYMCCW2VPJ3ZZr2zP2DM DOhA== 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=fuj4+EzL4ACqWfECVnWjXkyBK0NkdZBLVsNebnwCJQ0=; b=bYKwC18zaVjzY1xG0C2QGrDI2LHbXfihmND/B9RE9yPRFg7vLE+rEgYd8fJH4v2C5Z wrdRgVsA+P3cz+D+ADveyKaZ1aXqA+tTT6r9WPuinquPJU4it4SrIEUSf+AjS0gZjq6x 1YY9uHEbIdLMs9Geg3fNJn3jJPB+rSlLUxuo95RnGNw3RglvVPS0fAbFnBeilT71HeK2 dr36n0ca0CmjjDDORmoYIk5xPjixPpVHZjXINKr2o43Gqf47+qONXs0mZjuazBJ+WHN1 8A+5DdOSovqRPpI7+icc4GPaBWBHHEk4FzCjHFmXjZqbRz0ikzAFrCvG+u+srI5UFq1A V5Vg== X-Gm-Message-State: AOAM532KKjKZCfuyseEUUB22bouwqsMsxd32MbIZwz/Bu0fKRHfuExVb /gOn6vVun0IKH136qQ8gcsbZWwp8icQ= X-Google-Smtp-Source: ABdhPJxlcgMpJLDQciR518qwX1M+JYBsQzQoVSZXtgFxCsOZoJbkiRFbdROoGrbbPmAEBQFEfpmIng== X-Received: by 2002:a63:1a11:: with SMTP id a17mr26556826pga.227.1591142319104; Tue, 02 Jun 2020 16:58:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 2/8] decodetree: Rename MultiPattern to IncMultiPattern Date: Tue, 2 Jun 2020 16:58:28 -0700 Message-Id: <20200602235834.470345-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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, philmd@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Name the current node for "inclusive" multi-pattern, in preparation for adding a node for "exclusive" multi-pattern. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- 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.25.1 From nobody Thu May 16 20:17:00 2024 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=1591142499; cv=none; d=zohomail.com; s=zohoarc; b=mqF068JdG66vRA5QRYEr3sSiSmfV6dQRQ1pH2iV3YzEmDAQeOj0nCuhV8U4hyCpBiY5ayxrQreCmgQGZmDkGPJoNK09rmbOuCvPb2x2RtU9/XqWbzP2wyl2wcoqvSDSHxMHNF5PIl3XWN2Gm9fabjYUQTlzZCRFw2MAF5eLjYfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142499; h=Content-Type: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=Pya0L8DMOCjwgXBO0A8MFuLM5jSzTOZ88OjOprsge18=; b=TfcbnSYzO6rPVD9dBMGRda57CV8HqQOhmRK42PNbebJYHZa+O7Npfgljo/YwsMOMfI5OjffXkUUT4A5OOC1xj3ndzjoy6Ajn8HZHVupGGr5XVP6nSq36laJlrgHlC8IxBCZ14UoON9i9PHzGtrJkNbVNYB3aWXv9cZ6sjCzzC1s= 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 1591142499155576.5313392645173; Tue, 2 Jun 2020 17:01:39 -0700 (PDT) Received: from localhost ([::1]:51986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGqf-0000xS-Tw for importer@patchew.org; Tue, 02 Jun 2020 20:01:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGnq-0004l4-M6 for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:42 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:43060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGnp-00024J-TK for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:42 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 185so407388pgb.10 for ; Tue, 02 Jun 2020 16:58:41 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:39 -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=Pya0L8DMOCjwgXBO0A8MFuLM5jSzTOZ88OjOprsge18=; b=OxQoqEuKsc4m66eOINXxcWnizzdJTun8a5bVgmgE1g3YZNWIYaIJ+PD0WUjFaup7qP NAGPzb2VIAg6ga9xZm2gcFoWXltLvoFH3NMtELWJ/+R2rWQaG8iY0eC3dl/P9VWH66i0 KsM1C9MB5T512dbnww7JGYNP2aGjjz8eyPDCwLtFxw9idK1oHEgvosP70eojLARDSCvU EpmbQQGVF3WfldnkpJO2+ZPGNiS8uXp5O4BoegQfznVl62x+L8dnYJRBrh3q9wTuj9Gs s5B2689DwKNpL4C8MZhhAhntNySEalftPckR/vZRtj0oWvr9FES7FDl7EA8K+7doXVyd JKWA== 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=Pya0L8DMOCjwgXBO0A8MFuLM5jSzTOZ88OjOprsge18=; b=lycdsEn+SKz+JLH35iPyArtyUNCBaquykYeqy92casO8UOFXzWH+kXJ3D/oNUM5Io2 vYXNMDVWgUD3HMHTkh2c7+sI1iPfHeLoCAEfXEWKR1CP5rQ9qDx7UMPoza6zzePzewBd e6HRqyuyviutNwUZYk+lHTxGEqvvFk1X6fyLwUUu8AawTxEQsRP0PneJNxDc8c0bogt0 bjTJ9ehPh2vZ9j/AiCzOUYqbXhUWYkECQgrMtemikBgz8q881jL6ATYkqA+9PaypTiy4 MpET4zeJxJEwSxDfKALcUIAhqzg+oAtowoW+ommQk0nXp5As2qsDBTOHFW5kPsCwTC2e FZag== X-Gm-Message-State: AOAM533NoEOw2ZPH1zjZoA9+0iPyHfq2BNTGBmw80AmRpX+LJDJavamS JZtEAwlne+b5FsKmUO5IrEShQTG2ywU= X-Google-Smtp-Source: ABdhPJxI5ubfPI/A7fgfMQclc6TE4VEjVW0w1ha2dnVxzhRXqabSLiZSVQIwDkETZSjdmWx5f6Vo4Q== X-Received: by 2002:a17:90a:9292:: with SMTP id n18mr1932012pjo.3.1591142320177; Tue, 02 Jun 2020 16:58:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 3/8] decodetree: Split out MultiPattern from IncMultiPattern Date: Tue, 2 Jun 2020 16:58:29 -0700 Message-Id: <20200602235834.470345-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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, philmd@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- 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.25.1 From nobody Thu May 16 20:17:00 2024 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=1591142611; cv=none; d=zohomail.com; s=zohoarc; b=DkAlvTyPSz/zkIa4PTLkl+cnbIZrhLgCsnajZrAqON6vNK0Ww+v58BnEi9gcmi/GUZjXrgZmCPzepGq1twatxKw1rMS5A+hMpZa0LP0pfsWUn+ANobEuhfrXG85NkbVeyO3POgEgBXgb0bYuKZ76GsLzl2kLqWpB2WqmvNS42ok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142611; 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=D9iJwfXIlrrZhBoa0zYBpMpQDudGom24uMHOfJzYaos=; b=T8edU/FAPk1dXxfqYdGxIckNrw5BwMMohyPrY7PknBmm1S5m8J/p0z6sS6ytVB56h5q1L9/jWxho5DMKQF4+ZQNy994zC0bIjIya43ytztlKgoXJovJSNWw6XR86ePtd7AkhTF34LqcCp/IZTWgX6fwueHL0rcYBuCIfB58rGls= 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 1591142611933465.6813823119942; Tue, 2 Jun 2020 17:03:31 -0700 (PDT) Received: from localhost ([::1]:57714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGsU-0003NE-Pp for importer@patchew.org; Tue, 02 Jun 2020 20:03:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGns-0004oT-7o for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:44 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:42099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGnr-00024e-Bv for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:43 -0400 Received: by mail-pg1-x544.google.com with SMTP id e9so411271pgo.9 for ; Tue, 02 Jun 2020 16:58:42 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:40 -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=D9iJwfXIlrrZhBoa0zYBpMpQDudGom24uMHOfJzYaos=; b=eXLdBueWGla+9HzdHdSEeswmBMCwW989E9C/ffhzrgrdN7MoaF2AcLlgn19Iab3y2c MByvGNnRV6ucIljRjQq2eMGrbQQ8/naYHquSjaIf9cCKX/SRZ95gX31T6NryzUE7X5Mt 0wZgaFr4X2z4o2X71loBYzD73Aon+zNgH6bGAI9HQk8nKz8+ohkd1CBZjHbUxnIR4Ka4 yIRE/3yXl5Yqrj3K//URBIGf+onuW5UIGcX7U6rG6unCWvAJhFBXUfHcYf0cquH5g8H5 cKFXYIHBlkm5267S2T3y/GUvYfJEJn/vmJ0AYdAxdl3tRONQFghMIGq5pqlymY8ShTLX uptw== 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=D9iJwfXIlrrZhBoa0zYBpMpQDudGom24uMHOfJzYaos=; b=mWnl0tMSkyEEKElVNfUMQrOBVpcKvojQyK8qo8oO6X1XrDKNHE1gv2ng6GkzDk3qqF nMYqOgblNTEwLz0i4oprfhAStp6l4xuzKfl3FHoWk4y/s+87vlsJjmBEUbqSq6pwRHoK p64ZEigPsSrlEW6SZIkNCXlhq3Ye6mKRqWhBiLxN1Oxg2r4+Rw+Hr6u9ozprOxqsNozB YrO2IwYOK12WSuFoh+hJcB3v8F3VvgI5ta83gDKb0sN0hfAU+XrJDNDel0Bn7bIo4Kne a+OHwhi6rCLI5yljiL8gReDfZM8rZYcaxMW4lL8p9jkxdNYLgxwYJ02HSvFl8gd7IK6c 3vyA== X-Gm-Message-State: AOAM531Q74EhALDmrwTet53NzYOEsEKyIopOB6j07itt9RNIjLqhtpse qMtfmZLV51W/LmscAisi+KGPz5lMwhg= X-Google-Smtp-Source: ABdhPJzqXLjVc7um/4oab06R12d9seQsc0dvRc33uEKwvbKfdrPqFC1LCusIPzY3LQaHaw4msKizkQ== X-Received: by 2002:a17:90a:6ace:: with SMTP id b14mr1987891pjm.13.1591142321473; Tue, 02 Jun 2020 16:58:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 4/8] decodetree: Allow group covering the entire insn space Date: Tue, 2 Jun 2020 16:58:30 -0700 Message-Id: <20200602235834.470345-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-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, philmd@redhat.com 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- ...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.25.1 From nobody Thu May 16 20:17:00 2024 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=1591142394; cv=none; d=zohomail.com; s=zohoarc; b=FruVHPw6zgjg3wJHK6H4ClRO+PlNHJCjBh31+6B4c7apGjLOffGqaL/+j2zO692tt326iE6W5EBQRKioJFNvvd3o6YysEU96GM8JMkSsmjY0B6IPU0OYfOE1CmuGcU78c3z3KFx96qtWxadOJgWiSyKXHQRZiTFajb0V3+7PC/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142394; 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=vTBtqxUpy9WkyuXZwOdXZa6I5esZFyA9WphOj0ye99o=; b=iCf9IwuAYlL7OZpbI7Kc5wk0lvu93JCRCpYtgxdCLG5u2i31Ycrc3bWOCAkFe61lfruFY4uW0Koeam7O/iPsVNSSazltsh46WQJOyfU9IVpbWjj1aDHtXLZrr5XjjeNbnVRqifMWcareBYJVYIXp5aSEZqQO9TXCz85N2/odyAE= 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 1591142394376585.1716882940727; Tue, 2 Jun 2020 16:59:54 -0700 (PDT) Received: from localhost ([::1]:45338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGoy-0006aZ-UK for importer@patchew.org; Tue, 02 Jun 2020 19:59:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGnu-0004sz-LQ for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:46 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:46316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGns-00024m-TL for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:46 -0400 Received: by mail-pf1-x441.google.com with SMTP id b16so274439pfi.13 for ; Tue, 02 Jun 2020 16:58:44 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:42 -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=vTBtqxUpy9WkyuXZwOdXZa6I5esZFyA9WphOj0ye99o=; b=HNtGcLc6Yyw5+6+vY6ITL4eIFnkYGQRDyeEkT1NZ4csfYphonfhp/17pzPH56N8ntC BLvlW1tAMMf5p3XLDLKroM9NpeQJjlrk/ICD0iSuT2PHRqWabDmkMOwXT+t1TlYuqtBt 6jo+u2+l1utUe3mmGd4YCjWH85t2q66DThPdr2oXSZV4sPjODqPfKpf1Y9UCqopoYNJo goS1XvcRT4eAMpUE7pFl8hp/6c0b8cS8eY9mq43g5MXatvjScubrzskdaul2SgTClRC6 1LICit+LjxzDVJa1Toh4Wmn98EZ5UTBZdkLlYChbhAbvwfS1j4iOWM6bpfYx9SuzHMgk T87g== 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=vTBtqxUpy9WkyuXZwOdXZa6I5esZFyA9WphOj0ye99o=; b=TZFxO3EKQOR3RG/f/R7jDcLYKfzcgdGVG43X+v/h7heiFL4eQid8nvSHfwZiv7f4M4 eEYb5e7Y4ImkjVqe6qKMlrp7ueNx6ZKlKKal0Nn8tZh1z7NEOtIFtX1PqeZsQIE+OLJF 6JIg5+3YsExSNRarSm0guRJEJx00IICSatwIAMyrOBkrHa7ZG2SYa1vtM/3+/X8Ul+fX Ym41z6Ltc3qKN+hOtcGBNg3cZfkC3+REMaB8F35g9NP+Ig98Nj0oou18PnLytH7QWwgH Qk4Qff4DxCqU2n6v+a+2aB/2RLJW6bKHBEVr2hYjrk9VNkoOMznKILuHa1j4IdJyu/+K LI6Q== X-Gm-Message-State: AOAM531z4ubTXjnXz9TOuRwNSMcdu/lW2SUNN/QDNfBZKU6Fg6eyoJte eMuLhfn3MCHeE6ACsaurQT3OzEOtHEw= X-Google-Smtp-Source: ABdhPJxRPXMPlf/yXbo7xgLBAbfua+VcXubJDIoVGTkaENIXp/8tbKYeufWfgInphp/7CcFy3PjMnQ== X-Received: by 2002:a63:2806:: with SMTP id o6mr14757383pgo.328.1591142322771; Tue, 02 Jun 2020 16:58:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 5/8] decodetree: Move semantic propagation into classes Date: Tue, 2 Jun 2020 16:58:31 -0700 Message-Id: <20200602235834.470345-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-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::441; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x441.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, philmd@redhat.com 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- 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.25.1 From nobody Thu May 16 20:17:00 2024 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=1591142612; cv=none; d=zohomail.com; s=zohoarc; b=SNjJRQnNHSCETIhRWYonrM3aJ3KcZYMH35rMWo10x7wOrm8kAfgvrw3qPsX3z7F8Tveir9Wfih+xPBQnEzE20h60bZVj9qQWwo8egvKOpyFnv2tKpAsrspURj8GggGiPSKSjqlYguhX5goXtHg+wripcfKFmCkiLkU1kPwIwZkI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142612; h=Content-Type: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=T9g/1bYL5AF8SWtZFiFU5ixPPASa6ChAdx/2pCnn8+k=; b=g5wVc//nyMPg9cNbUgy5M0xS0y8gYde0iskgk90QTRuSEi3rKOZts/JP67q1+b6pUJwbzbGoUnsp3ZKnrVKplTuQHTj9IP0+F2teeOmUZHJ3X37D8PuRIWbfDu7M2Ggnk7fSvh6H5JI5A3UPhjGjSHXQ423+IBv1DFHwPjpkGLM= 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 1591142612227750.9218883330807; Tue, 2 Jun 2020 17:03:32 -0700 (PDT) Received: from localhost ([::1]:57730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGsU-0003NT-Sr for importer@patchew.org; Tue, 02 Jun 2020 20:03:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGnv-0004uM-9z for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:47 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:40715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGnu-00024y-FV for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:47 -0400 Received: by mail-pf1-x429.google.com with SMTP id v2so294117pfv.7 for ; Tue, 02 Jun 2020 16:58:46 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:44 -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=T9g/1bYL5AF8SWtZFiFU5ixPPASa6ChAdx/2pCnn8+k=; b=qZJBNhgobPOrNgGlxq5XE+HbFruffBAbh+WUkUA+QIHdbWHFD4FGbbeRb4SUax5YzT rYwh6A95BJlleTrEpkr9E1jsV+fJZgHZwPCkW79IumzvMO2bHvBTaf0CQFGeSjnYTJ1q BpzjLNtZTNq5JICPOZpQx9tExo4JdNm+oOjQFILoM1RJ6SwZU6DpPQmq6MoAyoBVky+/ 7rba46wOzG3rt0ImrQQs6YGEgvRMncdd+0cEQvrDtEf/QV2uCU8i4r+YxHfANmYbKNl6 dWNBKx3muSfLRlcpCa1CQe5hB5hZIUq4aFMiLt8vbLCOrnyFqWxEaMz47/lDjn6Oo6v9 2InQ== 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=T9g/1bYL5AF8SWtZFiFU5ixPPASa6ChAdx/2pCnn8+k=; b=j85uPZB35zFIDxEgCy9k0zQaQj6742B7OpsJwCjOYs/1D2sJ9cX9xCRlzh8+awssiG kX5u3xaVyOAvGv5npkmpXkJCHU/nuORKwE/d/yBBUgB8hHj04CcJ4iiAtXEE4fSyA/43 S/nv/l59RtrpLXsW7aty8Cdnya0Gxbv39Ytyz8a7gDPJdwcDhKN2rLiQGO/OazGRXIun PCpkpvd+2XOip4ovsqRTuLYyCwbVxBXlDntTPNFm4N/ZUB7U7dp4qnlBVfPBZTD5sXjU L3a/duPfWMS/WkUncAoK+xEEx+fPeRq38OIWxvCLFgFWz9caEhT0e9o77HzMgnZkMe+g e0GQ== X-Gm-Message-State: AOAM533Cn0jzfaP66uPuS2uKxTKcLaOTf553PR6vJiQQ62U8o29IZqo9 Es+yyJtkpivf9qNIsDSpbbPefbdQwzo= X-Google-Smtp-Source: ABdhPJzNrMBAQZSmgPPw+hqTah32yVrErsorwcPaaQ5AeElV7faPbu8UDh5UE1tzTOPbnlGFixY9wA== X-Received: by 2002:aa7:93ac:: with SMTP id x12mr29950554pff.143.1591142324732; Tue, 02 Jun 2020 16:58:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 6/8] decodetree: Implement non-overlapping groups Date: Tue, 2 Jun 2020 16:58:32 -0700 Message-Id: <20200602235834.470345-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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, philmd@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Intended to be nested within overlapping groups. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Suggested-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- scripts/decodetree.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 0ba01e049c..7e3b1d1399 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1021,16 +1021,20 @@ 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: @@ -1044,11 +1048,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 +1074,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.25.1 From nobody Thu May 16 20:17:00 2024 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=1591142393; cv=none; d=zohomail.com; s=zohoarc; b=ZNOf7eJbmyondCxK7ZUeeIFZkya4HZjmG/081y0qDgZGvJ3vovXW/4PGrsfMuaDv5TOv8EW6PR6pcGpgpNISPI7NX0ZhwzwlkdlclJnryt3dlv++QLvcKweqKZ+7ljMlgGdWy+u29JIgUlTzHhySC6IEQl1NlsagykRF3ygg6S8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142393; 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=hZUxt2iE/yogniLtrjMplHAnQGgnoAhQivH1x/eLkRU=; b=OqQeOaV39Vv8DEehbuGsIS0nclWdizQDRj/uNncP9SofXNmdOh/xXEFUVtYoh5bv/C42lf95RRdUyO8fBdQp+c4p6T3YBmX9/V+lbARZR8Nc1NN5NT5M6cV9JxwQmtY1KgxFXus/Ff96qIdJ5Y4b+G5iM7r+dL5zsttRVijQ5U0= 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 159114239320537.4303923081153; Tue, 2 Jun 2020 16:59:53 -0700 (PDT) Received: from localhost ([::1]:45348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGox-0006ah-Mo for importer@patchew.org; Tue, 02 Jun 2020 19:59:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGnw-0004wn-Ls for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:48 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:41832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGnv-00025A-RQ for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:48 -0400 Received: by mail-pg1-x52c.google.com with SMTP id r10so414083pgv.8 for ; Tue, 02 Jun 2020 16:58:47 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:45 -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=hZUxt2iE/yogniLtrjMplHAnQGgnoAhQivH1x/eLkRU=; b=thnHkZYUyTsgH4VeONOgCqaOPgHyKSzn6jOF4SbpleztaoPD/RPz+0vF/USxTlyCYl /zq3PCMSH41vEooRJDHzs14Fojg6UFvAFgWWowX6NpqHPbkuLc+T7c3ka2kmiLJcejhC Z3egmH6hdMFo7/MRUuCY1RL3X+sLgVTjVBAIlX8fb61sblAQ7+//DdTqrx5noXqfSm4y DM0ug7jYEJQrCnIkDxJoWMsR4Vu1E+68MngXLUIimSi2QH62ZvTycp7gXgTquD0DDSxn AkWYSULGctYuAjRmM+4OJmMklzDreZzA5nDSvyJ4RHMPDfPGX3F1G3UdCkdmnNNYCq/a XLsw== 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=hZUxt2iE/yogniLtrjMplHAnQGgnoAhQivH1x/eLkRU=; b=iyNPOS7Um3DpndIJXXHL6jhzjD+GpSM0Gnx9hkTH7jEhyX60mopQr4ExtFKBcmfUBQ qyLwWq9Wt8erjGxnYPHSrnvXJo6qgjYzzSz21Ow1xtR+KhIxP50cKVurlJyccg/4xPPz NXEARqzJrBHMDuPYbnpRWIIVrlKWTY8xbPkXyt5fVZTT8u/90bzqzsSjLNt68AmHM6wX qogR+6dDC+vBLoLvUy/zOXm301L9M4txYM11w7YCKj4o/FLaN/kvHarljaYuJN2Ni4jK yniCRWwdX4ztBZ7Me3XP5Jxss8r21z9fXOl/J51qYWHq6TkDQje99UdUZYgj296H0mnB 0sfg== X-Gm-Message-State: AOAM530mJZD1kg5lPPXzfTPEIJCi4taRuLNW/cBsE9dpEON8xQrw8OYi MWeydNfekWhGHDvMaKcOz4QHkMg+RU0= X-Google-Smtp-Source: ABdhPJyDfMWAepu4I6xb2O1iVojSfSbcZyMReroFw2efzwX+kZY5ZY+AMQ3EBZvBwJigHnrAUhN1Uw== X-Received: by 2002:a63:3ec4:: with SMTP id l187mr26254673pga.358.1591142326108; Tue, 02 Jun 2020 16:58:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 7/8] tests/decode: Test non-overlapping groups Date: Tue, 2 Jun 2020 16:58:33 -0700 Message-Id: <20200602235834.470345-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-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::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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, philmd@redhat.com 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: Peter Maydell --- tests/decode/err_pattern_group_nest1.decode | 14 ++++++++++++++ tests/decode/err_pattern_group_nest2.decode | 6 ++++++ tests/decode/err_pattern_group_nest3.decode | 14 ++++++++++++++ tests/decode/succ_pattern_group_nest3.decode | 11 +++++++++++ 4 files changed, 45 insertions(+) create mode 100644 tests/decode/err_pattern_group_nest1.decode create mode 100644 tests/decode/err_pattern_group_nest2.decode create mode 100644 tests/decode/err_pattern_group_nest3.decode create mode 100644 tests/decode/succ_pattern_group_nest3.decode diff --git a/tests/decode/err_pattern_group_nest1.decode b/tests/decode/err= _pattern_group_nest1.decode new file mode 100644 index 0000000000..7d09891a1c --- /dev/null +++ b/tests/decode/err_pattern_group_nest1.decode @@ -0,0 +1,14 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 +%sub2 8:8 + +# Make sure braces are matched +{ + top 00000000 00000000 00000000 00000000 + [ + sub1 00000000 00000000 00000000 ........ %sub1 + sub2 00000000 00000000 ........ ........ %sub1 %sub2 + } +} diff --git a/tests/decode/err_pattern_group_nest2.decode b/tests/decode/err= _pattern_group_nest2.decode new file mode 100644 index 0000000000..c172239e9b --- /dev/null +++ b/tests/decode/err_pattern_group_nest2.decode @@ -0,0 +1,6 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +# Make sure braces are matched +{ + [ diff --git a/tests/decode/err_pattern_group_nest3.decode b/tests/decode/err= _pattern_group_nest3.decode new file mode 100644 index 0000000000..b085d01410 --- /dev/null +++ b/tests/decode/err_pattern_group_nest3.decode @@ -0,0 +1,14 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 +%sub2 8:8 + +# The exclusive group should error for overlap. +{ + top 00000000 00000000 00000000 00000000 + [ + sub1 00000000 00000000 00000000 ........ %sub1 + sub2 00000000 00000000 ........ ........ %sub1 %sub2 + ] +} diff --git a/tests/decode/succ_pattern_group_nest3.decode b/tests/decode/su= cc_pattern_group_nest3.decode new file mode 100644 index 0000000000..156249f090 --- /dev/null +++ b/tests/decode/succ_pattern_group_nest3.decode @@ -0,0 +1,11 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +{ + [ + sub1 00000000 a:8 b:8 c:8 + sub2 00000001 a:8 b:8 c:8 + sub3 00000010 a:8 b:8 c:8 + ] + sub4 000000 d:2 a:8 b:8 c:8 +} --=20 2.25.1 From nobody Thu May 16 20:17:00 2024 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=1591142517; cv=none; d=zohomail.com; s=zohoarc; b=jxAE+JnViIS5KXCSaa/zYwaZ91BIoVjZYZ0MeAhMJl+rSVoOOdeIvhnz+hj3yTbBEZtIO7iVH2BGrzwKoZexznxS3Z9knGop60LNZ14ME/vHUK6FAHkdu07JZ3naWRI7LzGMA8YMITmr6vTY4MWy6OpPF7wkBmP5c+MUP7cDl0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591142517; h=Content-Type: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=8qc6oDN4Zl6MEuNRZIzxS7SMNWB7rYpnfgGgJ3Ds2L8=; b=W6aS60zoOqWbR/93b19lLUggtCQijk8CdgjD73IiMhs409tii4Mewh3+v7ME8TNeXmoIxVxGYKy+AiXslWn6Im40vfZCZ/HinT04K0H+GlhqXBicxbe1/xBKs2SH6fq7YG2MT1npoYzbIdBsKSPYzxuwxDRrG/aVEvDfC7p6LNs= 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 1591142517326809.4207914386265; Tue, 2 Jun 2020 17:01:57 -0700 (PDT) Received: from localhost ([::1]:52838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgGqy-0001IP-18 for importer@patchew.org; Tue, 02 Jun 2020 20:01:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgGnx-0004yo-Hl for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:49 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:39410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgGnw-00025K-QV for qemu-devel@nongnu.org; Tue, 02 Jun 2020 19:58:49 -0400 Received: by mail-pg1-x544.google.com with SMTP id w20so424668pga.6 for ; Tue, 02 Jun 2020 16:58:48 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k101sm182201pjb.26.2020.06.02.16.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 16:58:46 -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=8qc6oDN4Zl6MEuNRZIzxS7SMNWB7rYpnfgGgJ3Ds2L8=; b=DU5sz4rtCbebQK0q4bEaxfBpZbqrAJJIAyftte2qhxPl+tzbBSllL5RNyZ9ZH3luBo 5Irihe1G7+XNviQc8F9iPiZ0UwjEx5rgMF/c0autWhMsVEWiv3+pw60G4jAQs6xJBVwQ pTzrw+aZBdAtKAVpqCTjGNLHKb08suaPveBOXA2EFozKRYMZCq7REdHMdKL4GHHsF4+B 1N6DYpvkimEdkMaa5oyiJRqoZNrE6ioFRVe2FgFOtRA1jg+69Qnywql5Stuhc1daZxxj mh/REqpD29FIGD4H36v0Yd217ux4uK6NK3Rnl+xLUAj+Lb4ccatYRMaM91BWZvjniC4v PfhA== 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=8qc6oDN4Zl6MEuNRZIzxS7SMNWB7rYpnfgGgJ3Ds2L8=; b=JRlKaOoA1CjQKzctvM30c6vHpZkEezGZSM6qqDISK2e1+i4mtEheEDVdTb06ylceTG aXPRWkeG3K512//2NTrgwz8L30Js4aenkxXB4KPhci2+gbVOst6dWwG3uMSwXd2UCokR PSFaWAREkz02sz/g+kV6N0pW9ljETiU71jnXiH4Nf/UONLtisPtGjXI58X3Jze3qSlTV XboUztb6bRhcLuom7qvGc1A8S5z08qW2/KrBr+TOJChyHfmPKqmRpINEMKCUUXPU4CuA tRa0yLv31/M2lfF5KJZr3y5IqoaPZCck5Q1/gQAElAGYZzIvbHqhYZx5QCB1+bwTK7rA siWA== X-Gm-Message-State: AOAM531JBm4I30J2P5PadqWnLD3tR6IMNpuZY14A4cZ66VGfpqGFN51M Ks44pCOgnCAN/Hif2uIAVIplogvpZ1I= X-Google-Smtp-Source: ABdhPJzjORF75TTK2JejTrlU6aKs6Yh8l+gDx/4lkny/0yOAasQlUABh6jIso4mhutDVUN0vLdE5UA== X-Received: by 2002:a05:6a00:50:: with SMTP id i16mr3897493pfk.25.1591142327284; Tue, 02 Jun 2020 16:58:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 8/8] target/arm: Use a non-overlapping group for misc control Date: Tue, 2 Jun 2020 16:58:34 -0700 Message-Id: <20200602235834.470345-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602235834.470345-1-richard.henderson@linaro.org> References: <20200602235834.470345-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, philmd@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) The miscellaneous control instructions are mutually exclusive within the t32 decode sub-group. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- 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.25.1