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