blob: 54c364c37d8b9efc44c8e899f6be9a4f21da3405 [file] [log] [blame]
# Copyright 2014-2021 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
# 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."
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 altivec"
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 "vmul10cuq v11,v30"
func_check "vcmpneb v30,v1,v23"
func_check "vpermr v30,v19,v30,v29"
func_check "vmul10ecuq v20,v20,v17"
func_check "vcmpneh v27,v19,v31"
func_check "vrlwmi v6,v9,v23"
func_check "vcmpnew v22,v26,v1"
func_check "vrldmi v24,v30,v25"
func_check "vcmpnezb v19,v29,v22"
func_check "vcmpnezh v8,v23,v19"
func_check "vrlwnm v27,v24,v11"
func_check "vcmpnezw v21,v13,v10"
func_check "vrldnm v5,v20,v29"
func_check "vmul10uq v30,v19"
func_check "vextractub v24,v21,12"
func_check "vmul10euq v0,v19,v28"
func_check "vextractuh v10,v3,12"
func_check "vextractuw v28,v12,7"
func_check "vextractd v30,v27,1"
func_check "vinsertb v25,v31,4"
func_check "bcdcpsgn. v21,v14,v30"
func_check "vinserth v22,v18,5"
func_check "vinsertw v29,v22,1"
func_check "vinsertd v29,v13,7"
func_check "vcmpneb. v22,v25,v8"
func_check "vcmpneh. v16,v15,v21"
func_check "bcdus. v22,v21,v31"
func_check "vcmpnew. v1,v12,v12"
func_check "bcds. v5,v3,v8,1"
func_check "bcdtrunc. v27,v22,v1,0"
func_check "vcmpnezb. v2,v26,v0"
func_check "bcdutrunc. v26,v14,v7"
func_check "vcmpnezh. v16,v5,v12"
func_check "bcdctsq. v24,v5"
func_check "bcdcfsq. v7,v0,0"
func_check "bcdctz. v30,v12,1"
func_check "bcdctn. v17,v23"
func_check "bcdcfz. v4,v15,1"
func_check "bcdcfn. v29,v5,1"
func_check "bcdsetsgn. v27,v12,0"
func_check "vcmpnezw. v14,v28,v25"
func_check "bcdsr. v2,v2,v6,1"
func_check "vbpermd v25,v0,v5"
func_check "vclzlsbb r28,v25"
func_check "vctzlsbb r2,v24"
func_check "vnegw v21,v11"
func_check "vnegd v17,v27"
func_check "vprtybw v31,v23"
func_check "vprtybd v21,v23"
func_check "vprtybq v21,v18"
func_check "vextsb2w v30,v4"
func_check "vextsh2w v3,v26"
func_check "vextsb2d v11,v17"
func_check "vextsh2d v5,v10"
func_check "vextsw2d v13,v25"
func_check "vctzb v25,v2"
func_check "vctzh v0,v3"
func_check "vctzw v22,v6"
func_check "vctzd v26,v24"
func_check "vextublx r6,r31,v2"
func_check "vextuhlx r13,r0,v18"
func_check "vextuwlx r14,r30,v31"
func_check "vsrv v15,v12,v14"
func_check "vextubrx r20,r10,v30"
func_check "vslv v21,v21,v2"
func_check "vextuhrx r15,r9,v1"
func_check "vextuwrx r21,r17,v16"
func_check "vmsumudm v20,v21,v22,v23"