From patchwork Tue Feb 14 16:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 653477 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp3147396wrr; Tue, 14 Feb 2023 08:33:37 -0800 (PST) X-Google-Smtp-Source: AK7set/g7gT+IPKhP4O8JK1QExIXcFxPbo2rZFgLcA6bWJTcRIfO2bflQ3Nm/jXKH6gjIomOxApK X-Received: by 2002:ac8:5d88:0:b0:3b6:9b37:e03c with SMTP id d8-20020ac85d88000000b003b69b37e03cmr4747928qtx.7.1676392417705; Tue, 14 Feb 2023 08:33:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676392417; cv=none; d=google.com; s=arc-20160816; b=KGrpUdVLlcAq2vsL6e/GXxGFG1OO0ggs8GLlxVcTSyBnAceAzx24V3kj1FnH6udx31 AWSyiztHJHi22Ftd3D8bqY00sFfeGZ5EVQCgZK5F9Gb4v5gKgjd3eOc+8PnjAJKq3OH4 EywGVAH6V9PDt9g5XY7PAt2WDSPKz59MA1wBP6Z7js3Q5qgf+rSvNubYKN146NHJvLmp 1Bz6hyCIYeIdzhGm7bV6kwVYzj9TK+F9w55wwZNth5Atq8EfjUoUYvShdS8gR5f2TUiR i0KzGVQ7uqSfUtb7sPEU4yYk4+0j79KzCMta469GQaQfT2Pzts0Zo9LfGZMlHx+BBHCh TNBw== 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=FWhVmviwicT2773S7A8MT/igFkSHAUSa6nNXW5mbKWI=; b=HfCdZ6C3xxhBBrhQilyjKGhyJzZss8tDz2DziFK5+noXSlH1sZxPrFpscBT8N3qUuf jedumwD3JY63+Er9wTfqtNImPBUdiu18jo60rHQwByTYb4KYH1NFSDjeUUNiZ4QMI3LY InMBcYWS7E8uG4xGf9209wnIuMJ3U9BFUGLgz9WqL1TvBQru2LyO2sGOOayYzUNR7t8a nbDAywK4YOMSJP22pKf9pB70w7/HujzYzpnj3cR4dQdSQjKik/gK9oWcDwRyJ77dmnQD QvPoodUdrTWXm7zcWrnOIfuYeOngC67c2aNrOh6cEYz3O9/ChPKueqjkuviIk7hijPnG 2zXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EL+Q0afU; 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 s186-20020a37a9c3000000b0071be54da3basi11497556qke.292.2023.02.14.08.33.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Feb 2023 08:33:37 -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=EL+Q0afU; 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 1pRyD2-0006ap-Ez; Tue, 14 Feb 2023 11:31:12 -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 1pRyCt-0006RZ-03 for qemu-devel@nongnu.org; Tue, 14 Feb 2023 11:31:04 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRyCq-00027t-Oe for qemu-devel@nongnu.org; Tue, 14 Feb 2023 11:31:02 -0500 Received: by mail-pj1-x1035.google.com with SMTP id w20-20020a17090a8a1400b00233d7314c1cso8330478pjn.5 for ; Tue, 14 Feb 2023 08:31:00 -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=FWhVmviwicT2773S7A8MT/igFkSHAUSa6nNXW5mbKWI=; b=EL+Q0afUZWALWE0ZQgN3DqWr6oayznMVqdivYIGV08XURh2X2O/KUOkKilNRe73ckM 5JiTyNodTIwJX+ZPsaIvEeJ2hbW/PPa4UvPuZ/uNk+Gwk1bOooZgGTZeNCWbInSEI/8c iW/uRMl5LvE90XFM5IIS3WZC5FZ/CvpwUluDDODXQA86hqvP8dz3zHS2pWWxEUsrkV89 jnucasEl+frTgf0igtpGC1YZksUKZ52W6paOQfwPaFxvTIY0j3UqeM0hQ421YUcO1ab9 dndKAK8oJM4QkZ/KN3hQbPxRIaGkiLIPcOQKFEpTtOcbXf6bTbzh+kfW7qznUcp/08WC mwbg== 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=FWhVmviwicT2773S7A8MT/igFkSHAUSa6nNXW5mbKWI=; b=fgSLuosnjvzsheIl2d5Xu7HGIsHpFQdd4mAMpNQf+N/MibjHYgOop0BgWkdDpfcqgl cGgCzeQPHzZ3QHuSie/4x7u9IKU1yW48uq9BqG1Y4AJXI9PBQZg+hDUUefGG7vqbvIkL UCLYcISSkV46p2bykgx000oC/SDep9Xu7dn/wuXnqULXvvb8z4dUABqQQxAeycM/qWFW WYAlUGWXPMM1pD38WWx/ZuI0Bjytbu3gW07j0P4/Kk1MdPMiT/HkuadOLgI2sh0tzyha lpqa588pRKrZHBxIucjf0hsxjFm7XeyE0k+sUUM1wTYl67KGOlEfGsOJJmgZLQlH925u 300w== X-Gm-Message-State: AO0yUKVHNnaONsH0dD9m0K8QnDn2rLF1DkcYcGVycg7XID+rZbJvEb/j 9HjdtLWuHlCYQunLcMH3+TXtnRHVdQx1CzPyRtc= X-Received: by 2002:a05:6a20:938e:b0:bf:1662:b2f4 with SMTP id x14-20020a056a20938e00b000bf1662b2f4mr3403156pzh.49.1676392259167; Tue, 14 Feb 2023 08:30:59 -0800 (PST) Received: from stoup.. (rrcs-74-87-59-234.west.biz.rr.com. [74.87.59.234]) by smtp.gmail.com with ESMTPSA id d17-20020aa78691000000b0058d99337381sm10337011pfo.172.2023.02.14.08.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 08:30:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 05/14] target/arm: Simplify register counting in arm_gen_dynamic_svereg_xml Date: Tue, 14 Feb 2023 06:30:39 -1000 Message-Id: <20230214163048.903964-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230214163048.903964-1-richard.henderson@linaro.org> References: <20230214163048.903964-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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 Rather than increment base_reg and num, compute num from the change to base_reg at the end. Clean up some nearby comments. Signed-off-by: Richard Henderson --- target/arm/gdbstub64.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index 811833d8de..8d174ff6e0 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -277,32 +277,35 @@ static void output_vector_union_type(GString *s, int reg_width) g_string_append(s, ""); } -int arm_gen_dynamic_svereg_xml(CPUState *cs, int base_reg) +int arm_gen_dynamic_svereg_xml(CPUState *cs, int orig_base_reg) { ARMCPU *cpu = ARM_CPU(cs); GString *s = g_string_new(NULL); DynamicGDBXMLInfo *info = &cpu->dyn_svereg_xml; - int i, reg_width = (cpu->sve_max_vq * 128); - info->num = 0; + int reg_width = cpu->sve_max_vq * 128; + int base_reg = orig_base_reg; + int i; + g_string_printf(s, ""); g_string_append_printf(s, ""); g_string_append_printf(s, ""); + /* Create the vector union type. */ output_vector_union_type(s, reg_width); - /* Finally the sve prefix type */ + /* Create the predicate vector type. */ g_string_append_printf(s, "", reg_width / 8); - /* Then define each register in parts for each vq */ + /* Define the vector registers. */ for (i = 0; i < 32; i++) { g_string_append_printf(s, "", i, reg_width, base_reg++); - info->num++; } + /* fpscr & status registers */ g_string_append_printf(s, "", base_reg++); - info->num += 2; + /* Define the predicate registers. */ for (i = 0; i < 16; i++) { g_string_append_printf(s, "", cpu->sve_max_vq * 16, base_reg++); + + /* Define the vector length pseudo-register. */ g_string_append_printf(s, "", base_reg++); - info->num += 2; - g_string_append_printf(s, ""); - info->desc = g_string_free(s, false); + g_string_append_printf(s, ""); + + info->desc = g_string_free(s, false); + info->num = base_reg - orig_base_reg; return info->num; }