1# Copyright 2014-2020 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 vsx" 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 "lxvx vs34,r6,r25" 65func_check "lxvx vs20,0,r10" 66func_check "lxvl vs20,r24,r10" 67func_check "lxvl vs54,0,r29" 68func_check "lxvll vs24,r20,r19" 69func_check "lxvll vs34,0,r14" 70func_check "mfvsrld r2,vs22" 71func_check "lxvwsx vs58,r26,r25" 72func_check "lxvwsx vs55,0,r29" 73func_check "stxvx vs14,r21,r4" 74func_check "stxvx vs30,0,r22" 75func_check "stxvl vs0,r26,r4" 76func_check "stxvl vs37,0,r22" 77func_check "mtvsrws vs24,r10" 78func_check "stxvll vs30,r21,r15" 79func_check "stxvll vs39,0,r14" 80func_check "mtvsrdd vs12,r6,r5" 81func_check "mtvsrdd vs38,0,r21" 82func_check "lxsibzx vs59,r28,r6" 83func_check "lxsibzx vs30,0,r8" 84func_check "lxvh8x vs42,r23,r17" 85func_check "lxvh8x vs36,0,r5" 86func_check "lxsihzx vs12,r9,r11" 87func_check "lxsihzx vs49,0,r13" 88func_check "lxvb16x vs37,r3,r19" 89func_check "lxvb16x vs0,0,r30" 90func_check "stxsibx vs2,r30,r6" 91func_check "stxsibx vs12,0,r13" 92func_check "stxvh8x vs16,r29,r8" 93func_check "stxvh8x vs55,0,r10" 94func_check "stxsihx vs34,r2,r23" 95func_check "stxsihx vs60,0,r23" 96func_check "stxvb16x vs23,r14,r12" 97func_check "stxvb16x vs19,0,r5" 98func_check "lxsd v24,0(0)" 99func_check "lxsd v15,16(r21)" 100func_check "lxssp v6,0(0)" 101func_check "lxssp v23,16(r9)" 102func_check "xscmpeqdp vs18,vs51,vs33" 103func_check "xscmpgtdp vs2,vs26,vs34" 104func_check "xscmpgedp vs5,vs26,vs20" 105func_check "xxperm vs44,vs10,vs43" 106func_check "xxpermr vs41,vs20,vs5" 107func_check "xscmpexpdp cr4,vs18,vs55" 108func_check "xxextractuw vs23,vs37,3" 109func_check "xxspltib vs54,235" 110func_check "xxinsertw vs15,vs30,4" 111func_check "xsmaxcdp vs12,vs11,vs7" 112func_check "xsmincdp vs32,vs25,vs24" 113func_check "xsmaxjdp vs25,vs53,vs12" 114func_check "xststdcsp cr2,vs36,127" 115func_check "xsminjdp vs32,vs21,vs45" 116func_check "xsxexpdp r17,vs50" 117func_check "xsxsigdp r7,vs40" 118func_check "xscvhpdp vs54,vs34" 119func_check "xscvdphp vs58,vs54" 120func_check "xststdcdp cr0,vs38,127" 121func_check "xvtstdcsp vs56,vs53,127" 122func_check "xviexpsp vs54,vs20,vs52" 123func_check "xsiexpdp vs57,r28,r29" 124func_check "xvxexpdp vs1,vs20" 125func_check "xvxsigdp vs54,vs59" 126func_check "xxbrh vs18,vs37" 127func_check "xvxexpsp vs14,vs1" 128func_check "xvxsigsp vs52,vs13" 129func_check "xxbrw vs19,vs5" 130func_check "xxbrd vs51,vs55" 131func_check "xvcvhpsp vs35,vs17" 132func_check "xvcvsphp vs15,vs45" 133func_check "xxbrq vs17,vs31" 134func_check "xvtstdcdp vs16,vs12,127" 135func_check "xviexpdp vs27,vs9,vs8" 136func_check "lxv vs4,0(0)" 137func_check "lxv vs40,16(r20)" 138func_check "stxv vs50,0(0)" 139func_check "stxv vs8,16(r16)" 140func_check "stxsd v3,0(0)" 141func_check "stxsd v17,16(r2)" 142func_check "stxssp v13,0(0)" 143func_check "stxssp v17,16(r13)" 144func_check "xsaddqp v8,v10,v18" 145func_check "xsaddqpo v5,v1,v29" 146func_check "xsrqpi 0,v12,v18,3" 147func_check "xsrqpix 1,v31,v19,0" 148func_check "xsmulqp v14,v1,v6" 149func_check "xsmulqpo v17,v7,v27" 150func_check "xsrqpxp 0,v4,v11,0" 151func_check "xscpsgnqp v29,v23,v28" 152func_check "xscmpoqp cr7,v13,v27" 153func_check "xscmpexpqp cr5,v21,v6" 154func_check "xsmaddqp v2,v19,v4" 155func_check "xsmaddqpo v30,v7,v16" 156func_check "xsmsubqp v21,v30,v15" 157func_check "xsmsubqpo v12,v17,v30" 158func_check "xsnmaddqp v6,v30,v12" 159func_check "xsnmaddqpo v12,v22,v12" 160func_check "xsnmsubqp v10,v29,v27" 161func_check "xsnmsubqpo v29,v29,v13" 162func_check "xssubqp v19,v27,v4" 163func_check "xssubqpo v13,v8,v1" 164func_check "xsdivqp v8,v3,v27" 165func_check "xsdivqpo v24,v20,v27" 166func_check "xscmpuqp cr7,v14,v4" 167func_check "xststdcqp cr4,v2,127" 168func_check "xsabsqp v31,v22" 169func_check "xsxexpqp v25,v3" 170func_check "xsnabsqp v10,v28" 171func_check "xsnegqp v19,v31" 172func_check "xsxsigqp v11,v13" 173func_check "xssqrtqp v13,v14" 174func_check "xssqrtqpo v1,v27" 175func_check "xscvqpuwz v3,v7" 176func_check "xscvudqp v20,v18" 177func_check "xscvqpswz v29,v29" 178func_check "xscvsdqp v2,v28" 179func_check "xscvqpudz v23,v4" 180func_check "xscvqpdp v3,v20" 181func_check "xscvqpdpo v1,v3" 182func_check "xscvdpqp v19,v12" 183func_check "xscvqpsdz v13,v4" 184func_check "xsiexpqp v7,v24,v7" 185