From patchwork Thu Mar 7 18:56:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159922 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7813946jad; Thu, 7 Mar 2019 11:29:01 -0800 (PST) X-Google-Smtp-Source: APXvYqwu+uReN+AfXn83SE8vZQaWt7+wFi0WgHXG7v1HfJkt760iegvEBzaf2f7WaAZC3OMNXWtp X-Received: by 2002:a25:c3c6:: with SMTP id t189mr13196150ybf.471.1551986941915; Thu, 07 Mar 2019 11:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551986941; cv=none; d=google.com; s=arc-20160816; b=rpdKUsd2dsJGtqZ62Hp62/esZMHP6mw1hhj41PYdI1stit2koUEh97ObN7kauqnRik qvjrhks+kUyCm4TXn80vHC0F5SQ2zLGbH5Tq5rIzZOb288HeFanTkiR/dNKrgjn03yNM u8Jni9yU9HhNYWkoM5ACGv0spyYq7VJQZ4mmVYJER9bz34w6j7Kp4LLya7qth+YDpVbo N0uqUCS7/mR7XTkWfNqjd6uC5dNOV+2u6YbF09sTZ9PKAzI40MUJcMRAONgwgNnoI05K 2la0qguorkbdnY3PSIsG31yf617fUezTzGamtpkSPZIhRv/zzggH0fbdzsbzQVI8ENzq XbjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=laOArhl6aZ5WGyq7zuQAWzojVDA3WH/aXpG23VltEJlqYrJEwMXcq1YAQvD60PDmMM 3lbQG3xxXvCxUEGanF+9UlAkXnK8Z0d1VoM+33IrPVc0WvXkwLM11xHyAyFro+MXYNuR UVor5MYZXtCaxNY8Ks+ebScqVcEegsoQJrnxHPOfVhDrfADF06AuKa3G/ldoBoC7kEU1 izIwto5Zcl9psoBFtUJ93BpkGUCLegEoBEmGQXBNyzzlHPt/vei06B/1aY2Yk7sEYUHI 0sDkiA51K7El3aGVtSslXRYamfLNmvqC46KXH0bnUAdP93Z4FyQBzkCdRCKh7xTdjsAN 82MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tP6lcPio; 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 z184si3131985yba.175.2019.03.07.11.29.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 11:29:01 -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=tP6lcPio; 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]:58145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yhR-0003v2-Fq for patch@linaro.org; Thu, 07 Mar 2019 14:29:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yC0-0001F3-UW for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1yC0-0002Pn-2R for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:32 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:45863) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1yBz-0002P3-RE for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:32 -0500 Received: by mail-pg1-x52c.google.com with SMTP id 125so11734010pgc.12 for ; Thu, 07 Mar 2019 10:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=q7BmrH4sjrNhoBHqeKigtEhx9qwjct0IB15Jx7wduro=; b=tP6lcPioXmPej7M8Be2wsHD715dt20oxt1SN7MhVVuQqW8IRDE7CEL8tQhEPUgUg1I yaxJSk++TYLVe/VwbGQNuICg9cMO4rELUsQVVOEM7fYUkO9szYLLbNQP2kzwxrNswkRB pvz8NtSqYfwMfJTd1p+QL54A3CAqDbNN+DLCwVLOUiygU0ijXevCZvK09wbUCgdovTUY iJZzURFQPRbd7y4QUlX8HNR1jAboMeR6sUiC7/u7dM9fPU283fyPBkZYG8kF2UNmvq1n zBGPelQQd2p5jFypqBJGXotIlksDUzrYq11H/MS35rIXIGrUJKvUtdfD2Mlc5mAsNKOo gfdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q7BmrH4sjrNhoBHqeKigtEhx9qwjct0IB15Jx7wduro=; b=ozO2f8TLSb9kFygnloBGFg++07k6RezfmnJeR33oq7/6wkoHhE8FKt0kzNZLLlEs+Z R+ZyRHeLfEu11ORjQ5XoLDUCkLrVovJsua1LmfRHlGJdBN8rWUMlJ6R2A5cslxr4KbB/ qZMYVWA/XgKajtZsrroyHjChB5Q+fN6Z61hpWyqajUXTDWIjXJz4AKvbceTvLoNkuPuL LoC54I+gOpFF/STbySPusGpB47CKa9W/BMlnNeE6hVILj+fCZfK99fkf3EJDuIGZrBfV wcXjVG6q2+zHn7uERyZwgstbecVz4uc+MR8A/IBKXUXrWrNOOMaP5MwMmZY7HDhOv+n7 eORA== X-Gm-Message-State: APjAAAV3rLQBvnGKdacgGBFxpR2MJJgmt8GeZP4KTE0iwjLtH2kxMWMk dp7nRudjIdvxFUbFyP1FPipg8Gv4Jwk= X-Received: by 2002:a17:902:4181:: with SMTP id f1mr14515380pld.280.1551984990532; Thu, 07 Mar 2019 10:56:30 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id g12sm8801973pgr.76.2019.03.07.10.56.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 10:56:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 10:56:15 -0800 Message-Id: <20190307185622.29026-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190307185622.29026-1-richard.henderson@linaro.org> References: <20190307185622.29026-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::52c Subject: [Qemu-devel] [PATCH v3 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: , 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')