From patchwork Tue Feb 14 16:30:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 653475 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp3147195wrr; Tue, 14 Feb 2023 08:33:20 -0800 (PST) X-Google-Smtp-Source: AK7set+Urht7l5ZU7PcdT95fGnnOSHOUH7v6m/g3MRpo/SyJZQZrPjQTHnnTczSin7dywFYGvHAX X-Received: by 2002:ac8:578b:0:b0:3b9:ba24:4f38 with SMTP id v11-20020ac8578b000000b003b9ba244f38mr5152380qta.56.1676392399926; Tue, 14 Feb 2023 08:33:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676392399; cv=none; d=google.com; s=arc-20160816; b=F/Jm/eOvhWEEVqzkUq61kzZ44Ta+rrmeF42m70q618kgqfOkCX95wIpiTYaUi59436 YE/69ekBi+Dgf/muTOcyUmDPZs4iQMyybJwoe0uooTenl+iON4kp5IEnh3bkNWhKBea7 6Wq1njGnPPhWxadcLYsnkWwzCeSVMiSJaWjT5TCQxteFU4lXhoqQQQy/P2HQYP6PtVTb mMM1zFu6qm4Hd4FTlimYXCEwwUSo1HQvldiT04tIxEJHTkQTfsfqjS9NmAkr90tqC4e4 bnvEC8yVDaXSSU5zgCkVHeoAs7xTiHGTu6vmn0Jk0Gh7FBxGClnCS3LIJO0WIsYY9nVt ePdA== 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=5U6nLfif2wOhX5Oed2Osbgbcfi6KWrVp6W4p+qPIqc0=; b=fnkM9iE4lf0Ng+tNoHjEffyUMEK6kZnOucldqexedC/Qrl0KND2zYL9E8OxyW12MiL 910AWLEvr7budUxHilefr2Go2y3IgHSQ4DAN76gwfhqs0WVC+JDC7WPmx12Hcu1o9zSx szbSb/kuMQa5oUCg3IWlNY7HaShkBdCou7q1+8Ye0hrBXI0whluSpRhn612VwLxjyHbm eGbeax/Qjjy/0Iwuz6UlQfjxwjhAWduAZYTd8N8QY7fxlI9OZvotk+dpJFUGh+N+dlcM 5tDSAuFTVns7SXZsy4wXiUctGf7Frx1GNqZ2E3/soPMxzWAbH06J5bafxLJX1e7vxLqZ lO+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s7Sbpvi1; 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 t2-20020a05622a148200b003ba24c325a9si12808025qtx.256.2023.02.14.08.33.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Feb 2023 08:33:19 -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=s7Sbpvi1; 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 1pRyDA-0006vJ-Ex; Tue, 14 Feb 2023 11:31:20 -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 1pRyCw-0006U4-Kf for qemu-devel@nongnu.org; Tue, 14 Feb 2023 11:31:08 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRyCu-00029e-UF for qemu-devel@nongnu.org; Tue, 14 Feb 2023 11:31:06 -0500 Received: by mail-pl1-x632.google.com with SMTP id m2so17587859plg.4 for ; Tue, 14 Feb 2023 08:31:04 -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=5U6nLfif2wOhX5Oed2Osbgbcfi6KWrVp6W4p+qPIqc0=; b=s7Sbpvi1x4KFz8X1u42VgCuTs0I5lffWQgHWaT4+sLah1SSQOz8gy4IaTPyiFPkKqB ES5TfK2Te+d3wHfXGHPYPw9XaA2Zd9TY2r/4EJPdx8SHhA6hcPLuP3BGX0MuBg7YqMfx oSD/b/zT0R8pqdNXrVLrdzOpO7gCsVVEaXDb/uAS9qJFSeUok44l4xemhDBkZI1z/VGG 9esjCx+yjORiES/rNGRrE/hEC95JFPpQl5efYL1BZe3mNsnSZmaDqibTCiJv6yahuk1Y ofjBwK1/BN4fqQzoR+rAiMfnUlR/lmE0wXZbBi6oeVwrj1rNfQnd0NFzSqjRSICMB0iJ LgRw== 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=5U6nLfif2wOhX5Oed2Osbgbcfi6KWrVp6W4p+qPIqc0=; b=z8NvjZ0/jCzEM5fHK2v1lcfx3R6tQyQrdzeOSma73K1VB7XxnTxkMnhck/vRUx6jmA 1tCQ0MVLR3KBiG7WQY8H2rLgv0/xo52hCVQWlddk/JzlWL8gYU73/c6bx4roIzTThL/s 76Nd0gauCw5H2Y1ZxQprPztRgq7BHTgfRruN5FUZp3SoxLuiKsZywDfiQ9shmSUhHJOR 5wiKTm/HmDb1Pp5dlPltMGuzx+kuitijCBKUyDFrWlkEnkSGTHeU37J9BSay8YdqTV4I qZ0MoleMy6Y8I/vkyLO/lDS8izEzrxH1d5hG8wYA50rGbkPd0wfQr2B6qaanbZAfrerh rQ2A== X-Gm-Message-State: AO0yUKVhv5mmdZhyUc3JeFUaaZ+osjNFusLnuTGYQ+eK6o6Swz5cW2XT I115eiO4U7Uhf8w3uwWd/G5TwPrKfUNToOOSfJE= X-Received: by 2002:a05:6a21:3397:b0:bc:b98c:a8b3 with SMTP id yy23-20020a056a21339700b000bcb98ca8b3mr3401198pzb.32.1676392263607; Tue, 14 Feb 2023 08:31:03 -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.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 08:31:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 08/14] target/arm: Add name argument to output_vector_union_type Date: Tue, 14 Feb 2023 06:30:42 -1000 Message-Id: <20230214163048.903964-9-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::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 This will make the function usable between SVE and SME. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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 ec61211949..166cb288cd 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,