From patchwork Mon Mar 6 15:34:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 659256 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp1910414wrb; Mon, 6 Mar 2023 08:36:41 -0800 (PST) X-Google-Smtp-Source: AK7set+c8cYA9XbCn1jpIf8Si2zQ0FHh67XMDiZSjgJ+ofAcCCsUBPEJAWo7UIH4Qq00pZJr7ZmC X-Received: by 2002:ac8:578c:0:b0:3b8:6ae9:b108 with SMTP id v12-20020ac8578c000000b003b86ae9b108mr19184036qta.27.1678120601732; Mon, 06 Mar 2023 08:36:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678120601; cv=none; d=google.com; s=arc-20160816; b=FSwQzovcIAMjIolVNcIdmfhSWqnEt4K+duxZ4zApB04GKl4tSoJQPxwypKaMroKKeH +3S2pPawounpETHZok5/LgXyMKtECACVJkiR4tJITvYeVgDUuCKOybqCzLfwsCCGeD8/ 22mMSdCLaKK1sQdlvzYfTLnOu7dyuT+vVibNBWpoJVtXTRt6i/YGxq7PzdkOT2SJ/KdQ kmHSv9Tc1KusegVuHwXvsD5hsOUEVbJNPWr1CBaORiVGhRkmieNXretg8x3MFpiUrhNV yowo8pRZ41KIBW5c+jdtt633b9hx/dQUT3lNhZgsain2odRjR7zX5GI+gQR9mQQK0d75 yZyw== 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:to:from :dkim-signature; bh=uh6QfKjLKU2APYmm6FnQ7PvwealPEo6i3D3sw7iDPnk=; b=Eiayg8/DBIfGSeWPm+fE+eB0YbE/Sd4SoAN3MDCZEhD7xaiUqwFYFJiFhk5UfgRvA6 9AFK2xfQoXh3CDFyCj2kX3hgtlAffaEc6I22qn77Xpb9WBFFLkLYnLwGFaH+uCg5ihnS lDZ5hu2hME2vqrzuCLW/9vKFsYQy0atzw3bhX6y4mXFsj1eAs6UkUx1eh9DYqWh1e0Ch VsIjk6NioN3SJyzdf1DXLjG0BSEG2b/kfOXdVlVgmOg+1LTrL5SVUeE8GRJd3rhJ5o0M ibc10BOL3DpjTUS6uDhMN6lij7PbCppCvX6q/EpNx0pUcXnePCH8r+wlXHiCDBGEyeeg m2Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mLhF93HL; 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 o18-20020a05622a045200b003b04cc18b5esi7698367qtx.681.2023.03.06.08.36.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Mar 2023 08:36:41 -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=mLhF93HL; 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 1pZCrS-000454-Og; Mon, 06 Mar 2023 10:34:50 -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 1pZCrP-00042Y-0o for qemu-devel@nongnu.org; Mon, 06 Mar 2023 10:34:47 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZCrN-00029T-8x for qemu-devel@nongnu.org; Mon, 06 Mar 2023 10:34:46 -0500 Received: by mail-wm1-x32c.google.com with SMTP id j19-20020a05600c1c1300b003e9b564fae9so8488476wms.2 for ; Mon, 06 Mar 2023 07:34:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678116883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=uh6QfKjLKU2APYmm6FnQ7PvwealPEo6i3D3sw7iDPnk=; b=mLhF93HLBI6t5MQPAWOvt7LOIM6ie9Z8gi4lPMuzAPh9ogihOdIZtJ8XiQO7rWo5A6 m8kVfcZASW411GPXOgnnl2eaU26wgPHJnWqrw5Q1fdVcso9jOq5pv0uCsm+WsibsSS/J EtyUDwAF2W7mecegzSZXDTC9/phfg2ra2Mi8aYwD/V/r0by0+uriC6QSV9CVOg2Gfdnf h4frv/gJISHgU3JGCNDuSJmRYsetAdIqtOwGwO7teAo3RfaUC1zOKRxsVxusXI13sWnP /2gjN4kk2TmHDZioIthKKCtW1/UBxSUwiz+4tkHrfgirDJ9iPKIjm7wyKq2sIniII0kb WHsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678116883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uh6QfKjLKU2APYmm6FnQ7PvwealPEo6i3D3sw7iDPnk=; b=D+qXzvmXwRd27DOv4hVVEx6TmzZhI7lhmGTPA9vHdG6vm3xTzBV6/n7huuI12gnb/P Tl1hJ/q9qWHegUM2AgPnr3gbjOXdlayz0XlNcZ6KVz0H9CThy4tNj12Ble/9Ijn8ornk kHfZD5eDfA4bIVI5BQ+kb2gQzfbBPKnAPeCc/Txr4otNyLV/bIARi0z35HWC3hnAK5Ng vyutx69Wei6mqRQiaMVSjfhiAyMGeTyVeKkl5sOO/+tgWCrAMRBtsD+x1ihskDOR07yV rGfZFfsHvuFfPAgiWBlZKxxrTcrRvaTQ29FUooc9EoDQReA/27KrW9rE3SrGtGbb2hTG /rbA== X-Gm-Message-State: AO0yUKW02BMHsU2bVU1/yDK7Jibsa18JCcgPc9G9NSuBPxf7HhK3/KlG SgZeJxO/UidDUwe31oU7Xpyp34uxk9g1goa8/kw= X-Received: by 2002:a05:600c:4e90:b0:3ea:bc08:42ad with SMTP id f16-20020a05600c4e9000b003eabc0842admr9425544wmq.2.1678116883754; Mon, 06 Mar 2023 07:34:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v7-20020a05600c444700b003eb0d6f48f3sm15287432wmn.27.2023.03.06.07.34.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 07:34:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/21] target/arm: Add name argument to output_vector_union_type Date: Mon, 6 Mar 2023 15:34:22 +0000 Message-Id: <20230306153435.490894-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230306153435.490894-1-peter.maydell@linaro.org> References: <20230306153435.490894-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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: Richard Henderson This will make the function usable between SVE and SME. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20230227213329.793795-9-richard.henderson@linaro.org Signed-off-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 d0e1305f6fc..36166bf81eb 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,