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