From patchwork Tue Mar 12 17:03:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160167 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp13392561jad; Tue, 12 Mar 2019 10:57:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsK+KNQkWhlHpJAuxycNFeaktfAVgy7RbxPUa4wbkcCeT5i3UtBCJBEfbIbQZQJ0xEe6P0 X-Received: by 2002:a81:2556:: with SMTP id l83mr30629878ywl.290.1552413439966; Tue, 12 Mar 2019 10:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552413439; cv=none; d=google.com; s=arc-20160816; b=NAZ9GKxGl7xWJpyN4Mi6YkYUNMu0lhlbGWOfefjGX9S2l3mVfdP9sx1Hh0tLXb7+B2 XMhhiV//6Lrg22yjvcGz2KS75U4szuui/gUr6jMFn3vh7WbUT1T/C1cKmIQMX5iE5cqV Y86IRa/FYtfrMCZ+ci4tHTqaVwnX/eKWghxjV73TIWjFS3Wrd5jzEWeuyc/xWLdfi1zZ Xi1DO9x5qo7ya4lfP7erkATogSMl6+z10TfHBLZNfa9BDeADnWc63HjEMqg0kkwmJQCL PW0/l35wzb33Sx5GBgBixDVgkqe/Z9Y02Hg5NNPGUHSYxqg3mcMHQ8aSjCZMGQX4JJAw 8ycA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=q7BmrH4sjrNhoBHqeKigtEhx9qwjct0IB15Jx7wduro=; b=yKAECkRmtGkJAWTrgKuFrIYzdm4c1iHGsWFbFEtDeHNo218EfGirOqZz2kbLfyn7Em s77Y8rOlNDnowwxHDZ9RZTA815VM3u2Hie/gzqczsY9KVAUlg/iEEqCHgMvDcVNQe+k7 tqVyaZJPhGLZk5x5IlGvBV66U3B3yiAhDFWV6tzuWa7WRLUhadRSDL9pAZOk9PpA/tFk 1aclSAduEFCAbImdGQiALEM95jtylNqFrdzN1MqyDnKQ1lzL0uf1IH8vuIOMpV2bgvDt OgMeKTG54wX9IF8dxsJNv1gAQzvgNI6KW8v0yodFFerQEOIyGB9LJvVUeZ9901o4+vF8 ZK9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E9O8eM8P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 65si5258664ybz.279.2019.03.12.10.57.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Mar 2019 10:57:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E9O8eM8P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:56835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3leR-00067N-F8 for patch@linaro.org; Tue, 12 Mar 2019 13:57:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3l3N-0005yw-8W for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:19:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3koa-0001Bc-TQ for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:03:45 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:43412) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3koa-0001At-Ks for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:03:44 -0400 Received: by mail-pf1-x42b.google.com with SMTP id q17so2254448pfh.10 for ; Tue, 12 Mar 2019 10:03: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=q7BmrH4sjrNhoBHqeKigtEhx9qwjct0IB15Jx7wduro=; b=E9O8eM8PfIhA+E3vn/WkAVuQUMzX47SPjmcwVyTqBmKAcopmhUDDpN3qsGuK9Q82+x chegLU1RnV3z+L8V/rW9JDAOvnYH9uIrN1Kms+RTa8HNaIzsjUd1Daj/Eu6Yo0emV6Si IWt9gzqY+M1BWHJTyZxBeDVCtdSrogXh7pnNfyDlteMCSQancEYg+bhR7MEMUI2uRF5z jVue087v9Gv93lbXBbLBqSWC2GwNDprGO+88KhPXInjXZBWCd1ui1kuEN9SFg4Zaqejl xRZSPEF+lyvfCWBhcIPpezKCBhSkX6WZHQvCefIDxT3sNzKcm+dUTB1tsdtO08IOjGw7 76jg== 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=q7BmrH4sjrNhoBHqeKigtEhx9qwjct0IB15Jx7wduro=; b=A6d8Hq+0Opum3UqC2NzOmQrO3UvN/OSaXxEIJhhly9cLmOREsV/9ZNRP1IEGofxRFC fWCB3Q/sgxMb0jeTL15QuUBRdPOoqPodBSjfJgwN4bkZFgSUBiyWmGRnmSUtMuFrrUXf 03STbf2zWS6fd7g9YQggcBMBCeUDq16G97PXdCviq+MU3HZUAEjy/eQKSL0AD5H2DeeU jwyG4Lhyeryxj9pM9BK/Rr+VmhBLJOeJDjfa/tg8iY6CCJFYqeq9KykK/85tXGE2mswo Ip6QHN6EZESCDmR/PW36i9PWgKZHvgU9F5gQl3oCaB/bxxAFOPrSmP3ZmqaK4Nq/d317 6VBg== X-Gm-Message-State: APjAAAXJRf1g9Zz0xFesFljUifDWi+Ac4+6WPdfkAMj7HObr5FesoqIC YUj1dMIE3WuL7rHCP6x2OHNpyAQP4bE= X-Received: by 2002:a17:902:7896:: with SMTP id q22mr2936855pll.66.1552410223228; Tue, 12 Mar 2019 10:03:43 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id v22sm17514265pfa.49.2019.03.12.10.03.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2019 10:03:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 10:03:27 -0700 Message-Id: <20190312170334.14005-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190312170334.14005-1-richard.henderson@linaro.org> References: <20190312170334.14005-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42b Subject: [Qemu-devel] [PULL 05/12] decodetree: Do not unconditionaly return from Pattern.output_code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As a consequence, the 'return false' gets pushed up one level. This will allow us to perform some other action when the translator returns failure. Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Bastian Koppelmann Signed-off-by: Richard Henderson --- scripts/decodetree.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.2 diff --git a/scripts/decodetree.py b/scripts/decodetree.py index e26d8253f2..cc5fa1a8ab 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -348,8 +348,8 @@ class Pattern(General): output(ind, self.base.extract_name(), '(&u.f_', arg, ', insn);\n') for n, f in self.fields.items(): output(ind, 'u.f_', arg, '.', n, ' = ', f.str_extract(), ';\n') - output(ind, 'return ', translate_prefix, '_', self.name, - '(ctx, &u.f_', arg, ');\n') + output(ind, 'if (', translate_prefix, '_', self.name, + '(ctx, &u.f_', arg, ')) return true;\n') # end Pattern @@ -777,8 +777,8 @@ class Tree: output(ind, ' /* ', str_match_bits(innerbits, innermask), ' */\n') s.output_code(i + 4, extracted, innerbits, innermask) + output(ind, ' return false;\n') output(ind, '}\n') - output(ind, 'return false;\n') # end Tree @@ -932,6 +932,7 @@ def main(): output(i4, '} u;\n\n') t.output_code(4, False, 0, 0) + output(i4, 'return false;\n') output('}\n')