From patchwork Thu Feb 28 05:24:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159312 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp230871jad; Wed, 27 Feb 2019 21:28:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IYZjOCPsmZJvx3o2jyi5dAP1aSmNv2px4vP9wGpjaviWg4IARmWp5xFT52dCx2+Tjaobi9y X-Received: by 2002:a0d:cb96:: with SMTP id n144mr4111723ywd.87.1551331698386; Wed, 27 Feb 2019 21:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551331698; cv=none; d=google.com; s=arc-20160816; b=NSrn05RX8D6vQ0kvyiMEfnLBFXIdziDM3SvvDEFZU3QNe8MK04nndH1KQ+Jlxtf+pD nUusR3zVsGR/gEryK7elakzQvQX6kDbNrApLCx/OADfMmqtrS6dE62gUtSkdytaZ8bF2 VNNFTTC3/o+o5fqV7GzhZEX++c4mBL5ChTu1Lke15zOFglNHw8yjA+4p+jdhuvHrHxtw fLLJK4oiUWLxx3AQeEfrnDzQjDl+g++GJ5R6KjZ6GU9ID9kGuZe6f92Pszlgfqt0kXyZ m4wusefQ2K/BuU30gKKw79oE1s6CH2Xr4UW0KaFZUqKTQ2qKsPYk+quDlScVAOAqZGvw CmZw== 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=xff8A+bJ6tIqJHXdfg5c9ETKDnx6ggV2FUuqo4lfisy2RLmHbIr8b1hSMkGmTsF3SP +RdbltSNE0CK/gPeODqmt3iLUPwjs8paURTLm14EaMGn/iNL4/XSElQvOPJtBmRU9/TO F5Y8ngTvlGwe0nzDRMa4xt0WZ1cWJ+USGFDfJu431iwFYsGvp3evNrRZQ1eENlTaLmT5 cblBQgDvt0X1uy7laG+DsTRYohlcpDUqmOfT/JxgdHOO3F/v8d6/xHbUhl1jaXzxMEI+ nS5riv8v2lhqYOH4fzAhw6uoAEo3HIQFZyljbWhWu06J9WX3JjN+AnQPzIwzGrN9PkOt GT2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pPYZ9u8P; 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 6si9608008ybr.58.2019.02.27.21.28.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 27 Feb 2019 21:28:18 -0800 (PST) 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=pPYZ9u8P; 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]:60600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzEEz-00082b-UU for patch@linaro.org; Thu, 28 Feb 2019 00:28:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzEBg-0005g0-8A for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzEBe-0003ms-8k for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:52 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:42937) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzEBc-0003jp-75 for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:50 -0500 Received: by mail-pg1-x534.google.com with SMTP id b2so9108653pgl.9 for ; Wed, 27 Feb 2019 21:24:43 -0800 (PST) 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=pPYZ9u8PLh+51c8aUzwZl9hmq8dhaEKMpCWh7jQwJFdL54eKhV3F84IVsXl5H55f+v oEZcoLqDdMYb6ynQOV1B5GOPV6V94PoBK6tTfY0fOAxmTnZpc3J1rCQUui0KR9fujK7m 85jJ6XEj34+rWP9ZmyrsBbwwGykT4Hd6uuWxG1YB7kO1/Y1C/O9kalmlv5IdqwfCq5p3 mbC2LrG1YzGhhBthLQ1oP7KiElpapR/KPy2O+CJdBVbrRWgMuoDvEKnwX8a5DXcghhS9 M1KlM+kaYFaiU3n+7Edz2M9H2Jkihao8FgkxOz3eFEfRoeDsPVtWWcdTlsrPysH0WG+I UJLw== 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=ZGGo/lmi4gqs5lQa08vHlQprwcvQHjoRIZdW15wt/eSKh58mtvkMA3dICYRgdKJUUB JGz6BDdRsNotAXgCCSz54K2i0OzagiyvOZ90uOJHWelHkLgj/mj2RZrtdZ3Rm77wTeW3 LQZlhEtGB/jYDK8CAqrJxzvqzHU2+xGuVK4ONm4wzYfRT3vac8gLQImcppDichrhBGbL Xp1n49yTydOyjYuRT7FxVW6un2Zi+fWr+M7PxNpS0t/d3jhQkOZ9xExYRBGm3h+L2M/z cw9OMbOqlmxL2kig1U5O9OVQgdLjooxyWaSp3cKufxFqc5FlAc4cKqfDNOzB/rZiG9QW MtCg== X-Gm-Message-State: AHQUAuZQ0jaoaUWOeAO6oHjcWFBNSHohIB3psAsmKTkovoLnAD/kliAZ marZNSObXLk7pfQdys/E1yra00Qqz1k= X-Received: by 2002:a65:6483:: with SMTP id e3mr6621039pgv.273.1551331482191; Wed, 27 Feb 2019 21:24:42 -0800 (PST) Received: from cloudburst.dc.rr.com (cpe-72-132-251-149.dc.res.rr.com. [72.132.251.149]) by smtp.gmail.com with ESMTPSA id u13sm32758371pfa.169.2019.02.27.21.24.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 21:24:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 27 Feb 2019 21:24:29 -0800 Message-Id: <20190228052432.32571-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190228052432.32571-1-richard.henderson@linaro.org> References: <20190228052432.32571-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::534 Subject: [Qemu-devel] [PATCH v2 5/8] 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: kbastian@mail.uni-paderborn.de, f4bug@amsat.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')