From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 45E53385803B; Thu, 14 Dec 2023 16:22:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45E53385803B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702570927; bh=5fCdSqRkdO9IFGUNuDbbAGdsPRYtlAiPdXrDnx2MlN8=; h=From:To:Subject:Date:From; b=Cmaxp4kjgvxpZtpiB5cGOxByLW625HsrGmIhu1NZikMJn0GEe2NLjKXqxtmmdbIQP Al5iRoTJK/RGhsIL9uvMr64LbAquB8GC9PoSG+US+g3qIOztuEEy5+osExVGHI9Qur hrJeKBhQbp8+CeyvBEMFRRjtNEvn1vsYG3lG1MI4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: make aarch64_za_offsets_from_regnum return za_offsets X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 1aebac8a31a95ea9decfdea097e5ab52b3e89e2c X-Git-Newrev: 246179eaf681faeba6f49f3cd45b0857a6b42710 Message-Id: <20231214162207.45E53385803B@sourceware.org> Date: Thu, 14 Dec 2023 16:22:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D246179eaf681= faeba6f49f3cd45b0857a6b42710 commit 246179eaf681faeba6f49f3cd45b0857a6b42710 Author: Simon Marchi Date: Fri Dec 1 11:27:32 2023 -0500 gdb: make aarch64_za_offsets_from_regnum return za_offsets =20 This is not necessary, but it seems more natural to me to make aarch64_za_offsets_from_regnum return a za_offsets object, rather than fill an instance passed by parameter. =20 Change-Id: I40a185f055727da887ce7774be193eef1f4b9147 Approved-by: Luis Machado Reviewed-By: John Baldwin Diff: --- gdb/aarch64-tdep.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 5b2d87be6bf..5c3b824ed0a 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3114,12 +3114,11 @@ aarch64_pseudo_read_value_1 (frame_info_ptr next_fr= ame, } =20 /* Helper function for reading/writing ZA pseudo-registers. Given REGNUM, - a ZA pseudo-register number, return, in OFFSETS, the information on pos= itioning - of the bytes that must be read from/written to. */ + a ZA pseudo-register number, return the information on positioning of t= he + bytes that must be read from/written to. */ =20 -static void -aarch64_za_offsets_from_regnum (struct gdbarch *gdbarch, int regnum, - struct za_offsets &offsets) +static za_offsets +aarch64_za_offsets_from_regnum (struct gdbarch *gdbarch, int regnum) { aarch64_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbar= ch); =20 @@ -3135,6 +3134,7 @@ aarch64_za_offsets_from_regnum (struct gdbarch *gdbar= ch, int regnum, =20 /* Fetch the streaming vector length. */ size_t svl =3D sve_vl_from_vq (tdep->sme_svq); + za_offsets offsets; =20 if (is_sme_tile_slice_pseudo_register (gdbarch, regnum)) { @@ -3190,6 +3190,8 @@ aarch64_za_offsets_from_regnum (struct gdbarch *gdbar= ch, int regnum, /* The chunk size is always svl bytes. */ offsets.chunk_size =3D svl; } + + return offsets; } =20 /* Given REGNUM, a SME pseudo-register number, return its value in RESULT.= */ @@ -3207,8 +3209,8 @@ aarch64_sme_pseudo_register_read (gdbarch *gdbarch, f= rame_info_ptr next_frame, =20 /* Fetch the offsets that we need in order to read from the correct bloc= ks of ZA. */ - struct za_offsets offsets; - aarch64_za_offsets_from_regnum (gdbarch, pseudo_reg_num, offsets); + za_offsets offsets + =3D aarch64_za_offsets_from_regnum (gdbarch, pseudo_reg_num); =20 /* Fetch the contents of ZA. */ value *za_value =3D value_of_register (tdep->sme_za_regnum, next_frame); @@ -3330,8 +3332,7 @@ aarch64_sme_pseudo_register_write (struct gdbarch *gd= barch, =20 /* Fetch the offsets that we need in order to write to the correct blocks of ZA. */ - struct za_offsets offsets; - aarch64_za_offsets_from_regnum (gdbarch, regnum, offsets); + za_offsets offsets =3D aarch64_za_offsets_from_regnum (gdbarch, regnum); =20 /* Fetch the contents of ZA. */ size_t svl =3D sve_vl_from_vq (tdep->sme_svq);