From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id D265E3858D20 for ; Sat, 12 Aug 2023 00:42:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D265E3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1c4b4c40281so423632fac.1 for ; Fri, 11 Aug 2023 17:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691800975; x=1692405775; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=66tda0bHCR8kBVGjx0M5lLaz6LeOgXUCCxVS38vExPk=; b=OgyoLutB4RIhCx/uHwaQfQuvStHP+THJW1hDRfLnHnoWqE1TSO5E0wO41kAyzZzozM UwK0ytC9+mRamlwfbqae1PpcO3f4c8X8xd0WI1ylj/HH/RkwF8s4HR8PqxzY/FPaXqjQ 4mZOfn0C3Fo6RwX6r3kSOS6OHA4p2AG66W73uE2408cNIizWmYsV9nZz3ImrIgohwZdg 22B6ms3VQ3XkjkQ5RFN6ruYeS9GJ42rsv65hUVsKbIFqch8r9eDI1ubO/FulSrsmSVKu L3F8OnZZuooTh0qUPeuga67yLv16fBh3RN39rZputgAKxTGjRcVfjLnSm4p11tlpfdQv ZHHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691800975; x=1692405775; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=66tda0bHCR8kBVGjx0M5lLaz6LeOgXUCCxVS38vExPk=; b=YkQOBknfuR5HCH8IgpeA7mLtomVG4JSIRLSDIaAV8e7iYiMPfx+eiIGjccEF1CAnbF tsqL0dZMegnFW3DZZAZpGboSEwZqW9+uN8Nqn0DabDbd5xMYH6XqqV7rzbXXxvOymxy9 Dbf5aLOB5os/gLpxZvEQgJOZVauR+EFoLE8idBbaW3iwF7SDCi2F7M4eInMl6jvP+na8 Vhat/qyP/BYnl365y7U7sEqmOHHk49Mp0MA5VpwYYLGXigHBo4eUHDyie9Y9e0uPhtyF iF7VJhYHkWartUPb6BPozsGHH/vrDLwMi3AKBp3Itulec/oA+b542l1obdKG9FBmVmPv lRDw== X-Gm-Message-State: AOJu0YxW9cR5RYAa6s79AuyiZHXTIx1rrB0bWKGJwscqx/b+fR0yj0S6 x229Sf4agHTPV4vKVW1uW+iS1A== X-Google-Smtp-Source: AGHT+IFhxIbN/pnnV02MSaxOPPV6c2abCmz5xv3jJlYqG8uTefF40/0E+ctcOACwk8+YcaOb/fTzEw== X-Received: by 2002:a05:6870:46ac:b0:1a6:8911:61a9 with SMTP id a44-20020a05687046ac00b001a6891161a9mr4154916oap.29.1691800974805; Fri, 11 Aug 2023 17:42:54 -0700 (PDT) Received: from localhost ([177.124.15.23]) by smtp.gmail.com with ESMTPSA id eg2-20020a056870988200b001bf3942ea12sm2578636oab.1.2023.08.11.17.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Aug 2023 17:42:54 -0700 (PDT) References: <20230630134616.1238105-1-luis.machado@arm.com> <20230630134616.1238105-16-luis.machado@arm.com> <87r0ojzkp4.fsf@linaro.org> <26331934-4e54-5ed6-1c35-ed1c66262ba2@arm.com> User-agent: mu4e 1.10.5; emacs 28.2 From: Thiago Jung Bauermann To: Luis Machado Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 15/16] [gdb/testsuite] sme: Add SVE/SME testcases In-reply-to: <26331934-4e54-5ed6-1c35-ed1c66262ba2@arm.com> Date: Fri, 11 Aug 2023 21:42:51 -0300 Message-ID: <87o7jdw0ok.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, Luis Machado writes: > Hi, > > On 8/4/23 01:59, Thiago Jung Bauermann wrote: >> >> Luis Machado via Gdb-patches writes: >> >>> diff --git a/gdb/testsuite/gdb.arch/aarch64-sme-core-0.exp >>> b/gdb/testsuite/gdb.arch/aarch64-sme-core-0.exp >>> new file mode 100644 >>> index 00000000000..c4755346bc8 >>> --- /dev/null >>> +++ b/gdb/testsuite/gdb.arch/aarch64-sme-core-0.exp >>> @@ -0,0 +1,18 @@ >>> +# Copyright 2023 Free Software Foundation, Inc. >>> + >>> +# This program is free software; you can redistribute it and/or modify >>> +# it under the terms of the GNU General Public License as published by >>> +# the Free Software Foundation; either version 3 of the License, or >>> +# (at your option) any later version. >>> +# >>> +# This program is distributed in the hope that it will be useful, >>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >>> +# GNU General Public License for more details. >>> +# >>> +# You should have received a copy of the GNU General Public License >>> +# along with this program. If not, see . */ >>> + >>> +set id_start 0 >>> +set id_end 24 >> >> It would be useful to have a comment mentioning that the range above >> tests the fpsimd state. >> >> Same comment for the other aarch64-sme-*.exp tests. >> > > Yeah. That can be a bit obscure. I'll add some more documentation to that effect. > > The current arrangement is mostly aiming at splitting these tests in a way that minimizes > the total run time. That is a nice idea. > I'm considering further splitting these, putting each test with SVL == 256 into its own > file. Those are the ones that take the longest to run. The others can be grouped. > > Right now the split is based on continuous ranges (0~4, 5~9 etc). I may change that to a > list > instead. That will allow us to clearly specify the tests we want for each sub-file, > hopefully > causing each sub-test to have more or less the same run time. Sounds good. Thanks for the explanation. >>> +source $srcdir/$subdir/aarch64-sme-core.exp.tcl >> >> >> >>> +# >>> +# Return the state string based on STATE >>> +# >>> +proc state_id_to_state_string { state } { >>> + if {$state == 0} { >>> + return "fpsimd" >>> + } elseif {$state == 1} { >>> + return "sve" >>> + } elseif {$state == 2} { >>> + return "ssve" >>> + } elseif {$state == 3} { >>> + return "za" >>> + } elseif {$state == 4} { >>> + return "za_ssve" >>> + } >>> +} >>> + >>> +# >>> +# Given a test ID, return the string representing the register state. >>> +# The state is one of fpsimd, sve, ssve, za and za_ssve. >>> +# >>> +proc test_id_to_state { id } { >>> + set state [expr $id / 25] >>> + >>> + return [state_id_to_state_string $state] >>> +} >>> + >>> +# >>> +# Given a test ID, return the associated vector length. >>> +# >>> +proc test_id_to_vl { id } { >>> + return [expr 16 << (($id / 5) % 5)] >>> +} >>> + >>> +# >>> +# Given a test ID, return the associated streaming vector length. >>> +# >>> +proc test_id_to_svl { id } { >>> + return [expr 16 << ($id % 5)] >>> +} >> >> I suggest adding an sme_ prefix to the procedures above, since "id" here >> is specific to SME testcases. >> > > See below. > >>> +# >>> +# With register STATE, vector length VL and streaming vector length SVL, >>> +# run some register state checks to make sure the values are the expected >>> +# ones >>> +# >>> +proc check_state { state vl svl } { >>> + # The FPSIMD registers are initialized with a value of 0x55 (85) >>> + # for each byte. >>> + # >>> + # The SVE registers are initialized with a value of 0xff (255) for each >>> + # byte, including the predicate registers and FFR. >>> + # >>> + # The SME (ZA) register is initialized with a value of 0xaa (170) for >>> + # each byte. >>> + >>> + # Check VG to make sure it is correct >>> + set expected_vg [expr $vl / 8] >>> + # If streaming mode is enabled, then vg is actually svg. >>> + if {$state == "ssve" || $state == "za_ssve"} { >>> + set expected_vg [expr $svl / 8] >>> + } >>> + gdb_test "print \$vg" " = ${expected_vg}" >>> + >>> + # Check SVG to make sure it is correct >>> + set expected_svg [expr $svl / 8] >>> + gdb_test "print \$svg" " = ${expected_svg}" >>> + >>> + # Check the value of SVCR. >>> + gdb_test "print \$svcr" [get_svcr_value $state] >>> + >>> + # When we have any SVE or SSVE state, the FPSIMD registers will have >>> + # the same values as the SVE/SSVE Z registers. >>> + set fpsimd_byte 85 >>> + if {$state == "sve" || $state == "ssve" || $state == "za_ssve"} { >>> + set fpsimd_byte 255 >>> + } >>> + >>> + set sve_byte 255 >>> + if {$state == "fpsimd" || $state == "za"} { >>> + set sve_byte 85 >>> + } >>> + >>> + # Check FPSIMD registers >>> + check_fpsimd_regs $fpsimd_byte $state $vl $svl >>> + # Check SVE registers >>> + check_sve_regs $sve_byte $state $vl $svl >>> + # Check SME registers >>> + check_sme_regs 170 $state $svl >>> +} >> >> Also here, perhaps call this function "check_sme_state"? >> > > Maybe. Instead of renaming these functions, how about renaming the helper .exp file > from aarch64.exp to aarch64-sme.exp? Or maybe split it into a sme-specific part and > a generic part. The 1d_array and 2d_array functions are even generic enough to go in gdb.exp. > Moving forward, I'd like to make these tests cover SVE as well. In that case, we would be > able to reuse some of these functions to raise the coverage of tests. > > What do you think? I like the idea. Perhaps rename to aarch64-scalable.exp so that it covers both SVE and SME? Also some functions that are currently in gdb.exp could go there, such as allow_aarch64_sve_tests, aarch64_initialize_sve_information, aarch64_supports_sve_vl and their SME counterparts. -- Thiago