From nobody Tue Feb 10 23:55:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676946099; cv=none; d=zohomail.com; s=zohoarc; b=QwKrRTW/8wqgMWCHWh33wVD9dC7ghRq1SaFLnwDT1qBKCaHCc+grMymbLkM7xTNJk+oGAO4YbH74y99grplf8e+DuIEFxmAtFmQ9ALPMxdN+PZq91tpo6Hhmik/l2mLhIV4LoMXpCJobjKfIb92Nw35DhDNtrubSGrWxFbWbpq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676946099; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZxO2vFEBAewUG3Eemq5/VG4yc4LrHxRhdtS1HA4qP7I=; b=kZVBMCo7TD81xflSWUH2sQ803+kq1lzSkbO1sv2poCTfkbNgFMnzMsKzQyP5UTZqFuw7e5OfVLXSnGJnwhb1CPH0hBfFO0e+j7I7Ldm5Gmcq9bAsk3Q4NtWZwJXKeUthk7gzF0f+9UmiIT2j6PpMIs5vkvZ7w7kh+kG2ebXmk58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676946099486314.4600902851703; Mon, 20 Feb 2023 18:21:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUIGE-0001cR-T1; Mon, 20 Feb 2023 21:20:06 -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 1pUIGC-0001an-QK for qemu-devel@nongnu.org; Mon, 20 Feb 2023 21:20:04 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUIGA-00080i-56 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 21:20:04 -0500 Received: by mail-pj1-x1029.google.com with SMTP id b14-20020a17090a8c8e00b002349579949aso3206371pjo.5 for ; Mon, 20 Feb 2023 18:20:01 -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.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 18:20: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=ZxO2vFEBAewUG3Eemq5/VG4yc4LrHxRhdtS1HA4qP7I=; b=L2f7ennIpruboA+aTi7OGo8rD2/WhhE4hi9vMPyRB+ZutQOZYkvJX9g0d56Gmo6LEq JuF3EEmyrrOREwRuLExo+hFn91lS4nOqLAdCBlNkinXDIACmlbmxG97uy3cHCYIYYy2Z f2nk2ygJpo2un3Vha4VIeY/vs1LI5iVqOs7HzZ6qbAZ1i9RXLB1Qm53nxCxQqoHjWd14 jv4nTfecPy0jkw4iev7Ktg1tdhXkKg/Q6ikTwtQhQoe3Lpfe0aIwOqX7Ae7p3rsFtnT5 evch9Ze7hY0V1P9AqKFN90bQoHCLqV4xWW2NlnvEaq7gHGGbyG1VSXJrBMyQXSjlff3G 59Ew== 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=ZxO2vFEBAewUG3Eemq5/VG4yc4LrHxRhdtS1HA4qP7I=; b=cc9ihIr896a8Fk4JOV8IR7PJ8hbLsXhwm8uXi4HNEycqPjNgznmT+2gTMD3jJiU8eh u12+ZfBvcXXZMJmb21JKCl19CGw6rSnLO7gEPlWVOo2n1Mbx933A01pNkng0xzd2yE26 FoqK0raHOmbc3mUfd/6U4dxZ9Rg9yksnUt+Hvqq7RXh9ZU/JoEJ8hJjh7Bec1NxLFNe+ lOgrUd3kupqEPy2GtBsiTvstOdnjvnS8+VA/l0LP116k4dULIkkgN0pSmapAxsY5YcMD NSFRY8aAlciheCWWQnu6ESgNXLr0SRSPFxL+L8cSpOoYTD77KvuyTKX58G1OANDTUKwk Zzqw== X-Gm-Message-State: AO0yUKWJenIdg/tXK5y4uZQc8tRKRhmXgulNXdE2uyJdt8V5qasYlAMG 4TMDx2utF7GcbsVwFES94+mgOxdPLxpeS4BcVDM= X-Google-Smtp-Source: AK7set/4DM014IS33Tz4/5ColJCl6uKa30RD0ZZ62XEiAK9xLEUiWf23Th1SWgwTn/PK600c1V7+4Q== X-Received: by 2002:a17:902:f54a:b0:19a:a647:1891 with SMTP id h10-20020a170902f54a00b0019aa6471891mr6625157plf.67.1676946001373; Mon, 20 Feb 2023 18:20:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Fabiano Rosas , Peter Maydell Subject: [PATCH v2 04/14] target/arm: Split out output_vector_union_type Date: Mon, 20 Feb 2023 16:19:41 -1000 Message-Id: <20230221021951.453601-5-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676946100669100005 Content-Type: text/plain; charset="utf-8" Create a subroutine for creating the union of unions of the various type sizes that a vector may contain. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/gdbstub64.c | 83 +++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index 59fb5465d5..811833d8de 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -210,44 +210,39 @@ int aarch64_gdb_set_sve_reg(CPUARMState *env, uint8_t= *buf, int reg) return 0; } =20 -struct TypeSize { - const char *gdb_type; - short size; - char sz, suffix; -}; - -static const struct TypeSize vec_lanes[] =3D { - /* quads */ - { "uint128", 128, 'q', 'u' }, - { "int128", 128, 'q', 's' }, - /* 64 bit */ - { "ieee_double", 64, 'd', 'f' }, - { "uint64", 64, 'd', 'u' }, - { "int64", 64, 'd', 's' }, - /* 32 bit */ - { "ieee_single", 32, 's', 'f' }, - { "uint32", 32, 's', 'u' }, - { "int32", 32, 's', 's' }, - /* 16 bit */ - { "ieee_half", 16, 'h', 'f' }, - { "uint16", 16, 'h', 'u' }, - { "int16", 16, 'h', 's' }, - /* bytes */ - { "uint8", 8, 'b', 'u' }, - { "int8", 8, 'b', 's' }, -}; - -int arm_gen_dynamic_svereg_xml(CPUState *cs, int base_reg) +static void output_vector_union_type(GString *s, int reg_width) { - ARMCPU *cpu =3D ARM_CPU(cs); - GString *s =3D g_string_new(NULL); - DynamicGDBXMLInfo *info =3D &cpu->dyn_svereg_xml; + struct TypeSize { + const char *gdb_type; + short size; + char sz, suffix; + }; + + static const struct TypeSize vec_lanes[] =3D { + /* quads */ + { "uint128", 128, 'q', 'u' }, + { "int128", 128, 'q', 's' }, + /* 64 bit */ + { "ieee_double", 64, 'd', 'f' }, + { "uint64", 64, 'd', 'u' }, + { "int64", 64, 'd', 's' }, + /* 32 bit */ + { "ieee_single", 32, 's', 'f' }, + { "uint32", 32, 's', 'u' }, + { "int32", 32, 's', 's' }, + /* 16 bit */ + { "ieee_half", 16, 'h', 'f' }, + { "uint16", 16, 'h', 'u' }, + { "int16", 16, 'h', 's' }, + /* bytes */ + { "uint8", 8, 'b', 'u' }, + { "int8", 8, 'b', 's' }, + }; + + static const char suf[] =3D { 'q', 'd', 's', 'h', 'b' }; + g_autoptr(GString) ts =3D g_string_new(""); - int i, j, bits, reg_width =3D (cpu->sve_max_vq * 128); - info->num =3D 0; - g_string_printf(s, ""); - g_string_append_printf(s, "= "); - g_string_append_printf(s, ""); + int i, j, bits; =20 /* First define types and totals in a whole VL */ for (i =3D 0; i < ARRAY_SIZE(vec_lanes); i++) { @@ -263,7 +258,6 @@ int arm_gen_dynamic_svereg_xml(CPUState *cs, int base_r= eg) * 8 bits. */ for (bits =3D 128, i =3D 0; bits >=3D 8; bits /=3D 2, i++) { - const char suf[] =3D { 'q', 'd', 's', 'h', 'b' }; g_string_append_printf(s, "", suf[i]); for (j =3D 0; j < ARRAY_SIZE(vec_lanes); j++) { if (vec_lanes[j].size =3D=3D bits) { @@ -277,11 +271,24 @@ int arm_gen_dynamic_svereg_xml(CPUState *cs, int base= _reg) /* And now the final union of unions */ g_string_append(s, ""); for (bits =3D 128, i =3D 0; bits >=3D 8; bits /=3D 2, i++) { - const char suf[] =3D { 'q', 'd', 's', 'h', 'b' }; g_string_append_printf(s, "", suf[i], suf[i]); } g_string_append(s, ""); +} + +int arm_gen_dynamic_svereg_xml(CPUState *cs, int base_reg) +{ + ARMCPU *cpu =3D ARM_CPU(cs); + GString *s =3D g_string_new(NULL); + DynamicGDBXMLInfo *info =3D &cpu->dyn_svereg_xml; + int i, reg_width =3D (cpu->sve_max_vq * 128); + info->num =3D 0; + g_string_printf(s, ""); + g_string_append_printf(s, "= "); + g_string_append_printf(s, ""); + + output_vector_union_type(s, reg_width); =20 /* Finally the sve prefix type */ g_string_append_printf(s, --=20 2.34.1