From patchwork Sat Feb 23 23:29:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159138 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp476507jad; Sat, 23 Feb 2019 15:34:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IaChTq0o5IJChN7Pth9b/PDvZt01EexYxy4DAjB0IBOozZNWQ4KLm+zy5GgxvDwfUk4ULug X-Received: by 2002:a25:b198:: with SMTP id h24mr9075838ybj.177.1550964850179; Sat, 23 Feb 2019 15:34:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550964850; cv=none; d=google.com; s=arc-20160816; b=NmjlwPIB54S+IBxB8AYH67cOMdylg0KTRMMIpJ9wypE2guISw3iZm5OUkQQoOMroQ4 uMiixeQ0PTmJCOPxE2+0tyZv2+LMq20Q/JV4wgngMBgFRl8sIwyLAgXGJhaa+f+50iHA VGzfIlhHYL6pwISP/WQVYyQGFZEPWm5YZe4CV87iPNxqWlkMsbaHh1+zoK7gJcVohpuP 2kCPpKp1ECUk6C/ZDKipjp/Dr/jDJoHJdPSLNYTpZ8nbXcWTfmDHCHfei6iKGMUcrAG/ d2gVa1Zeoiu4OW8bgxwFEC7+Zp26Av4tLiF4n/ENEVVKDdqmfMeauGk2o74ozK5077Fg P/gw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=jjG9f/cUPlGsuspqa1NpIrIE0Dj9kdzyNpmBX1Qf7Vs=; b=w9JvH+s1twatjMxp1j8Nu/8duqoLcLn8AH/zM1D+nJEbLvEr2Cv/GvVSpP3cxjdrI/ HQrlZT1xSxi6bpuucFngjxl5fXaJQxjbrw+Ey5q+FHkuw57j4htKeyYk5d7nIq22oi/o 57dl+UEJ79MPKoiTMS5u5TAmJ2OZO5WJt7BLvXIZjjQANAqeNbgyPkVt5Is1x/ANqWf8 yMBzScxOYX12ETdzNaD3bFgPdqWN/l8sr6fPgu1TFl6GFGbXbRDlOjU8eGeI/CMbghMV UMduB1y0oR714D3aIsIu0t0BR6qS3iHPHM6IB9pzzlNC3xUUJ/haWt/J/oXbHfIyTa+H mgXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=psod3pjh; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x189si3177086ywc.338.2019.02.23.15.34.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Feb 2019 15:34:10 -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=psod3pjh; 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" Received: from localhost ([127.0.0.1]:43865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxgo5-0002rC-Lo for patch@linaro.org; Sat, 23 Feb 2019 18:34:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxgkA-0000P5-Cu for qemu-devel@nongnu.org; Sat, 23 Feb 2019 18:30:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxgk9-0007MW-FE for qemu-devel@nongnu.org; Sat, 23 Feb 2019 18:30:06 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:38342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxgk9-0007FA-06 for qemu-devel@nongnu.org; Sat, 23 Feb 2019 18:30:05 -0500 Received: by mail-pf1-x433.google.com with SMTP id n125so2766979pfn.5 for ; Sat, 23 Feb 2019 15:30:03 -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; bh=jjG9f/cUPlGsuspqa1NpIrIE0Dj9kdzyNpmBX1Qf7Vs=; b=psod3pjhzscg7dxvGZJvNUNn+Bbd95nbTklEDTcv0mLmu6JuyIDQgqfnV6s9sypbzK EHo29SDHG+K65N3tzb4Pkw6ih/0JuSOflSB781DS6Y/RM3Egrkt5km0d0pPGOo64bPQl 9hOjSfSM3nZRdcYAgaxOJk6kCbLVfShgUJD2GSj+uALUKth80sI2suFnMZdV1y6glo8D Gz1SbasFjhvwpTfLPZ/TCc2IumV2tGR34QSDDi0AsCvKq3NmPVnzgFw/r7OD9vQ0oifV k85jGBMFxmJ1dzFvJUWleQMOyiNrJmKDFNiNnbVIrpHrKh2g1FdwgcFWN6ZwkCHtx4ZN d/AA== 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; bh=jjG9f/cUPlGsuspqa1NpIrIE0Dj9kdzyNpmBX1Qf7Vs=; b=I2Q5Xyln3xJvSrOPSNC/ieeJexO18oHEdQK/17a6NDjNkKym+ANsOpLR7/hc/x9NpO nuf4tCgCf5Pt+FnCIQqAaPqQ63xXDj62Wk56JKHzqvinVConnbnBFKf2Jx+GS9Gtb1HM Opmuq9wFapBWA5sYPnjinGhMBYRJAWmuCXelHDXAu6+W3AcHkl99YNISN/lgRN9G/UzF yM2RMZYyvd+6GexbTqeQZw+yXOjWNOFxZQSgPCZe3aR/cNVOqBiP7+Rg+P0MtxFVmWun XDhUHcv5DIEREPHI/fyaABS7ZDT9QpK8DVJatzVYI+D7H9T8+j6lnVgVE5NiD2W8cIKa lhRA== X-Gm-Message-State: AHQUAuY+h5rkZQukHl2/iWE+LGR2CmHU2zKfKYTO3Cp28vNAGj7BXGF0 s6y5CmetPJ23QKWC8AcH0TBKYTraKKA= X-Received: by 2002:a63:3446:: with SMTP id b67mr10764726pga.122.1550964601767; Sat, 23 Feb 2019 15:30:01 -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 n1sm13214842pfi.123.2019.02.23.15.30.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Feb 2019 15:30:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 23 Feb 2019 15:29:51 -0800 Message-Id: <20190223232954.7185-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190223232954.7185-1-richard.henderson@linaro.org> References: <20190223232954.7185-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::433 Subject: [Qemu-devel] [PATCH 4/5] 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. Signed-off-by: Richard Henderson --- scripts/decodetree.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.2 Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Bastian Koppelmann diff --git a/scripts/decodetree.py b/scripts/decodetree.py index fb9a0ab3ad..dd495096fc 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')