]> Git Repo - binutils.git/blame - gdb/testsuite/gdb.arch/i386-sse.exp
* lib/gdb.exp (skip_altivec_tests, skip_vsx_tests)
[binutils.git] / gdb / testsuite / gdb.arch / i386-sse.exp
CommitLineData
0b302171 1# Copyright 2004-2005, 2007-2012 Free Software Foundation, Inc.
83ecb59f
JB
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
83ecb59f
JB
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
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
83ecb59f
JB
15
16# Please email any bugs, comments, and/or additions to this file to:
17# [email protected]
18
19# This file is part of the gdb testsuite.
20
83ecb59f 21
701e355d
DE
22if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
23 verbose "Skipping x86 SSE tests."
83ecb59f
JB
24 return
25}
26
27set testfile "i386-sse"
28set srcfile ${testfile}.c
29set binfile ${objdir}/${subdir}/${testfile}
b1a9c082 30
4c93b1db 31if [get_compiler_info] {
b1a9c082
MK
32 return -1
33}
34
35set additional_flags ""
36if [test_compiler_info gcc*] {
37 set additional_flags "additional_flags=-msse"
38}
39
40if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
4ac6f39d
MC
41 unsupported "compiler does not support SSE"
42 return
83ecb59f
JB
43}
44
45gdb_exit
46gdb_start
47gdb_reinitialize_dir $srcdir/$subdir
48gdb_load ${binfile}
49
50if ![runto_main] then {
51 gdb_suppress_tests
52}
53
54send_gdb "print have_sse ()\r"
55gdb_expect {
56 -re ".. = 1\r\n$gdb_prompt " {
57 pass "check whether processor supports SSE"
58 }
59 -re ".. = 0\r\n$gdb_prompt " {
60 verbose "processor does not support SSE; skipping SSE tests"
61 return
62 }
63 -re ".*$gdb_prompt $" {
64 fail "check whether processor supports SSE"
65 }
66 timeout {
67 fail "check whether processor supports SSE (timeout)"
68 }
69}
70
71gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
72 "Breakpoint .* at .*i386-sse.c.*" \
2faca73a 73 "set first breakpoint in main"
83ecb59f
JB
74gdb_continue_to_breakpoint "continue to first breakpoint in main"
75
add265ae 76if [is_ilp32_target] {
701e355d
DE
77 set nr_regs 8
78} else {
79 set nr_regs 16
80}
81
82for { set r 0 } { $r < $nr_regs } { incr r } {
83ecb59f 83 gdb_test "print \$xmm$r.v4_float" \
8d5df71a 84 ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
e784b426
JK
85 "check float contents of %xmm$r"
86 gdb_test "print \$xmm$r.v16_int8" \
ea37ba09 87 ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \
e784b426 88 "check int8 contents of %xmm$r"
83ecb59f
JB
89}
90
701e355d 91for { set r 0 } { $r < $nr_regs } { incr r } {
83ecb59f
JB
92 gdb_test "set var \$xmm$r.v4_float\[0\] = $r + 10" "" "set %xmm$r"
93}
94
95gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
96 "Breakpoint .* at .*i386-sse.c.*" \
2faca73a 97 "set second breakpoint in main"
83ecb59f
JB
98gdb_continue_to_breakpoint "continue to second breakpoint in main"
99
701e355d 100for { set r 0 } { $r < $nr_regs } { incr r } {
83ecb59f 101 gdb_test "print data\[$r\]" \
8d5df71a 102 ".. = \\{f = \\{[expr $r + 10], $r.25, $r.5, $r.75\\}\\}.*" \
83ecb59f
JB
103 "check contents of data\[$r\]"
104}
This page took 1.790164 seconds and 4 git commands to generate.