Commit | Line | Data |
---|---|---|
42a4f53d | 1 | # Copyright 2014-2019 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 | ||
23 | if {![istarget "powerpc*-*-*"]} then { | |
24 | verbose "Skipping PowerPC instructions disassembly." | |
25 | return | |
26 | } | |
27 | ||
28 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { | |
29 | untested "PowerPC instructions disassembly" | |
30 | return -1 | |
31 | } | |
32 | ||
33 | clean_restart ${objfile} | |
34 | ||
35 | # Disassemble the function. | |
36 | set func "" | |
37 | ||
38 | gdb_test "set disassembler-options altivec" | |
39 | set test "disass func" | |
40 | gdb_test_multiple $test $test { | |
41 | -re "\r\nDump of assembler code for function func:(\r\n.*\r\n)End of assembler dump.\r\n$gdb_prompt $" { | |
42 | set func $expect_out(1,string) | |
43 | pass $test | |
44 | } | |
45 | } | |
46 | ||
47 | proc instr_to_patt {instr} { | |
48 | global decimal hex | |
49 | # 0x0000000000000018 <+24>: stxvd2x vs43,r4,r5 | |
50 | return "\[ \t\]*$hex <\\+$decimal>:\[ \t\]*[string_to_regexp $instr]" | |
51 | } | |
52 | ||
53 | proc func_check {instr} { | |
54 | global func | |
55 | ||
56 | set test "found: '$instr'" | |
57 | set peb [instr_to_patt $instr] | |
58 | if [regexp -nocase -line [instr_to_patt $instr] $func] { | |
59 | pass $test | |
60 | } else { | |
61 | fail $peb | |
62 | } | |
63 | } | |
64 | ||
65 | func_check "dss 3" | |
66 | func_check "dssall" | |
67 | func_check "dst r5,r4,1" | |
68 | func_check "dstt r8,r7,0" | |
69 | func_check "dstst r5,r6,3" | |
70 | func_check "dststt r4,r5,2" | |
71 | func_check "lvebx v30,r22,r24" | |
72 | func_check "lvebx v21,0,r24" | |
73 | func_check "lvehx v10,r16,r2" | |
74 | func_check "lvehx v20,0,r23" | |
75 | func_check "lvewx v17,r4,r18" | |
76 | func_check "lvewx v23,0,r8" | |
77 | func_check "lvsl v6,0,r25" | |
78 | func_check "lvsl v2,0,r6" | |
79 | func_check "lvsr v22,r16,r12" | |
80 | func_check "lvsr v0,0,r29" | |
81 | func_check "lvxl v15,r5,r13" | |
82 | func_check "lvxl v19,0,r23" | |
83 | func_check "lvx v22,r1,r2" | |
84 | func_check "lvx v18,0,r17" | |
85 | func_check "mfvrsave r31" | |
86 | func_check "mfvscr v24" | |
87 | func_check "mtvrsave r10" | |
88 | func_check "mtvscr v25" | |
89 | func_check "stvebx v18,r27,r10" | |
90 | func_check "stvebx v16,0,r6" | |
91 | func_check "stvehx v17,r13,r16" | |
92 | func_check "stvehx v23,0,r20" | |
93 | func_check "stvewx v11,r19,r31" | |
94 | func_check "stvewx v31,0,r1" | |
95 | func_check "stvxl v26,r21,r17" | |
96 | func_check "stvxl v13,0,r22" | |
97 | func_check "stvx v11,r31,r31" | |
98 | func_check "stvx v30,0,r16" | |
99 | func_check "vaddcuw v24,v7,v28" | |
100 | func_check "vaddfp v3,v30,v11" | |
101 | func_check "vaddsbs v8,v28,v9" | |
102 | func_check "vaddshs v7,v5,v4" | |
103 | func_check "vaddsws v22,v26,v27" | |
104 | func_check "vaddubm v16,v14,v28" | |
105 | func_check "vaddubs v6,v1,v25" | |
106 | func_check "vadduhm v2,v4,v6" | |
107 | func_check "vadduhs v26,v21,v8" | |
108 | func_check "vadduwm v29,v31,v1" | |
109 | func_check "vadduws v23,v13,v4" | |
110 | func_check "vandc v30,v16,v9" | |
111 | func_check "vand v3,v13,v27" | |
112 | func_check "vavgsb v4,v6,v17" | |
113 | func_check "vavgsh v23,v28,v19" | |
114 | func_check "vavgsw v8,v15,v31" | |
115 | func_check "vavgub v6,v7,v25" | |
116 | func_check "vavguh v25,v22,v10" | |
117 | func_check "vavguw v3,v23,v29" | |
118 | func_check "vctsxs v14,v2,6" | |
119 | func_check "vctuxs v9,v31,20" | |
120 | func_check "vcfsx v24,v30,3" | |
121 | func_check "vcfux v17,v21,29" | |
122 | func_check "vcmpbfp v18,v28,v0" | |
123 | func_check "vcmpbfp. v19,v26,v3" | |
124 | func_check "vcmpeqfp v16,v2,v11" | |
125 | func_check "vcmpeqfp. v23,v13,v13" | |
126 | func_check "vcmpequb v25,v19,v10" | |
127 | func_check "vcmpequb. v18,v11,v2" | |
128 | func_check "vcmpequh v9,v25,v7" | |
129 | func_check "vcmpequh. v14,v24,v21" | |
130 | func_check "vcmpequw v24,v12,v5" | |
131 | func_check "vcmpequw. v19,v16,v1" | |
132 | func_check "vcmpgefp v23,v17,v16" | |
133 | func_check "vcmpgefp. v19,v29,v17" | |
134 | func_check "vcmpgtfp v16,v28,v13" | |
135 | func_check "vcmpgtfp. v14,v24,v7" | |
136 | func_check "vcmpgtsb v16,v22,v6" | |
137 | func_check "vcmpgtsb. v2,v12,v14" | |
138 | func_check "vcmpgtsh v28,v3,v29" | |
139 | func_check "vcmpgtsh. v16,v19,v13" | |
140 | func_check "vcmpgtsw v15,v0,v5" | |
141 | func_check "vcmpgtsw. v21,v13,v0" | |
142 | func_check "vcmpgtub v5,v10,v30" | |
143 | func_check "vcmpgtub. v7,v13,v10" | |
144 | func_check "vcmpgtuh v24,v15,v16" | |
145 | func_check "vcmpgtuh. v25,v21,v27" | |
146 | func_check "vcmpgtuw v17,v27,v6" | |
147 | func_check "vcmpgtuw. v8,v21,v27" | |
148 | func_check "vcfsx v1,v1,14" | |
149 | func_check "vctsxs v4,v15,25" | |
150 | func_check "vctuxs v28,v23,14" | |
151 | func_check "vcfux v6,v6,0" | |
152 | func_check "vexptefp v0,v8" | |
153 | func_check "vlogefp v22,v27" | |
154 | func_check "vmaddfp v23,v18,v5,v18" | |
155 | func_check "vmaxfp v13,v13,v27" | |
156 | func_check "vmaxsb v8,v23,v14" | |
157 | func_check "vmaxsh v19,v17,v0" | |
158 | func_check "vmaxsw v19,v3,v22" | |
159 | func_check "vmaxub v23,v30,v28" | |
160 | func_check "vmaxuh v9,v20,v23" | |
161 | func_check "vmaxuw v21,v19,v1" | |
162 | func_check "vmhaddshs v22,v13,v5,v22" | |
163 | func_check "vmhraddshs v31,v0,v3,v18" | |
164 | func_check "vminfp v2,v21,v24" | |
165 | func_check "vminsb v20,v6,v10" | |
166 | func_check "vminsh v18,v27,v26" | |
167 | func_check "vminsw v3,v4,v1" | |
168 | func_check "vminub v7,v0,v13" | |
169 | func_check "vminuh v0,v12,v6" | |
170 | func_check "vminuw v6,v3,v1" | |
171 | func_check "vmladduhm v3,v29,v3,v26" | |
172 | func_check "vmrghb v21,v5,v31" | |
173 | func_check "vmrghh v21,v24,v0" | |
174 | func_check "vmrghw v16,v0,v22" | |
175 | func_check "vmrglb v1,v17,v16" | |
176 | func_check "vmrglh v14,v8,v15" | |
177 | func_check "vmrglw v31,v21,v5" | |
178 | func_check "vmr v24,v9" | |
179 | func_check "vmr v24,v9" | |
180 | func_check "vmsummbm v0,v24,v15,v23" | |
181 | func_check "vmsumshm v1,v4,v7,v25" | |
182 | func_check "vmsumshs v9,v8,v13,v31" | |
183 | func_check "vmsumubm v23,v31,v12,v30" | |
184 | func_check "vmsumuhm v29,v0,v26,v21" | |
185 | func_check "vmsumuhs v27,v14,v25,v5" | |
186 | func_check "vmulesb v10,v25,v14" | |
187 | func_check "vmulesh v1,v18,v8" | |
188 | func_check "vmuleub v17,v14,v9" | |
189 | func_check "vmuleuh v5,v26,v9" | |
190 | func_check "vmulosb v21,v18,v6" | |
191 | func_check "vmulosh v4,v5,v8" | |
192 | func_check "vmuloub v2,v9,v19" | |
193 | func_check "vmulouh v29,v5,v4" | |
194 | func_check "vnmsubfp v8,v2,v6,v5" | |
195 | func_check "vnor v31,v9,v10" | |
196 | func_check "vnot v25,v31" | |
197 | func_check "vnot v25,v31" | |
198 | func_check "vor v23,v7,v2" | |
199 | func_check "vperm v0,v28,v22,v25" | |
200 | func_check "vpkpx v16,v25,v17" | |
201 | func_check "vpkshss v12,v16,v17" | |
202 | func_check "vpkshus v1,v19,v23" | |
203 | func_check "vpkswss v25,v7,v13" | |
204 | func_check "vpkswus v4,v24,v10" | |
205 | func_check "vpkuhum v9,v27,v12" | |
206 | func_check "vpkuhus v22,v10,v25" | |
207 | func_check "vpkuwum v30,v18,v0" | |
208 | func_check "vpkuwus v7,v3,v22" | |
209 | func_check "vrefp v24,v28" | |
210 | func_check "vrfim v17,v19" | |
211 | func_check "vrfin v24,v25" | |
212 | func_check "vrfip v3,v5" | |
213 | func_check "vrfiz v8,v10" | |
214 | func_check "vrlb v26,v18,v30" | |
215 | func_check "vrlh v16,v17,v25" | |
216 | func_check "vrlw v23,v30,v9" | |
217 | func_check "vrsqrtefp v2,v18" | |
218 | func_check "vsel v20,v14,v18,v10" | |
219 | func_check "vslb v25,v25,v12" | |
220 | func_check "vsldoi v9,v9,v12,7" | |
221 | func_check "vslh v14,v2,v11" | |
222 | func_check "vslo v30,v5,v6" | |
223 | func_check "vsl v22,v30,v9" | |
224 | func_check "vslw v26,v26,v3" | |
225 | func_check "vspltb v1,v20,6" | |
226 | func_check "vsplth v16,v18,3" | |
227 | func_check "vspltisb v25,-13" | |
228 | func_check "vspltish v22,10" | |
229 | func_check "vspltisw v13,13" | |
230 | func_check "vspltw v9,v18,2" | |
231 | func_check "vsrab v14,v22,v0" | |
232 | func_check "vsrah v12,v12,v18" | |
233 | func_check "vsraw v2,v2,v13" | |
234 | func_check "vsrb v7,v27,v5" | |
235 | func_check "vsrh v7,v11,v29" | |
236 | func_check "vsro v18,v30,v31" | |
237 | func_check "vsr v2,v9,v28" | |
238 | func_check "vsrw v0,v25,v0" | |
239 | func_check "vsubcuw v24,v2,v10" | |
240 | func_check "vsubfp v22,v24,v20" | |
241 | func_check "vsubsbs v10,v22,v13" | |
242 | func_check "vsubshs v24,v17,v28" | |
243 | func_check "vsubsws v10,v26,v0" | |
244 | func_check "vsububm v16,v11,v24" | |
245 | func_check "vsububs v11,v21,v1" | |
246 | func_check "vsubuhm v6,v12,v24" | |
247 | func_check "vsubuhs v30,v11,v9" | |
248 | func_check "vsubuwm v19,v20,v13" | |
249 | func_check "vsubuws v18,v25,v6" | |
250 | func_check "vsum2sws v25,v10,v18" | |
251 | func_check "vsum4sbs v13,v16,v21" | |
252 | func_check "vsum4shs v23,v8,v4" | |
253 | func_check "vsum4ubs v28,v13,v30" | |
254 | func_check "vsumsws v22,v10,v8" | |
255 | func_check "vupkhpx v24,v14" | |
256 | func_check "vupkhsb v2,v22" | |
257 | func_check "vupkhsh v16,v2" | |
258 | func_check "vupklpx v10,v26" | |
259 | func_check "vupklsb v15,v28" | |
260 | func_check "vupklsh v8,v8" | |
261 | func_check "vxor v25,v0,v3" |