]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2014-2024 Free Software Foundation, Inc. |
65b48a81 PB |
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 | # This file is part of the gdb testsuite. | |
17 | ||
18 | # Test PowerPC instructions disassembly. | |
19 | ||
20 | standard_testfile .s | |
21 | set objfile [standard_output_file ${testfile}.o] | |
22 | ||
73c06197 | 23 | require {istarget "powerpc*-*-*"} |
65b48a81 PB |
24 | |
25 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { | |
26 | untested "PowerPC instructions disassembly" | |
27 | return -1 | |
28 | } | |
29 | ||
30 | clean_restart ${objfile} | |
31 | ||
32 | # Disassemble the function. | |
33 | set func "" | |
34 | ||
35 | gdb_test "set disassembler-options vsx" | |
36 | set test "disass func" | |
37 | gdb_test_multiple $test $test { | |
38 | -re "\r\nDump of assembler code for function func:(\r\n.*\r\n)End of assembler dump.\r\n$gdb_prompt $" { | |
39 | set func $expect_out(1,string) | |
40 | pass $test | |
41 | } | |
42 | } | |
43 | ||
44 | proc instr_to_patt {instr} { | |
45 | global decimal hex | |
46 | # 0x0000000000000018 <+24>: stxvd2x vs43,r4,r5 | |
47 | return "\[ \t\]*$hex <\\+$decimal>:\[ \t\]*[string_to_regexp $instr]" | |
48 | } | |
49 | ||
50 | proc func_check {instr} { | |
51 | global func | |
52 | ||
53 | set test "found: $instr" | |
54 | if [regexp -nocase -line [instr_to_patt $instr] $func] { | |
55 | pass $test | |
56 | } else { | |
57 | fail $test | |
58 | } | |
59 | } | |
60 | ||
61 | func_check "lxsiwzx vs62,r14,r26" | |
62 | func_check "lxsiwzx vs40,0,r25" | |
63 | func_check "lxsiwax vs25,0,r26" | |
64 | func_check "lxsiwax vs3,0,r3" | |
c65c6c42 AM |
65 | func_check "mffprd r12,f30" |
66 | func_check "mfvrd r12,v30" | |
65b48a81 | 67 | func_check "mffprwz r20,f12" |
65b48a81 PB |
68 | func_check "mfvrwz r21,v12" |
69 | func_check "stxsiwx vs14,r9,r14" | |
70 | func_check "stxsiwx vs21,0,r8" | |
c65c6c42 AM |
71 | func_check "mtfprd f11,r28" |
72 | func_check "mtvrd v11,r29" | |
65b48a81 PB |
73 | func_check "mtfprwa f24,r22" |
74 | func_check "mtvrwa v25,r23" | |
65b48a81 PB |
75 | func_check "mtfprwz f26,r27" |
76 | func_check "mtvrwz v27,r28" | |
65b48a81 PB |
77 | func_check "lxsspx vs13,r19,r13" |
78 | func_check "lxsspx vs18,0,r13" | |
79 | func_check "stxsspx vs43,r2,r4" | |
80 | func_check "stxsspx vs55,0,r11" | |
81 | func_check "xsaddsp vs54,vs48,vs25" | |
82 | func_check "xsmaddasp vs14,vs50,vs1" | |
83 | func_check "xssubsp vs26,vs22,vs42" | |
84 | func_check "xsmaddmsp vs27,vs53,vs52" | |
85 | func_check "xsrsqrtesp vs8,vs59" | |
86 | func_check "xssqrtsp vs12,vs41" | |
87 | func_check "xsmulsp vs57,vs11,vs32" | |
88 | func_check "xsmsubasp vs38,vs20,vs26" | |
89 | func_check "xsdivsp vs26,vs19,vs6" | |
90 | func_check "xsmsubmsp vs35,vs37,vs55" | |
91 | func_check "xsresp vs59,vs8" | |
92 | func_check "xsnmaddasp vs44,vs33,vs33" | |
93 | func_check "xsnmaddmsp vs17,vs62,vs30" | |
94 | func_check "xsnmsubasp vs54,vs52,vs31" | |
95 | func_check "xsnmsubmsp vs37,vs5,vs58" | |
96 | func_check "xxlorc vs30,vs54,vs44" | |
97 | func_check "xxlnand vs49,vs14,vs29" | |
98 | func_check "xxleqv vs62,vs22,vs30" | |
99 | func_check "xscvdpspn vs60,vs54" | |
100 | func_check "xsrsp vs22,vs45" | |
101 | func_check "xscvuxdsp vs26,vs59" | |
102 | func_check "xscvsxdsp vs38,vs49" | |
103 | func_check "xscvspdpn vs59,vs26" | |
104 | func_check "fmrgow f24,f14,f2" | |
105 | func_check "fmrgew f22,f7,f5" |