binutils-gdb/gdb/testsuite/gdb.arch/powerpc-power9.exp
Rogerio Alves 5d2e119328 gdb: fix powerpc disassembly tests
This patch fixes test failures power8 and power9 caused by changes on
opcodes:

The dissasembler does not emit whitespace for instructions
anymore (c2b1c27545)

The dissasembler generates extended mnemonics for some instructions
instead (aae9718e4d)

The ldmx instruction was removed. This instruction was never
implemented (6fbc939cfd)

gdb/testsuite/ChangeLog:
2020-02-03  Rogerio A. Cardoso  <rcardoso@linux.ibm.com>

	* gdb.arch/powerpc-power8.exp: Delete trailing whitespace of
	tbegin., tend. instructions. Replace bctar-, bctar+, bctarl-,
	bctarl+ extended mnemonics when avaliable by bgttar, bnstarl,
	blttar, bnetarl.
	* gdb.arch/powerpc-power8.s: Fix comments. Fix instructions
	binary for blttar, bnetarl.
	* gdb.arch/powerpc-power9.exp: Delete trailing whitespace of
	wait instruction. Delete ldmx test.
	* gdb.arch/powerpc-power9.s: Delete ldmx instruction.
2020-02-03 22:35:49 -05:00

444 lines
14 KiB
Plaintext

# 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 power9"
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 "cnttzd r3,r13"
func_check "cnttzd. r4,r14"
func_check "cnttzw r5,r15"
func_check "cnttzw. r6,r16"
func_check "modsd r10,r20,r21"
func_check "modsw r11,r21,r22"
func_check "modud r12,r22,r23"
func_check "moduw r13,r23,r24"
func_check "bcdcfn. v3,v4,0"
func_check "bcdcfn. v3,v4,1"
func_check "bcdcfsq. v4,v5,0"
func_check "bcdcfsq. v4,v5,1"
func_check "bcdcfz. v5,v6,0"
func_check "bcdcfz. v5,v6,1"
func_check "bcdcpsgn. v6,v7,v8"
func_check "bcdctn. v7,v8"
func_check "bcdctsq. v8,v9"
func_check "bcdctz. v9,v10,0"
func_check "bcdctz. v9,v10,1"
func_check "bcdsetsgn. v10,v11,0"
func_check "bcdsetsgn. v10,v11,1"
func_check "bcdsr. v11,v12,v13,0"
func_check "bcdsr. v11,v12,v13,1"
func_check "bcds. v12,v13,v14,0"
func_check "bcds. v12,v13,v14,1"
func_check "bcdtrunc. v13,v14,v15,0"
func_check "bcdtrunc. v13,v14,v15,1"
func_check "bcdus. v14,v15,v16"
func_check "bcdutrunc. v15,v16,v17"
func_check "lxvll vs20,0,r21"
func_check "lxvll vs20,r10,r21"
func_check "stxvll vs21,0,r11"
func_check "stxvll vs21,r10,r11"
func_check "vmul10cuq v22,v23"
func_check "vmul10ecuq v23,v24,v25"
func_check "vmul10euq v24,v25,v26"
func_check "vmul10uq v25,v26"
func_check "xsaddqp v10,v11,v12"
func_check "xsaddqpo v11,v12,v12"
func_check "xsrqpi 0,v20,v30,0"
func_check "xsrqpi 1,v20,v30,0"
func_check "xsrqpi 0,v20,v30,3"
func_check "xsrqpi 1,v20,v30,3"
func_check "xsrqpix 0,v21,v31,0"
func_check "xsrqpix 1,v21,v31,0"
func_check "xsrqpix 0,v21,v31,3"
func_check "xsrqpix 1,v21,v31,3"
func_check "xsmulqp v12,v13,v14"
func_check "xsmulqpo v13,v14,v15"
func_check "xsrqpxp 0,v22,v23,0"
func_check "xsrqpxp 1,v22,v23,0"
func_check "xsrqpxp 0,v22,v23,3"
func_check "xsrqpxp 1,v22,v23,3"
func_check "xscpsgnqp v14,v15,v16"
func_check "xscmpoqp cr0,v15,v16"
func_check "xscmpoqp cr7,v15,v16"
func_check "xscmpexpqp cr0,v16,v17"
func_check "xscmpexpqp cr7,v16,v17"
func_check "xsmaddqp v17,v18,v19"
func_check "xsmaddqpo v18,v19,v20"
func_check "xsmsubqp v19,v20,v21"
func_check "xsmsubqpo v20,v21,v22"
func_check "xsnmaddqp v21,v22,v23"
func_check "xsnmaddqpo v22,v23,v24"
func_check "xsnmsubqp v23,v24,v25"
func_check "xsnmsubqpo v24,v25,v26"
func_check "xssubqp v25,v26,v27"
func_check "xssubqpo v26,v27,v28"
func_check "xsdivqp v27,v28,v29"
func_check "xsdivqpo v28,v29,v30"
func_check "xscmpuqp cr0,v29,v30"
func_check "xscmpuqp cr7,v29,v30"
func_check "xststdcqp cr0,v30,0"
func_check "xststdcqp cr7,v30,0"
func_check "xststdcqp cr0,v31,127"
func_check "xststdcqp cr7,v31,127"
func_check "xsabsqp v10,v11"
func_check "xsxexpqp v11,v12"
func_check "xsnabsqp v12,v13"
func_check "xsnegqp v13,v14"
func_check "xsxsigqp v14,v15"
func_check "xssqrtqp v15,v16"
func_check "xssqrtqpo v16,v17"
func_check "xscvqpuwz v17,v18"
func_check "xscvudqp v18,v19"
func_check "xscvqpswz v19,v20"
func_check "xscvsdqp v20,v21"
func_check "xscvqpudz v21,v22"
func_check "xscvqpdp v22,v23"
func_check "xscvqpdpo v23,v24"
func_check "xscvdpqp v24,v25"
func_check "xscvqpsdz v25,v26"
func_check "xsiexpqp v26,v27,v28"
func_check "vpermr v4,v5,v6,v7"
func_check "vextractub v5,v6,0"
func_check "vextractub v5,v6,15"
func_check "vextractuh v6,v7,0"
func_check "vextractuh v6,v7,15"
func_check "vextractuw v7,v8,0"
func_check "vextractuw v7,v8,15"
func_check "vextractd v8,v9,0"
func_check "vextractd v8,v9,15"
func_check "vinsertb v9,v10,0"
func_check "vinsertb v9,v10,15"
func_check "vinserth v10,v11,0"
func_check "vinserth v10,v11,15"
func_check "vinsertw v11,v12,0"
func_check "vinsertw v11,v12,15"
func_check "vinsertd v12,v13,0"
func_check "vinsertd v12,v13,15"
func_check "mfvsrld r20,vs45"
func_check "mtvsrws vs46,r21"
func_check "mtvsrdd vs47,0,r23"
func_check "mtvsrdd vs47,r22,r23"
func_check "lxvx vs50,0,r11"
func_check "lxvx vs0,r10,r11"
func_check "lxvwsx vs51,0,r12"
func_check "lxvwsx vs1,r10,r12"
func_check "lxvh8x vs52,0,r13"
func_check "lxvh8x vs2,r10,r13"
func_check "lxvb16x vs53,0,r14"
func_check "lxvb16x vs3,r10,r14"
func_check "stxvx vs54,0,r15"
func_check "stxvx vs4,r20,r15"
func_check "stxvh8x vs55,0,r16"
func_check "stxvh8x vs5,r20,r16"
func_check "stxvb16x vs56,0,r17"
func_check "stxvb16x vs6,r20,r17"
func_check "xxextractuw vs4,vs5,0"
func_check "xxextractuw vs40,vs50,15"
func_check "xxspltib vs4,0"
func_check "xxspltib vs4,128"
func_check "xxspltib vs41,255"
func_check "xxspltib vs41,255"
func_check "xxinsertw vs5,vs6,0"
func_check "xxinsertw vs50,vs60,15"
func_check "xxbrh vs6,vs7"
func_check "xxbrh vs56,vs57"
func_check "xxbrw vs7,vs8"
func_check "xxbrw vs57,vs58"
func_check "xxbrd vs8,vs9"
func_check "xxbrd vs58,vs59"
func_check "xxbrq vs9,vs10"
func_check "xxbrq vs59,vs60"
func_check "lxsd v20,0(0)"
func_check "lxsd v20,0(r10)"
func_check "lxsd v20,8(0)"
func_check "lxsd v20,8(r10)"
func_check "lxsd v20,-8(0)"
func_check "lxsd v20,-8(r10)"
func_check "lxsd v20,32764(0)"
func_check "lxsd v20,32764(r10)"
func_check "lxsd v20,-32768(0)"
func_check "lxsd v20,-32768(r10)"
func_check "lxssp v30,0(0)"
func_check "lxssp v30,0(r11)"
func_check "lxssp v30,8(0)"
func_check "lxssp v30,8(r11)"
func_check "lxssp v30,-8(0)"
func_check "lxssp v30,-8(r11)"
func_check "lxssp v30,32764(0)"
func_check "lxssp v30,32764(r11)"
func_check "lxssp v30,-32768(0)"
func_check "lxssp v30,-32768(r11)"
func_check "lxv vs40,0(0)"
func_check "lxv vs40,0(r12)"
func_check "lxv vs40,16(0)"
func_check "lxv vs40,16(r12)"
func_check "lxv vs40,-16(0)"
func_check "lxv vs10,-16(r12)"
func_check "lxv vs10,32752(0)"
func_check "lxv vs10,32752(r12)"
func_check "lxv vs10,-32768(0)"
func_check "lxv vs10,-32768(r12)"
func_check "stxsd v21,0(0)"
func_check "stxsd v21,0(r10)"
func_check "stxsd v21,8(0)"
func_check "stxsd v21,8(r10)"
func_check "stxsd v21,-8(0)"
func_check "stxsd v21,-8(r10)"
func_check "stxsd v21,32764(0)"
func_check "stxsd v21,32764(r10)"
func_check "stxsd v21,-32768(0)"
func_check "stxsd v21,-32768(r10)"
func_check "stxssp v31,0(0)"
func_check "stxssp v31,0(r11)"
func_check "stxssp v31,8(0)"
func_check "stxssp v31,8(r11)"
func_check "stxssp v31,-8(0)"
func_check "stxssp v31,-8(r11)"
func_check "stxssp v31,32764(0)"
func_check "stxssp v31,32764(r11)"
func_check "stxssp v31,-32768(0)"
func_check "stxssp v31,-32768(r11)"
func_check "stxv vs41,0(0)"
func_check "stxv vs41,0(r12)"
func_check "stxv vs41,16(0)"
func_check "stxv vs41,16(r12)"
func_check "stxv vs41,-16(0)"
func_check "stxv vs11,-16(r12)"
func_check "stxv vs11,32752(0)"
func_check "stxv vs11,32752(r12)"
func_check "stxv vs11,-32768(0)"
func_check "stxv vs11,-32768(r12)"
func_check "xxperm vs20,vs22,vs24"
func_check "xxperm vs40,vs42,vs44"
func_check "xxpermr vs21,vs23,vs25"
func_check "xxpermr vs41,vs43,vs45"
func_check "extswsli r12,r20,0"
func_check "extswsli r12,r20,1"
func_check "extswsli r12,r20,63"
func_check "extswsli. r13,r21,0"
func_check "extswsli. r13,r21,1"
func_check "extswsli. r13,r21,63"
func_check "vrlwmi v14,v22,v23"
func_check "vrldmi v15,v23,v24"
func_check "vrlwnm v16,v24,v25"
func_check "vrldnm v17,v25,v26"
func_check "vbpermd v18,v26,v27"
func_check "vnegw v19,v20"
func_check "vnegd v20,v21"
func_check "vprtybw v21,v22"
func_check "vprtybd v22,v23"
func_check "vprtybq v23,v24"
func_check "vextsb2w v24,v25"
func_check "vextsh2w v25,v26"
func_check "vextsb2d v26,v27"
func_check "vextsh2d v27,v28"
func_check "vextsw2d v28,v29"
func_check "vctzb v29,v30"
func_check "vctzh v30,v31"
func_check "vctzw v31,v30"
func_check "vctzd v30,v29"
func_check "lxsibzx vs10,0,r20"
func_check "lxsibzx vs50,r10,r20"
func_check "lxsihzx vs11,0,r21"
func_check "lxsihzx vs51,r11,r21"
func_check "stxsibx vs12,0,r22"
func_check "stxsibx vs52,r12,r22"
func_check "stxsihx vs13,0,r23"
func_check "stxsihx vs53,r13,r23"
func_check "maddhd r10,r11,r12,r13"
func_check "maddhdu r20,r21,r22,r23"
func_check "maddld r2,r3,r4,r5"
func_check "xscmpexpdp cr0,vs10,vs20"
func_check "xscmpexpdp cr7,vs40,vs50"
func_check "xsiexpdp vs41,r11,r21"
func_check "xststdcdp cr0,vs11,127"
func_check "xststdcdp cr7,vs41,127"
func_check "xststdcsp cr0,vs11,127"
func_check "xststdcsp cr7,vs41,127"
func_check "xsxexpdp r13,vs43"
func_check "xsxsigdp r14,vs44"
func_check "xviexpdp vs45,vs46,vs47"
func_check "xviexpsp vs46,vs47,vs48"
func_check "xvtstdcdp vs54,vs55,0"
func_check "xvtstdcdp vs54,vs55,127"
func_check "xvtstdcsp vs55,vs56,0"
func_check "xvtstdcsp vs55,vs56,127"
func_check "xvxexpdp vs57,vs58"
func_check "xvxexpsp vs58,vs59"
func_check "xvxsigdp vs59,vs60"
func_check "xvxsigsp vs60,vs61"
func_check "cmpeqb cr0,r6,r7"
func_check "cmpeqb cr7,r6,r7"
func_check "cmprb cr0,0,r8,r9"
func_check "cmprb cr7,0,r8,r9"
func_check "cmprb cr0,1,r8,r9"
func_check "cmprb cr7,1,r8,r9"
func_check "setb r15,cr0"
func_check "setb r15,cr7"
func_check "lxvl vs26,0,r10"
func_check "lxvl vs56,r20,r10"
func_check "stxvl vs27,0,r11"
func_check "stxvl vs57,r21,r11"
func_check "vclzlsbb r20,v30"
func_check "vctzlsbb r21,v31"
func_check "vcmpneb v10,v11,v12"
func_check "vcmpneb. v20,v21,v22"
func_check "vcmpneh v11,v12,v13"
func_check "vcmpneh. v21,v22,v23"
func_check "vcmpnew v12,v13,v14"
func_check "vcmpnew. v22,v23,v24"
func_check "vcmpnezb v13,v14,v15"
func_check "vcmpnezb. v23,v24,v25"
func_check "vcmpnezh v14,v15,v16"
func_check "vcmpnezh. v24,v25,v26"
func_check "vcmpnezw v15,v16,v17"
func_check "vcmpnezw. v25,v26,v27"
func_check "vextublx r16,r17,v10"
func_check "vextubrx r17,r18,v11"
func_check "vextuhlx r18,r19,v12"
func_check "vextuhrx r19,r20,v13"
func_check "vextuwlx r20,r21,v14"
func_check "vextuwrx r21,r22,v15"
func_check "dtstsfi cr0,0,f3"
func_check "dtstsfi cr7,63,f3"
func_check "dtstsfiq cr0,0,f4"
func_check "dtstsfiq cr7,63,f4"
func_check "xscvhpdp vs40,vs50"
func_check "xscvdphp vs41,vs51"
func_check "xvcvhpsp vs42,vs52"
func_check "xvcvsphp vs43,vs53"
func_check "lnia r3"
func_check "lnia r3"
func_check "addpcis r4,1"
func_check "addpcis r4,1"
func_check "addpcis r5,-2"
func_check "addpcis r5,-2"
func_check "addpcis r6,32767"
func_check "addpcis r6,32767"
func_check "addpcis r7,-32768"
func_check "addpcis r7,-32768"
func_check "slbsync"
func_check "slbiag r10"
func_check "slbieg r10,r11"
func_check "slbmfee r3,r4"
func_check "slbmfee r3,r4"
func_check "slbmfee r3,r4,1"
func_check "slbmfev r4,r5"
func_check "slbmfev r4,r5"
func_check "slbmfev r4,r5,1"
func_check "tlbie r3,r4"
func_check "tlbie r3,r4"
func_check "tlbie r3,r4,3,1,1"
func_check "tlbiel r3"
func_check "tlbiel r3"
func_check "tlbiel r3,r4,3,1,1"
func_check "copy r12,r13"
func_check "paste. r10,r11"
func_check "cpabort"
func_check "hwsync"
func_check "hwsync"
func_check "hwsync"
func_check "lwsync"
func_check "lwsync"
func_check "ptesync"
func_check "ptesync"
func_check "ldat r20,0,0"
func_check "ldat r20,r10,28"
func_check "lwat r21,0,0"
func_check "lwat r21,r11,28"
func_check "stdat r22,0,0"
func_check "stdat r22,r12,28"
func_check "stwat r23,0,0"
func_check "stwat r23,r13,28"
func_check "urfid"
func_check "rmieg r30"
func_check "stop"
func_check "wait"
func_check "wait"
func_check "darn r3,0"
func_check "darn r3,1"
func_check "darn r3,2"
func_check "mcrxrx cr0"
func_check "mcrxrx cr7"
func_check "vslv v20,v21,v22"
func_check "vsrv v23,v24,v25"
func_check "msgsync"
func_check "xscmpeqdp vs30,vs40,vs50"
func_check "xscmpgtdp vs31,vs41,vs51"
func_check "xscmpgedp vs32,vs42,vs52"
func_check "xsmincdp vs34,vs44,vs54"
func_check "xsmaxcdp vs35,vs45,vs55"
func_check "xsminjdp vs36,vs46,vs56"
func_check "xsmaxjdp vs37,vs47,vs57"
func_check "vmsumudm v20,v21,v22,v23"
func_check "addex r11,r12,r13,0"
func_check "addex r11,r12,r13,1"
func_check "addex r11,r12,r13,2"
func_check "mffs f25"
func_check "mffs. f25"
func_check "mffsce f26"
func_check "mffscdrn f27,f20"
func_check "mffscdrni f28,0"
func_check "mffscdrni f28,7"
func_check "mffscrn f29,f21"
func_check "mffscrni f30,0"
func_check "mffscrni f30,3"
func_check "mffsl f31"