# 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 . # 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 vsx" 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 "lxvx vs34,r6,r25" func_check "lxvx vs20,0,r10" func_check "lxvl vs20,r24,r10" func_check "lxvl vs54,0,r29" func_check "lxvll vs24,r20,r19" func_check "lxvll vs34,0,r14" func_check "mfvsrld r2,vs22" func_check "lxvwsx vs58,r26,r25" func_check "lxvwsx vs55,0,r29" func_check "stxvx vs14,r21,r4" func_check "stxvx vs30,0,r22" func_check "stxvl vs0,r26,r4" func_check "stxvl vs37,0,r22" func_check "mtvsrws vs24,r10" func_check "stxvll vs30,r21,r15" func_check "stxvll vs39,0,r14" func_check "mtvsrdd vs12,r6,r5" func_check "mtvsrdd vs38,0,r21" func_check "lxsibzx vs59,r28,r6" func_check "lxsibzx vs30,0,r8" func_check "lxvh8x vs42,r23,r17" func_check "lxvh8x vs36,0,r5" func_check "lxsihzx vs12,r9,r11" func_check "lxsihzx vs49,0,r13" func_check "lxvb16x vs37,r3,r19" func_check "lxvb16x vs0,0,r30" func_check "stxsibx vs2,r30,r6" func_check "stxsibx vs12,0,r13" func_check "stxvh8x vs16,r29,r8" func_check "stxvh8x vs55,0,r10" func_check "stxsihx vs34,r2,r23" func_check "stxsihx vs60,0,r23" func_check "stxvb16x vs23,r14,r12" func_check "stxvb16x vs19,0,r5" func_check "lxsd v24,0(0)" func_check "lxsd v15,16(r21)" func_check "lxssp v6,0(0)" func_check "lxssp v23,16(r9)" func_check "xscmpeqdp vs18,vs51,vs33" func_check "xscmpgtdp vs2,vs26,vs34" func_check "xscmpgedp vs5,vs26,vs20" func_check "xxperm vs44,vs10,vs43" func_check "xxpermr vs41,vs20,vs5" func_check "xscmpexpdp cr4,vs18,vs55" func_check "xxextractuw vs23,vs37,3" func_check "xxspltib vs54,235" func_check "xxinsertw vs15,vs30,4" func_check "xsmaxcdp vs12,vs11,vs7" func_check "xsmincdp vs32,vs25,vs24" func_check "xsmaxjdp vs25,vs53,vs12" func_check "xststdcsp cr2,vs36,127" func_check "xsminjdp vs32,vs21,vs45" func_check "xsxexpdp r17,vs50" func_check "xsxsigdp r7,vs40" func_check "xscvhpdp vs54,vs34" func_check "xscvdphp vs58,vs54" func_check "xststdcdp cr0,vs38,127" func_check "xvtstdcsp vs56,vs53,127" func_check "xviexpsp vs54,vs20,vs52" func_check "xsiexpdp vs57,r28,r29" func_check "xvxexpdp vs1,vs20" func_check "xvxsigdp vs54,vs59" func_check "xxbrh vs18,vs37" func_check "xvxexpsp vs14,vs1" func_check "xvxsigsp vs52,vs13" func_check "xxbrw vs19,vs5" func_check "xxbrd vs51,vs55" func_check "xvcvhpsp vs35,vs17" func_check "xvcvsphp vs15,vs45" func_check "xxbrq vs17,vs31" func_check "xvtstdcdp vs16,vs12,127" func_check "xviexpdp vs27,vs9,vs8" func_check "lxv vs4,0(0)" func_check "lxv vs40,16(r20)" func_check "stxv vs50,0(0)" func_check "stxv vs8,16(r16)" func_check "stxsd v3,0(0)" func_check "stxsd v17,16(r2)" func_check "stxssp v13,0(0)" func_check "stxssp v17,16(r13)" func_check "xsaddqp v8,v10,v18" func_check "xsaddqpo v5,v1,v29" func_check "xsrqpi 0,v12,v18,3" func_check "xsrqpix 1,v31,v19,0" func_check "xsmulqp v14,v1,v6" func_check "xsmulqpo v17,v7,v27" func_check "xsrqpxp 0,v4,v11,0" func_check "xscpsgnqp v29,v23,v28" func_check "xscmpoqp cr7,v13,v27" func_check "xscmpexpqp cr5,v21,v6" func_check "xsmaddqp v2,v19,v4" func_check "xsmaddqpo v30,v7,v16" func_check "xsmsubqp v21,v30,v15" func_check "xsmsubqpo v12,v17,v30" func_check "xsnmaddqp v6,v30,v12" func_check "xsnmaddqpo v12,v22,v12" func_check "xsnmsubqp v10,v29,v27" func_check "xsnmsubqpo v29,v29,v13" func_check "xssubqp v19,v27,v4" func_check "xssubqpo v13,v8,v1" func_check "xsdivqp v8,v3,v27" func_check "xsdivqpo v24,v20,v27" func_check "xscmpuqp cr7,v14,v4" func_check "xststdcqp cr4,v2,127" func_check "xsabsqp v31,v22" func_check "xsxexpqp v25,v3" func_check "xsnabsqp v10,v28" func_check "xsnegqp v19,v31" func_check "xsxsigqp v11,v13" func_check "xssqrtqp v13,v14" func_check "xssqrtqpo v1,v27" func_check "xscvqpuwz v3,v7" func_check "xscvudqp v20,v18" func_check "xscvqpswz v29,v29" func_check "xscvsdqp v2,v28" func_check "xscvqpudz v23,v4" func_check "xscvqpdp v3,v20" func_check "xscvqpdpo v1,v3" func_check "xscvdpqp v19,v12" func_check "xscvqpsdz v13,v4" func_check "xsiexpqp v7,v24,v7"