]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright (C) 2023-2024 Free Software Foundation, Inc. |
16582a51 LM |
2 | |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | # | |
16 | # Sanity check for AArch64 Scalable Vector/Matrix Extensions functionality. | |
17 | ||
18 | load_lib aarch64-scalable.exp | |
19 | ||
20 | # | |
21 | # Run a series of basic checks for SVE/SME states. | |
22 | # | |
23 | proc sanity_check { vl svl } { | |
24 | # Run the program until the point where we start initializing the different | |
25 | # register states. | |
26 | set state_breakpoint "stop here" | |
27 | gdb_breakpoint [gdb_get_line_number $state_breakpoint] | |
28 | ||
29 | for {set id 0} {$id < 5} {incr id} { | |
30 | set state [state_id_to_state_string $id] | |
31 | ||
32 | with_test_prefix "state=${state} vl=${vl} svl=${svl}" { | |
33 | gdb_continue_to_breakpoint $state_breakpoint | |
34 | check_state $state $vl $svl | |
35 | } | |
36 | } | |
37 | } | |
38 | ||
39 | require is_aarch64_target | |
40 | require allow_aarch64_sve_tests | |
41 | require allow_aarch64_sme_tests | |
42 | ||
5fec7411 PA |
43 | # Remote targets can't communicate vector length (vl or svl) changes |
44 | # to GDB via the RSP. | |
45 | require !gdb_protocol_is_remote | |
46 | ||
16582a51 LM |
47 | set compile_flags {"debug" "macros" "additional_flags=-march=armv8.5-a+sve"} |
48 | standard_testfile | |
49 | if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${compile_flags}]} { | |
50 | return -1 | |
51 | } | |
52 | ||
53 | if {![runto_main]} { | |
54 | return -1 | |
55 | } | |
56 | ||
16582a51 LM |
57 | # Adjust the repeat count for the test. |
58 | gdb_test_no_output "set print repeats 1" "adjust repeat count" | |
59 | ||
60 | # Fetch both the vector length and the streaming vector length the target | |
61 | # system is using. We do not force any vector lengths and do not change | |
62 | # it mid-execution. | |
63 | set vl [expr [get_valueof "" "\$vg" "0" "fetch value of vl"] * 8] | |
64 | set svl [expr [get_valueof "" "\$svg" "0" "fetch value of svl"] * 8] | |
65 | ||
66 | # Now we are at the point where we can start checking state and moving the | |
67 | # testcase forward. | |
68 | sanity_check $vl $svl |