1# Copyright 2014-2019 Free Software Foundation, Inc. 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 20standard_testfile .s 21set objfile [standard_output_file ${testfile}.o] 22 23if {![istarget "powerpc*-*-*"]} then { 24 verbose "Skipping PowerPC instructions disassembly." 25 return 26} 27 28if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { 29 untested "PowerPC instructions disassembly" 30 return -1 31} 32 33clean_restart ${objfile} 34 35# Disassemble the function. 36set func "" 37 38gdb_test "set disassembler-options power7" 39set test "disass func" 40gdb_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 47proc 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 53proc func_check {instr} { 54 global func 55 56 set test "found: $instr" 57 if [regexp -nocase -line [instr_to_patt $instr] $func] { 58 pass $test 59 } else { 60 fail $test 61 } 62} 63 64func_check "lxvd2x vs3,r4,r5" 65func_check "lxvd2x vs43,r4,r5" 66func_check "stxvd2x vs3,r4,r5" 67func_check "stxvd2x vs43,r4,r5" 68func_check "xxmrghd vs3,vs4,vs5" 69func_check "xxmrghd vs43,vs44,vs45" 70func_check "xxmrgld vs3,vs4,vs5" 71func_check "xxmrgld vs43,vs44,vs45" 72func_check "xxmrghd vs3,vs4,vs5" 73func_check "xxmrghd vs43,vs44,vs45" 74func_check "xxmrgld vs3,vs4,vs5" 75func_check "xxmrgld vs43,vs44,vs45" 76func_check "xxpermdi vs3,vs4,vs5,1" 77func_check "xxpermdi vs43,vs44,vs45,1" 78func_check "xxpermdi vs3,vs4,vs5,2" 79func_check "xxpermdi vs43,vs44,vs45,2" 80func_check "xvmovdp vs3,vs4" 81func_check "xvmovdp vs43,vs44" 82func_check "xvmovdp vs3,vs4" 83func_check "xvmovdp vs43,vs44" 84func_check "xvcpsgndp vs3,vs4,vs5" 85func_check "xvcpsgndp vs43,vs44,vs45" 86func_check "doze" 87func_check "nap" 88func_check "sleep" 89func_check "rvwinkle" 90func_check "prtyw r3,r4" 91func_check "prtyd r13,r14" 92func_check "mfcfar r10" 93func_check "mtcfar r11" 94func_check "cmpb r3,r4,r5" 95func_check "lwzcix r10,r11,r12" 96func_check "dadd f16,f17,f18" 97func_check "daddq f20,f22,f24" 98func_check "dss 3" 99func_check "dssall" 100func_check "dst r5,r4,1" 101func_check "dstt r8,r7,0" 102func_check "dstst r5,r6,3" 103func_check "dststt r4,r5,2" 104func_check "divwe r10,r11,r12" 105func_check "divwe. r11,r12,r13" 106func_check "divweo r12,r13,r14" 107func_check "divweo. r13,r14,r15" 108func_check "divweu r10,r11,r12" 109func_check "divweu. r11,r12,r13" 110func_check "divweuo r12,r13,r14" 111func_check "divweuo. r13,r14,r15" 112func_check "bpermd r7,r17,r27" 113func_check "popcntw r10,r20" 114func_check "popcntd r10,r20" 115func_check "ldbrx r20,r21,r22" 116func_check "stdbrx r20,r21,r22" 117func_check "lfiwzx f10,0,r10" 118func_check "lfiwzx f10,r9,r10" 119func_check "fcfids f4,f5" 120func_check "fcfids. f4,f5" 121func_check "fcfidus f4,f5" 122func_check "fcfidus. f4,f5" 123func_check "fctiwu f4,f5" 124func_check "fctiwu. f4,f5" 125func_check "fctiwuz f4,f5" 126func_check "fctiwuz. f4,f5" 127func_check "fctidu f4,f5" 128func_check "fctidu. f4,f5" 129func_check "fctiduz f4,f5" 130func_check "fctiduz. f4,f5" 131func_check "fcfidu f4,f5" 132func_check "fcfidu. f4,f5" 133func_check "ftdiv cr0,f10,f11" 134func_check "ftdiv cr7,f10,f11" 135func_check "ftsqrt cr0,f10" 136func_check "ftsqrt cr7,f10" 137func_check "dcbtt r8,r9" 138func_check "dcbtstt r8,r9" 139func_check "dcffix f10,f12" 140func_check "dcffix. f20,f22" 141func_check "fre f14,f15" 142func_check "fre. f14,f15" 143func_check "fres f14,f15" 144func_check "fres. f14,f15" 145func_check "frsqrte f14,f15" 146func_check "frsqrte. f14,f15" 147func_check "frsqrtes f14,f15" 148func_check "frsqrtes. f14,f15" 149func_check "isel r2,r3,r4,28" 150func_check "yield" 151func_check "yield" 152func_check "ori r2,r2,0" 153func_check "nop" 154func_check "nop" 155func_check "ori r2,r2,0" 156func_check "mdoio" 157func_check "mdoio" 158func_check "mdoom" 159func_check "mdoom" 160func_check "mfppr r10" 161func_check "mfppr32 r11" 162func_check "mtppr r12" 163func_check "mtppr32 r13" 164func_check "tlbie r10,r11" 165