From patchwork Mon Dec 19 22:09:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 635132 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2586556pvb; Mon, 19 Dec 2022 14:09:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5qxYPKS72Jq6GnCbjjn9/xlWEK66xB4mQ8r+yyALNxWRSplBXmI1yy8GdIb3SZqvM7SkGX X-Received: by 2002:a0c:c30d:0:b0:4c7:4e21:d32b with SMTP id f13-20020a0cc30d000000b004c74e21d32bmr58780070qvi.11.1671487795266; Mon, 19 Dec 2022 14:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671487795; cv=none; d=google.com; s=arc-20160816; b=uYRG/TbZsqVb9YJBkS4FIn9ymsGaRBhpKVUAEeez0HRki3yXeHAdZJ+tkehQjg8X8u 797N2ZZFyeJn86SQVl+lvhlxr1INa5Kpdgrr2jNPFIsf2/cxpNVT4EKWTmUSrpY2FT6O ACiosn/kiG5kInqK+i8SHJ2XPxCXdWS8a0D1UC+OOuxJmLw7RGsyN8xqpHll+DQ02Upv 49KvTIH0vDxxCc10hTY2hS1jSBGG9qVXcB0hTf3Hf0zd5j8SmzxePeNqZIDbAV8ck0m4 aDAjbHzWHkEdr/BjC58ooRRstOkevfyn7Zx4AYQHabd+dJ7L28bMf6+Tj/K24+KZ+DMz Rktw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uzcpDEzkh6Xc0aI0JtsxV0tnoQlgrshM331KIKOT9f4=; b=WX3Nb0LKL5BKLHZH01KYFCGzKImZeyCBdErgPR15FNhVCRFum11Xe5ajl8tcje7lAX nc6w4cVl72ngU9WSJYKTa/1BZxxqgS4e3BFTxr5Z8UV/6FCsReZV7IYgt11IVJ3qg23/ wgc/C+MEWRUEdVggMDviA7Y+wOgV5v4419O6u9lgS2oCQANT2KX41R7lg/C10Ch9dxIF ry4yn5XiWcAl+D+aA5m3KjuShGcWifdHEBIRisZKVCqWCCBCmK1TE90VbmdliTBtxF2x KEfJDwhOTT2xgQ70fqRQBQUpBqDhFGR7fEID0OzR0ceL0Kuz3LZfE+uSzpFdaYFC3dg/ 0mxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qWiA5fke; 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=pass (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 y15-20020a05620a25cf00b006fc7ccf6437si455581qko.745.2022.12.19.14.09.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Dec 2022 14:09:55 -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=pass header.i=@linaro.org header.s=google header.b=qWiA5fke; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7OKK-0008SI-Nd; Mon, 19 Dec 2022 17:09:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7OKI-0008S9-0e for qemu-devel@nongnu.org; Mon, 19 Dec 2022 17:09:38 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7OKG-0003vc-BJ for qemu-devel@nongnu.org; Mon, 19 Dec 2022 17:09:37 -0500 Received: by mail-ed1-x52f.google.com with SMTP id m19so14937599edj.8 for ; Mon, 19 Dec 2022 14:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uzcpDEzkh6Xc0aI0JtsxV0tnoQlgrshM331KIKOT9f4=; b=qWiA5fkeAWa35c07MGB75nTaU7yS+amCMjbhy27GSBOCDWQV+g80sc9jm2GNkMXOu0 3MFSzFYuFCo2HSShqopp1ZP92D0w9dRZdtOhXUyKfqHnPwR0maMS7HNbbSsnzTqrp2uY UmPRG1rRdY30hWZqRnfOdjdQNxpWyQ4ahYidDZsg53dCbd57srJPrP4CDnf1hCDbSy7M dPSTF/qQb6KECtkTXqNSqKemzNAtXjZsrm8EY80G+5QgjT4YQMpNSXvde2RelXytpRG3 +uX+lxuTM8SFdLONicXaM7nIgUsvV9X5GTwWeRfjq7XTIFM5+i8JNXEAL2evo9lG/B/E BnKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uzcpDEzkh6Xc0aI0JtsxV0tnoQlgrshM331KIKOT9f4=; b=FGFumo4g3nP70Q1GnoLOoOnrv23MeUAb1P4AqsIB7eO5RU7cCIIJkGoa4ZnRyrxM47 A8M0aCMRCLFduww4IMCeV6rC0Tvpaka2lOBVpiDpkF/QCAaBTmn7YxgT8n6moKXLQ/ez HCdJ0Wl2Z3XmMY4j+nAMczhUOZS1gc2JYleSTvctmtM3qhJw18Y+qHJT72aM/KJeKO4U hWot70Wj7dD5g5u+ARS+Rr5xOEgwrgw0OH7LJ6XRwEvRlKeC3AB2QY0wVkO3wV6I2SYF BxYM5xnuCSdT8TfkwR6xpCASrDiXle1VTfQSuEqP2LKWEnxPX01E7wleUNn0wAfVjJMi xs2A== X-Gm-Message-State: ANoB5pn3gxvCXFrIMh8YVBVC/VJ+SscLmZu/VGG8yzl2fk100x0/U84t 0cpny4FVfEl5A0EfPGuH25yYLPAEUcksokUgjfQ= X-Received: by 2002:a05:6402:320f:b0:46c:ec6f:43d7 with SMTP id g15-20020a056402320f00b0046cec6f43d7mr51440021eda.19.1671487774282; Mon, 19 Dec 2022 14:09:34 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id n19-20020aa7c793000000b0045cf4f72b04sm4855634eds.94.2022.12.19.14.09.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 19 Dec 2022 14:09:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v4 04a/27] tcg: Massage process_op_defs() Date: Mon, 19 Dec 2022 23:09:23 +0100 Message-Id: <20221219220925.79218-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219220925.79218-1-philmd@linaro.org> References: <20221213212541.1820840-5-richard.henderson@linaro.org> <20221219220925.79218-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org In preparation of introducing paired registers, massage a bit process_op_defs()'s switch case. Signed-off-by: Richard Henderson [PMD: Split from bigger patch, 1/3] Signed-off-by: Philippe Mathieu-Daudé --- tcg/tcg.c | 61 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index c330d114bc..92141bd79a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2012,7 +2012,7 @@ static void process_op_defs(TCGContext *s) for (op = 0; op < NB_OPS; op++) { TCGOpDef *def = &tcg_op_defs[op]; const TCGTargetOpDef *tdefs; - int i, nb_args; + int i, o, nb_args; if (def->flags & TCG_OPF_NOT_PRESENT) { continue; @@ -2034,53 +2034,60 @@ static void process_op_defs(TCGContext *s) for (i = 0; i < nb_args; i++) { const char *ct_str = tdefs->args_ct_str[i]; + bool input_p = i >= def->nb_oargs; + /* Incomplete TCGTargetOpDef entry. */ tcg_debug_assert(ct_str != NULL); - while (*ct_str != '\0') { - switch(*ct_str) { - case '0' ... '9': - { - int oarg = *ct_str - '0'; - tcg_debug_assert(ct_str == tdefs->args_ct_str[i]); - tcg_debug_assert(oarg < def->nb_oargs); - tcg_debug_assert(def->args_ct[oarg].regs != 0); - def->args_ct[i] = def->args_ct[oarg]; - /* The output sets oalias. */ - def->args_ct[oarg].oalias = true; - def->args_ct[oarg].alias_index = i; - /* The input sets ialias. */ - def->args_ct[i].ialias = true; - def->args_ct[i].alias_index = oarg; - } - ct_str++; - break; - case '&': - def->args_ct[i].newreg = true; - ct_str++; - break; + switch (*ct_str) { + case '0' ... '9': + o = *ct_str - '0'; + tcg_debug_assert(input_p); + tcg_debug_assert(o < def->nb_oargs); + tcg_debug_assert(def->args_ct[o].regs != 0); + tcg_debug_assert(!def->args_ct[o].oalias); + def->args_ct[i] = def->args_ct[o]; + /* The output sets oalias. */ + def->args_ct[o].oalias = 1; + def->args_ct[o].alias_index = i; + /* The input sets ialias. */ + def->args_ct[i].ialias = 1; + def->args_ct[i].alias_index = o; + tcg_debug_assert(ct_str[1] == '\0'); + continue; + + case '&': + tcg_debug_assert(!input_p); + def->args_ct[i].newreg = true; + ct_str++; + break; + } + + do { + switch (*ct_str) { case 'i': def->args_ct[i].ct |= TCG_CT_CONST; - ct_str++; break; /* Include all of the target-specific constraints. */ #undef CONST #define CONST(CASE, MASK) \ - case CASE: def->args_ct[i].ct |= MASK; ct_str++; break; + case CASE: def->args_ct[i].ct |= MASK; break; #define REGS(CASE, MASK) \ - case CASE: def->args_ct[i].regs |= MASK; ct_str++; break; + case CASE: def->args_ct[i].regs |= MASK; break; #include "tcg-target-con-str.h" #undef REGS #undef CONST default: + case '0' ... '9': + case '&': /* Typo in TCGTargetOpDef constraint. */ g_assert_not_reached(); } - } + } while (*++ct_str != '\0'); } /* TCGTargetOpDef entry with too much information? */