From patchwork Fri Dec 30 00:01:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 637835 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3180721pvb; Thu, 29 Dec 2022 16:13:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXtLnqJpDP/NaPnh0vHBKDfvIHa7GoPIOpudQJ7wOQSMadLOaYf1Zj/l5xEfrRVnmqx75Zxh X-Received: by 2002:a05:6214:2f0c:b0:531:8681:b41e with SMTP id od12-20020a0562142f0c00b005318681b41emr21569667qvb.39.1672359181811; Thu, 29 Dec 2022 16:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672359181; cv=none; d=google.com; s=arc-20160816; b=dBiYtxmOxr0c3ifC0AgXwKxLcFn7P6VlmFhhrDmwIvuHpkAbJeyFZzeFQ5Poj1rJvl d3WBJhgs+1X0v8FFGXRV47rjnUmvlLm3uooNYI1Gd81Ii79wV6511TJVY4nv4AjSJwAz tcdJ8M+8tVwLzIdm2U9/pyDMOd+4371jg7aO2SSig+gbOzeIIce3x+WrAdHYop1PFypZ Yf/55PKBSpWgyYsbq4sSQjtHnuc1dZlSPMzxv5rFJVgXd4iF9n9f8XeojrlZ6DJ5Y9KO HcQusl/XxH2k4X8C75fOEvDxF15MVhqSOW4e9CfSItdVrTtDZ80Eb0gVer0EDVpKuCNs QBZg== 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=82jdObgJZFzER9GFo6NlXKKdjvOyLg4xyhd1mr3KndA=; b=gYFR7lSuWkBt9aBasybMzbmRB9n2FftsTSf/7MAyAir1rGehiyM7X9TsC00yFqC0W5 bzdF3FXu88s5aX3tITVlI60+1jRQ+XwpYJNaZWNMbqmNBCQe0Fu8JlCxYa+n0xayJmQQ wFo2+UCK5Mh3CZkcpCEUkIjKA96iZGueC9Vzjn5HqRV0Fv6O5gvPHAUdDnKUeoay6Yu2 yPhcm2HqoOwQdlDyCJ9HinXrARBFBNWPWHlWSUqimT2zUuSmJMB+CzVLU6hWeSZFwGaC hYR6Oa++uoPujnspa8kwlrdC0arcHURq9cYZxtBly0RLQqcqMi+37VzgOJ+W6rVY1VwZ 4l+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XJf+VZAO; 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 r7-20020a05620a298700b006fa696cce73si9935039qkp.497.2022.12.29.16.13.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2022 16:13: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=pass header.i=@linaro.org header.s=google header.b=XJf+VZAO; 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 1pB2rF-00034r-Sx; Thu, 29 Dec 2022 19:02:46 -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 1pB2rD-00033H-2g for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:02:43 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pB2rB-0002i3-1l for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:02:42 -0500 Received: by mail-pl1-x62f.google.com with SMTP id y19so1329045plb.2 for ; Thu, 29 Dec 2022 16:02:40 -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=82jdObgJZFzER9GFo6NlXKKdjvOyLg4xyhd1mr3KndA=; b=XJf+VZAOLyuNddIwf8h9zj6PsowiPHklT03oai+bQGH6QKYDb1AXDCijInv/bSLQPE L+miI5baeGHa0XlIgX7sF6ub+gC59hG0z6Ia3hsIbK80hd2F7mVISMSlglJd+F2IE4X0 b556TvFRNsNZdNgqcqOhyOLCMF0ZyYVhJ6gRfT6CrfBO+qHcS48n0iVQYYRo6rgyNDgR Czg8fCE/rV7cUmtYdD+QA4duwMCm1Eyoc+1HLLbZBHKTJSGh/olYm5aP7SQ5U3mYMC3F QoIzKDjjeWwheoFrGPOfCsC47bB2dmJ3RhOykCRbvgNxKpdzu6NyIOPwRjJPcCeIfMiS PnHw== 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=82jdObgJZFzER9GFo6NlXKKdjvOyLg4xyhd1mr3KndA=; b=ONT71OY9h3S1lLAqJTiMrIQ3AHshJlJgjk1mz3pRbcKocVa9McTnR9NrB/IfpCtlNJ 7R70VSEwZjpI9ZfC0Necb0zSwaKPjnf9cxJ0HC7ISX2S4nKb0U1fL+7ocAdQCZ2/iWTC 2mvPEAEFEs/z7MTXIHejWE5TWR0QPo4XQb9++z+FFgYZrBTQ4neAhyMISwlIQVFuzaVK A34rjF0rYjuJ1285F49GBbtDxiGsF2rdKz+Adbwmd/1zFXh0u80XcjakMhkw3k79UsHp 7LmGE6hoveHALbZYbwz0sjgTm7uvxEwXHuIBjeSREpS8hg7tHiItdiYMAaOjojYtFauR 4H+g== X-Gm-Message-State: AFqh2kr5d0XPJzpHnmllQ41qUIAwcWOGE+MOw2PGMcR1nxb6nIzUjIDa XCIWxDp0kmpc8h5MYevBmB12YIrj3FVy8q9h X-Received: by 2002:a17:902:ebca:b0:191:117a:414f with SMTP id p10-20020a170902ebca00b00191117a414fmr36301761plg.27.1672358559438; Thu, 29 Dec 2022 16:02:39 -0800 (PST) Received: from stoup.. (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id j14-20020a170903028e00b00192849e1d0asm7343953plr.116.2022.12.29.16.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 16:02:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 18/47] tcg: Massage process_op_defs() Date: Thu, 29 Dec 2022 16:01:52 -0800 Message-Id: <20221230000221.2764875-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221230000221.2764875-1-richard.henderson@linaro.org> References: <20221230000221.2764875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 From: Philippe Mathieu-Daudé 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é Message-Id: <20221219220925.79218-2-philmd@linaro.org> --- 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? */