]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.arch/x86-avx512fp16.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / x86-avx512fp16.exp
1 # Copyright 2021-2024 Free Software Foundation, Inc.
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 # Test fp16 support in AVX512 registers.
17
18 require allow_avx512fp16_tests
19
20 standard_testfile
21
22 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
23 return -1
24 }
25
26 if { ![runto_main] } {
27 return -1
28 }
29
30 # Test xmm.
31 set line1 [gdb_get_line_number "first breakpoint here"]
32 gdb_breakpoint $line1
33 gdb_continue_to_breakpoint "line1" ".*$srcfile:$line1.*"
34
35 gdb_test "print \$xmm0.v8_half" \
36 "= \\{0.5, 0.625, 0.75, 0.875, 0, 0, 0, 0\\}"
37
38 gdb_test "print \$xmm6.v8_half" \
39 "= \\{3.5, 3.625, 3.75, 3.875, 0, 0, 0, 0\\}"
40
41 # Test ymm.
42 set line2 [gdb_get_line_number "second breakpoint here"]
43 gdb_breakpoint $line2
44 gdb_continue_to_breakpoint "line2" ".*$srcfile:$line2.*"
45
46 gdb_test "print \$ymm0.v16_half\[1\]" "= 10.25"
47 gdb_test "print \$ymm6.v16_half\[1\]" "= 22.25"
48
49 # Test zmm.
50 set line3 [gdb_get_line_number "third breakpoint here"]
51 gdb_breakpoint $line3
52 gdb_continue_to_breakpoint "line3" ".*$srcfile:$line3.*"
53
54 gdb_test "print \$zmm0.v32_half\[1\]" "= 28.5"
55 gdb_test "print \$zmm6.v32_half\[1\]" "= 76.5"
56
57 # Test setting of half values.
58 gdb_test_no_output "set var \$xmm0.v8_half\[0\] = 32.25"
59 gdb_test_no_output "set var \$ymm3.v16_half\[1\] = 33.5"
60 gdb_test_no_output "set var \$zmm7.v32_half\[2\] = 22.75"
61
62 gdb_test "p \$xmm0.v8_half\[0\]" "= 32.25"
63 gdb_test "p \$ymm3.v16_half\[1\]" "= 33.5"
64 gdb_test "p \$zmm7.v32_half\[2\]" "= 22.75"