aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch/powerpc-power7.exp
blob: 708ea2d00c913587e3abcc3c9f78ac2c6a932506 (plain)
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
# Copyright 2014-2019 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 power7"
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"
    if [regexp -nocase -line [instr_to_patt $instr] $func] {
	pass $test
    } else {
	fail $test
    }
}

func_check "lxvd2x  vs3,r4,r5"
func_check "lxvd2x  vs43,r4,r5"
func_check "stxvd2x vs3,r4,r5"
func_check "stxvd2x vs43,r4,r5"
func_check "xxmrghd vs3,vs4,vs5"
func_check "xxmrghd vs43,vs44,vs45"
func_check "xxmrgld vs3,vs4,vs5"
func_check "xxmrgld vs43,vs44,vs45"
func_check "xxmrghd vs3,vs4,vs5"
func_check "xxmrghd vs43,vs44,vs45"
func_check "xxmrgld vs3,vs4,vs5"
func_check "xxmrgld vs43,vs44,vs45"
func_check "xxpermdi vs3,vs4,vs5,1"
func_check "xxpermdi vs43,vs44,vs45,1"
func_check "xxpermdi vs3,vs4,vs5,2"
func_check "xxpermdi vs43,vs44,vs45,2"
func_check "xvmovdp vs3,vs4"
func_check "xvmovdp vs43,vs44"
func_check "xvmovdp vs3,vs4"
func_check "xvmovdp vs43,vs44"
func_check "xvcpsgndp vs3,vs4,vs5"
func_check "xvcpsgndp vs43,vs44,vs45"
func_check "doze"
func_check "nap"
func_check "sleep"
func_check "rvwinkle"
func_check "prtyw   r3,r4"
func_check "prtyd   r13,r14"
func_check "mfcfar  r10"
func_check "mtcfar  r11"
func_check "cmpb    r3,r4,r5"
func_check "lwzcix  r10,r11,r12"
func_check "dadd    f16,f17,f18"
func_check "daddq   f20,f22,f24"
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 "divwe   r10,r11,r12"
func_check "divwe.  r11,r12,r13"
func_check "divweo  r12,r13,r14"
func_check "divweo. r13,r14,r15"
func_check "divweu  r10,r11,r12"
func_check "divweu. r11,r12,r13"
func_check "divweuo r12,r13,r14"
func_check "divweuo. r13,r14,r15"
func_check "bpermd  r7,r17,r27"
func_check "popcntw r10,r20"
func_check "popcntd r10,r20"
func_check "ldbrx   r20,r21,r22"
func_check "stdbrx  r20,r21,r22"
func_check "lfiwzx  f10,0,r10"
func_check "lfiwzx  f10,r9,r10"
func_check "fcfids  f4,f5"
func_check "fcfids. f4,f5"
func_check "fcfidus f4,f5"
func_check "fcfidus. f4,f5"
func_check "fctiwu  f4,f5"
func_check "fctiwu. f4,f5"
func_check "fctiwuz f4,f5"
func_check "fctiwuz. f4,f5"
func_check "fctidu  f4,f5"
func_check "fctidu. f4,f5"
func_check "fctiduz f4,f5"
func_check "fctiduz. f4,f5"
func_check "fcfidu  f4,f5"
func_check "fcfidu. f4,f5"
func_check "ftdiv   cr0,f10,f11"
func_check "ftdiv   cr7,f10,f11"
func_check "ftsqrt  cr0,f10"
func_check "ftsqrt  cr7,f10"
func_check "dcbtt   r8,r9"
func_check "dcbtstt r8,r9"
func_check "dcffix  f10,f12"
func_check "dcffix. f20,f22"
func_check "fre     f14,f15"
func_check "fre.    f14,f15"
func_check "fres    f14,f15"
func_check "fres.   f14,f15"
func_check "frsqrte f14,f15"
func_check "frsqrte. f14,f15"
func_check "frsqrtes f14,f15"
func_check "frsqrtes. f14,f15"
func_check "isel    r2,r3,r4,28"
func_check "yield"
func_check "yield"
func_check "ori     r2,r2,0"
func_check "nop"
func_check "nop"
func_check "ori     r2,r2,0"
func_check "mdoio"
func_check "mdoio"
func_check "mdoom"
func_check "mdoom"
func_check "mfppr   r10"
func_check "mfppr32 r11"
func_check "mtppr   r12"
func_check "mtppr32 r13"
func_check "tlbie   r10,r11"