From patchwork Tue Feb 21 02:19:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655339 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1724761wrc; Mon, 20 Feb 2023 18:21:09 -0800 (PST) X-Google-Smtp-Source: AK7set8w9MVZRN0e7I1Z9dec1fr8Q/LLFLRnY4GW78qoRbYtVKJe+PNnG51BiqMESa5zLJD0ANEl X-Received: by 2002:ad4:5bef:0:b0:570:ae8a:f34 with SMTP id k15-20020ad45bef000000b00570ae8a0f34mr3217664qvc.21.1676946069026; Mon, 20 Feb 2023 18:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676946069; cv=none; d=google.com; s=arc-20160816; b=zOK6N+tL9ijXyQMP+makhnz2PUkjnAnQChvcdHFar+P4fRM1enDjupzKARE1/6ujNV fqzJS5enmX/19uMK1iAqDCbagBNK1zZIi5KFkDZF6uAhLSHsA0m11WG5c4yz277Gs1+y qobbCR1i262xw8omlWN5DcWXR/em6PCnp88fL6vTNotYL5RuclRqyYKfYXo9mYwQeEKO JoKeS5JpL54PEj1nrisGt1hvV4AvfbEHFJQRnlPvETjeH1PelqUe59Hxf8J9HBP7BG0c Q7J84N06a4RZpm91I0xBROmRULSik09/mA1WdwqZtTmiZUkGS23P2nzYPCC7jNdlfJW0 6zKQ== 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=cGmftzbsAcVY0beQah1Rt/jBjqLnvx4GYi9E+DOFsUs=; b=0gVIrgziBa9w7tzvNmWfKLKwd+vbVbrZ5ZCgoznF9bSJNKR3qSRe4wpJneVMKxLUlJ RPad+L9bBmMeDiEEnKz1xi9VbLe/hqh166CnnMvm5rhf2SmL3DzWPmXuLJ0K6RGOe7wJ xJPYfiktjbZ4PkINw+w8rzLlDGJNTlzkVTo8lMiHThN44rRfo8qozPDWdMfrmlpZgbbT HzRzpTN7c41HNbqmzBxAeVHa4wE0VT0dMY7whqsPq/bp17pSo+dN25RIDq9ABfryKaz2 CPJaZfqrcrzbtRdoxdZ3Yel9EvSZtqrB/FXxt2mBW4rpIz6Az9boaztS+EgVnHr8NsWp n8tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fORRrxiz; 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 c7-20020a0cca07000000b0056ebc773032si10438745qvk.73.2023.02.20.18.21.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 18:21:08 -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=fORRrxiz; 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 1pUIGQ-0001fT-VP; Mon, 20 Feb 2023 21:20:21 -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 1pUIGI-0001dZ-5w for qemu-devel@nongnu.org; Mon, 20 Feb 2023 21:20:10 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUIGG-0008F6-8n for qemu-devel@nongnu.org; Mon, 20 Feb 2023 21:20:09 -0500 Received: by mail-pj1-x1031.google.com with SMTP id u10so3163971pjc.5 for ; Mon, 20 Feb 2023 18:20:07 -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=cGmftzbsAcVY0beQah1Rt/jBjqLnvx4GYi9E+DOFsUs=; b=fORRrxizROdpHnr2N6gsnNz/Cyt+aY44j6fDqKepmMvmS0+YbfCeZKKXJ40r1ifH2o 45mqtZJwfaaoGOYDaRM6j92h0zNixwMdqAurpkGqvzlT5x4R/ai9B7HI9P8thEKrKhdO JwCEe4fF6KOtoz/dIKJZP4zDuxT2ZlequQYdFD9t492dP7zTTc7fwIZEuvo6t9bydSRx oG8a6MO01q2CMG926dz5Pc3aA0OEXQCntUJ1ehOZXwjgtGTDhawccUUpJaRsssnilDgZ /941O797CMaOnnnhw1m4/5KgXXOEEYW1KJzk86/yAkNO+G1LrRF8Cex0iIv54dHGXRCI Hm5w== 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=cGmftzbsAcVY0beQah1Rt/jBjqLnvx4GYi9E+DOFsUs=; b=uX9V2hlHFFflueqiDf5EvYzQW7SyRgUj9+Sp0G7M+koLrDYlh6dI6Ew6dCwAU87rZW qVKNBRC0ty3HsG0X7PJ8B7I7zBTC9rAhmmZyE4nq5Bu5yoOx7WrQfV3LJYyrv7Kx9c2Z WuWW6uRaXkrGk8WwEhbhZ9DPQYBKd8Oqb1Rbm0xlm2DYqLOzCHVHlDrHE4u3kzxaXJlK YNOoCAnsJwiG9lEs2vFi9wITW8rK/6f6nIr7S/nsvt5KHnN2gcLJBIkKOM8bdPrSWfbF lYGMl0A4XZYESN2WPGkk89VUOCQzh9CukA8yfsJuw1dgEPxA6NHD+/nkUfkX7Tih2vql Pw5A== X-Gm-Message-State: AO0yUKUcObBC/gTd0s2t+3qnMtSDNFkunVmyeoMrO/V6ZXOR6hHkgPho 9hUQ1BEpbN+JkEcJt6XyVjaFqlNgUIGvaDYbz64= X-Received: by 2002:a17:903:283:b0:199:2e77:fe16 with SMTP id j3-20020a170903028300b001992e77fe16mr5572084plr.58.1676946006909; Mon, 20 Feb 2023 18:20:06 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id f3-20020a170902e98300b0019141c79b1dsm8559328plb.254.2023.02.20.18.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 18:20:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v2 08/14] target/arm: Add name argument to output_vector_union_type Date: Mon, 20 Feb 2023 16:19:45 -1000 Message-Id: <20230221021951.453601-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230221021951.453601-1-richard.henderson@linaro.org> References: <20230221021951.453601-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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=unavailable 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 This will make the function usable between SVE and SME. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/gdbstub64.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index d0e1305f6f..36166bf81e 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -210,7 +210,8 @@ int aarch64_gdb_set_sve_reg(CPUARMState *env, uint8_t *buf, int reg) return 0; } -static void output_vector_union_type(GString *s, int reg_width) +static void output_vector_union_type(GString *s, int reg_width, + const char *name) { struct TypeSize { const char *gdb_type; @@ -240,39 +241,38 @@ static void output_vector_union_type(GString *s, int reg_width) }; static const char suf[] = { 'q', 'd', 's', 'h', 'b' }; - - g_autoptr(GString) ts = g_string_new(""); int i, j, bits; /* First define types and totals in a whole VL */ for (i = 0; i < ARRAY_SIZE(vec_lanes); i++) { - int count = reg_width / vec_lanes[i].size; - g_string_printf(ts, "svev%c%c", vec_lanes[i].sz, vec_lanes[i].suffix); g_string_append_printf(s, - "", - ts->str, vec_lanes[i].gdb_type, count); + "", + name, vec_lanes[i].sz, vec_lanes[i].suffix, + vec_lanes[i].gdb_type, reg_width / vec_lanes[i].size); } + /* * Now define a union for each size group containing unsigned and * signed and potentially float versions of each size from 128 to * 8 bits. */ for (bits = 128, i = 0; bits >= 8; bits /= 2, i++) { - g_string_append_printf(s, "", suf[i]); + g_string_append_printf(s, "", name, suf[i]); for (j = 0; j < ARRAY_SIZE(vec_lanes); j++) { if (vec_lanes[j].size == bits) { - g_string_append_printf(s, "", - vec_lanes[j].suffix, + g_string_append_printf(s, "", + vec_lanes[j].suffix, name, vec_lanes[j].sz, vec_lanes[j].suffix); } } g_string_append(s, ""); } + /* And now the final union of unions */ - g_string_append(s, ""); + g_string_append_printf(s, "", name); for (bits = 128, i = 0; bits >= 8; bits /= 2, i++) { - g_string_append_printf(s, "", - suf[i], suf[i]); + g_string_append_printf(s, "", + suf[i], name, suf[i]); } g_string_append(s, ""); } @@ -292,7 +292,7 @@ int arm_gen_dynamic_svereg_xml(CPUState *cs, int orig_base_reg) g_string_append_printf(s, ""); /* Create the vector union type. */ - output_vector_union_type(s, reg_width); + output_vector_union_type(s, reg_width, "svev"); /* Create the predicate vector type. */ g_string_append_printf(s,