binutils-gdb/gdb/testsuite/gdb.arch/powerpc-vsx.s

183 lines
9.5 KiB
ArmAsm
Raw Normal View History

GDB: Add support for the new set/show disassembler-options commands. This commit adds support to GDB so that it can modify the disassembler-options value that is passed to the disassembler, similar to objdump's -M option. Currently, the only supported targets are ARM, PowerPC and S/390, but adding support for a new target(s) is not difficult. include/ * dis-asm.h (disasm_options_t): New typedef. (parse_arm_disassembler_option): Remove prototype. (set_arm_regname_option): Likewise. (get_arm_regnames): Likewise. (get_arm_regname_num_options): Likewise. (disassemble_init_s390): New prototype. (disassembler_options_powerpc): Likewise. (disassembler_options_arm): Likewise. (disassembler_options_s390): Likewise. (remove_whitespace_and_extra_commas): Likewise. (disassembler_options_cmp): Likewise. (next_disassembler_option): New inline function. (FOR_EACH_DISASSEMBLER_OPTION): New macro. opcodes/ * disassemble.c Include "safe-ctype.h". (disassemble_init_for_target): Handle s390 init. (remove_whitespace_and_extra_commas): New function. (disassembler_options_cmp): Likewise. * arm-dis.c: Include "libiberty.h". (NUM_ELEM): Delete. (regnames): Use long disassembler style names. Add force-thumb and no-force-thumb options. (NUM_ARM_REGNAMES): Rename from this... (NUM_ARM_OPTIONS): ...to this. Use ARRAY_SIZE. (get_arm_regname_num_options): Delete. (set_arm_regname_option): Likewise. (get_arm_regnames): Likewise. (parse_disassembler_options): Likewise. (parse_arm_disassembler_option): Rename from this... (parse_arm_disassembler_options): ...to this. Make static. Use new FOR_EACH_DISASSEMBLER_OPTION macro to scan over options. (print_insn): Use parse_arm_disassembler_options. (disassembler_options_arm): New function. (print_arm_disassembler_options): Handle updated regnames. * ppc-dis.c: Include "libiberty.h". (ppc_opts): Add "32" and "64" entries. (ppc_parse_cpu): Use ARRAY_SIZE and disassembler_options_cmp. (powerpc_init_dialect): Add break to switch statement. Use new FOR_EACH_DISASSEMBLER_OPTION macro. (disassembler_options_powerpc): New function. (print_ppc_disassembler_options): Use ARRAY_SIZE. Remove printing of "32" and "64". * s390-dis.c: Include "libiberty.h". (init_flag): Remove unneeded variable. (struct s390_options_t): New structure type. (options): New structure. (init_disasm): Rename from this... (disassemble_init_s390): ...to this. Add initializations for current_arch_mask and option_use_insn_len_bits_p. Remove init_flag. (print_insn_s390): Delete call to init_disasm. (disassembler_options_s390): New function. (print_s390_disassembler_options): Print using information from struct 'options'. * po/opcodes.pot: Regenerate. binutils/ * objdump.c (main): Use remove_whitespace_and_extra_commas. gdb/ * NEWS: Mention new set/show disassembler-options commands. * doc/gdb.texinfo: Document new set/show disassembler-options commands. * disasm.c: Include "arch-utils.h", "gdbcmd.h" and "safe-ctype.h". (prospective_options): New static variable. (gdb_disassembler::gdb_disassembler): Initialize m_di.disassembler_options. (gdb_buffered_insn_length_init_dis): Initilize di->disassembler_options. (get_disassembler_options): New function. (set_disassembler_options): Likewise. (set_disassembler_options_sfunc): Likewise. (show_disassembler_options_sfunc): Likewise. (disassembler_options_completer): Likewise. (_initialize_disasm): Likewise. * disasm.h (get_disassembler_options): New prototype. (set_disassembler_options): Likewise. * gdbarch.sh (gdbarch_disassembler_options): New variable. (gdbarch_verify_disassembler_options): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * arm-tdep.c (num_disassembly_options): Delete. (set_disassembly_style): Likewise. (arm_disassembler_options): New static variable. (set_disassembly_style_sfunc): Convert short style name into long option name. Call set_disassembler_options. (show_disassembly_style_sfunc): New function. (arm_gdbarch_init): Call set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. (_initialize_arm_tdep): Delete regnames variable and update callers. (arm_disassembler_options): Initialize. (disasm_options): New variable. (num_disassembly_options): Rename from this... (num_disassembly_styles): ...to this. Compute by scanning through disasm_options. (valid_disassembly_styles): Initialize using disasm_options. Remove calls to parse_arm_disassembler_option, get_arm_regnames and set_arm_regname_option. Pass show_disassembly_style_sfunc to the "disassembler" setshow command. * rs6000-tdep.c (powerpc_disassembler_options): New static variable. (rs6000_gdbarch_init): Call set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. * s390-tdep.c (s390_disassembler_options): New static variable. (s390_gdbarch_init):all set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. gdb/testsuite/ * gdb.arch/powerpc-power.exp: Delete test. * gdb.arch/powerpc-power.s: Likewise. * gdb.disasm/disassembler-options.exp: New test. * gdb.arch/powerpc-altivec.exp: Likewise. * gdb.arch/powerpc-altivec.s: Likewise. * gdb.arch/powerpc-altivec2.exp: Likewise. * gdb.arch/powerpc-altivec2.s: Likewise. * gdb.arch/powerpc-altivec3.exp: Likewise. * gdb.arch/powerpc-altivec3.s: Likewise. * gdb.arch/powerpc-power7.exp: Likewise. * gdb.arch/powerpc-power7.s: Likewise. * gdb.arch/powerpc-power8.exp: Likewise. * gdb.arch/powerpc-power8.s: Likewise. * gdb.arch/powerpc-power9.exp: Likewise. * gdb.arch/powerpc-power9.s: Likewise. * gdb.arch/powerpc-vsx.exp: Likewise. * gdb.arch/powerpc-vsx.s: Likewise. * gdb.arch/powerpc-vsx2.exp: Likewise. * gdb.arch/powerpc-vsx2.s: Likewise. * gdb.arch/powerpc-vsx3.exp: Likewise. * gdb.arch/powerpc-vsx3.s: Likewise. * gdb.arch/arm-disassembler-options.exp: Likewise. * gdb.arch/powerpc-disassembler-options.exp: Likewise. * gdb.arch/s390-disassembler-options.exp: Likewise.
2017-02-28 19:32:07 +01:00
/* This testcase is part of GDB, the GNU debugger.
Copyright 2014-2017 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/>. */
.text
.globl func
func:
.long 0x7d0aa499 /* lxsdx vs40,r10,r20 */
.long 0x7d0aa699 /* lxvd2x vs40,r10,r20 */
.long 0x7d0aa299 /* lxvdsx vs40,r10,r20 */
.long 0x7d0aa619 /* lxvw4x vs40,r10,r20 */
.long 0x7d0aa599 /* stxsdx vs40,r10,r20 */
.long 0x7d0aa799 /* stxvd2x vs40,r10,r20 */
.long 0x7d0aa719 /* stxvw4x vs40,r10,r20 */
.long 0xf100e567 /* xsabsdp vs40,vs60 */
.long 0xf112e107 /* xsadddp vs40,vs50,vs60 */
.long 0xf092e15e /* xscmpodp cr1,vs50,vs60 */
.long 0xf092e11e /* xscmpudp cr1,vs50,vs60 */
.long 0xf112e587 /* xscpsgndp vs40,vs50,vs60 */
.long 0xf100e427 /* xscvdpsp vs40,vs60 */
.long 0xf100e563 /* xscvdpsxds vs40,vs60 */
.long 0xf100e163 /* xscvdpsxws vs40,vs60 */
.long 0xf100e523 /* xscvdpuxds vs40,vs60 */
.long 0xf100e123 /* xscvdpuxws vs40,vs60 */
.long 0xf100e527 /* xscvspdp vs40,vs60 */
.long 0xf100e5e3 /* xscvsxddp vs40,vs60 */
.long 0xf100e5a3 /* xscvuxddp vs40,vs60 */
.long 0xf112e1c7 /* xsdivdp vs40,vs50,vs60 */
.long 0xf112e10f /* xsmaddadp vs40,vs50,vs60 */
.long 0xf112e14f /* xsmaddmdp vs40,vs50,vs60 */
.long 0xf112e507 /* xsmaxdp vs40,vs50,vs60 */
.long 0xf112e547 /* xsmindp vs40,vs50,vs60 */
.long 0xf112e18f /* xsmsubadp vs40,vs50,vs60 */
.long 0xf112e1cf /* xsmsubmdp vs40,vs50,vs60 */
.long 0xf112e187 /* xsmuldp vs40,vs50,vs60 */
.long 0xf100e5a7 /* xsnabsdp vs40,vs60 */
.long 0xf100e5e7 /* xsnegdp vs40,vs60 */
.long 0xf112e50f /* xsnmaddadp vs40,vs50,vs60 */
.long 0xf112e54f /* xsnmaddmdp vs40,vs50,vs60 */
.long 0xf112e58f /* xsnmsubadp vs40,vs50,vs60 */
.long 0xf112e5cf /* xsnmsubmdp vs40,vs50,vs60 */
.long 0xf100e127 /* xsrdpi vs40,vs60 */
.long 0xf100e1af /* xsrdpic vs40,vs60 */
.long 0xf100e1e7 /* xsrdpim vs40,vs60 */
.long 0xf100e1a7 /* xsrdpip vs40,vs60 */
.long 0xf100e167 /* xsrdpiz vs40,vs60 */
.long 0xf100e16b /* xsredp vs40,vs60 */
.long 0xf100e12b /* xsrsqrtedp vs40,vs60 */
.long 0xf100e12f /* xssqrtdp vs40,vs60 */
.long 0xf112e147 /* xssubdp vs40,vs50,vs60 */
.long 0xf092e1ee /* xstdivdp cr1,vs50,vs60 */
.long 0xf080e1aa /* xstsqrtdp cr1,vs60 */
.long 0xf100e767 /* xvabsdp vs40,vs60 */
.long 0xf100e667 /* xvabssp vs40,vs60 */
.long 0xf112e307 /* xvadddp vs40,vs50,vs60 */
.long 0xf112e207 /* xvaddsp vs40,vs50,vs60 */
.long 0xf112e31f /* xvcmpeqdp vs40,vs50,vs60 */
.long 0xf112e71f /* xvcmpeqdp. vs40,vs50,vs60 */
.long 0xf112e21f /* xvcmpeqsp vs40,vs50,vs60 */
.long 0xf112e61f /* xvcmpeqsp. vs40,vs50,vs60 */
.long 0xf112e39f /* xvcmpgedp vs40,vs50,vs60 */
.long 0xf112e79f /* xvcmpgedp. vs40,vs50,vs60 */
.long 0xf112e29f /* xvcmpgesp vs40,vs50,vs60 */
.long 0xf112e69f /* xvcmpgesp. vs40,vs50,vs60 */
.long 0xf112e35f /* xvcmpgtdp vs40,vs50,vs60 */
.long 0xf112e75f /* xvcmpgtdp. vs40,vs50,vs60 */
.long 0xf112e25f /* xvcmpgtsp vs40,vs50,vs60 */
.long 0xf112e65f /* xvcmpgtsp. vs40,vs50,vs60 */
.long 0xf112e787 /* xvcpsgndp vs40,vs50,vs60 */
.long 0xf11ce787 /* xvmovdp vs40,vs60 */
.long 0xf11ce787 /* xvmovdp vs40,vs60 */
.long 0xf112e687 /* xvcpsgnsp vs40,vs50,vs60 */
.long 0xf11ce687 /* xvmovsp vs40,vs60 */
.long 0xf11ce687 /* xvmovsp vs40,vs60 */
.long 0xf100e627 /* xvcvdpsp vs40,vs60 */
.long 0xf100e763 /* xvcvdpsxds vs40,vs60 */
.long 0xf100e363 /* xvcvdpsxws vs40,vs60 */
.long 0xf100e723 /* xvcvdpuxds vs40,vs60 */
.long 0xf100e323 /* xvcvdpuxws vs40,vs60 */
.long 0xf100e727 /* xvcvspdp vs40,vs60 */
.long 0xf100e663 /* xvcvspsxds vs40,vs60 */
.long 0xf100e263 /* xvcvspsxws vs40,vs60 */
.long 0xf100e623 /* xvcvspuxds vs40,vs60 */
.long 0xf100e223 /* xvcvspuxws vs40,vs60 */
.long 0xf100e7e3 /* xvcvsxddp vs40,vs60 */
.long 0xf100e6e3 /* xvcvsxdsp vs40,vs60 */
.long 0xf100e3e3 /* xvcvsxwdp vs40,vs60 */
.long 0xf100e2e3 /* xvcvsxwsp vs40,vs60 */
.long 0xf100e7a3 /* xvcvuxddp vs40,vs60 */
.long 0xf100e6a3 /* xvcvuxdsp vs40,vs60 */
.long 0xf100e3a3 /* xvcvuxwdp vs40,vs60 */
.long 0xf100e2a3 /* xvcvuxwsp vs40,vs60 */
.long 0xf112e3c7 /* xvdivdp vs40,vs50,vs60 */
.long 0xf112e2c7 /* xvdivsp vs40,vs50,vs60 */
.long 0xf112e30f /* xvmaddadp vs40,vs50,vs60 */
.long 0xf112e34f /* xvmaddmdp vs40,vs50,vs60 */
.long 0xf112e20f /* xvmaddasp vs40,vs50,vs60 */
.long 0xf112e24f /* xvmaddmsp vs40,vs50,vs60 */
.long 0xf112e707 /* xvmaxdp vs40,vs50,vs60 */
.long 0xf112e607 /* xvmaxsp vs40,vs50,vs60 */
.long 0xf112e747 /* xvmindp vs40,vs50,vs60 */
.long 0xf112e647 /* xvminsp vs40,vs50,vs60 */
.long 0xf112e38f /* xvmsubadp vs40,vs50,vs60 */
.long 0xf112e3cf /* xvmsubmdp vs40,vs50,vs60 */
.long 0xf112e28f /* xvmsubasp vs40,vs50,vs60 */
.long 0xf112e2cf /* xvmsubmsp vs40,vs50,vs60 */
.long 0xf112e387 /* xvmuldp vs40,vs50,vs60 */
.long 0xf112e287 /* xvmulsp vs40,vs50,vs60 */
.long 0xf100e7a7 /* xvnabsdp vs40,vs60 */
.long 0xf100e6a7 /* xvnabssp vs40,vs60 */
.long 0xf100e7e7 /* xvnegdp vs40,vs60 */
.long 0xf100e6e7 /* xvnegsp vs40,vs60 */
.long 0xf112e70f /* xvnmaddadp vs40,vs50,vs60 */
.long 0xf112e74f /* xvnmaddmdp vs40,vs50,vs60 */
.long 0xf112e60f /* xvnmaddasp vs40,vs50,vs60 */
.long 0xf112e64f /* xvnmaddmsp vs40,vs50,vs60 */
.long 0xf112e78f /* xvnmsubadp vs40,vs50,vs60 */
.long 0xf112e7cf /* xvnmsubmdp vs40,vs50,vs60 */
.long 0xf112e68f /* xvnmsubasp vs40,vs50,vs60 */
.long 0xf112e6cf /* xvnmsubmsp vs40,vs50,vs60 */
.long 0xf100e327 /* xvrdpi vs40,vs60 */
.long 0xf100e3af /* xvrdpic vs40,vs60 */
.long 0xf100e3e7 /* xvrdpim vs40,vs60 */
.long 0xf100e3a7 /* xvrdpip vs40,vs60 */
.long 0xf100e367 /* xvrdpiz vs40,vs60 */
.long 0xf100e36b /* xvredp vs40,vs60 */
.long 0xf100e26b /* xvresp vs40,vs60 */
.long 0xf100e227 /* xvrspi vs40,vs60 */
.long 0xf100e2af /* xvrspic vs40,vs60 */
.long 0xf100e2e7 /* xvrspim vs40,vs60 */
.long 0xf100e2a7 /* xvrspip vs40,vs60 */
.long 0xf100e267 /* xvrspiz vs40,vs60 */
.long 0xf100e32b /* xvrsqrtedp vs40,vs60 */
.long 0xf100e22b /* xvrsqrtesp vs40,vs60 */
.long 0xf100e32f /* xvsqrtdp vs40,vs60 */
.long 0xf100e22f /* xvsqrtsp vs40,vs60 */
.long 0xf112e347 /* xvsubdp vs40,vs50,vs60 */
.long 0xf112e247 /* xvsubsp vs40,vs50,vs60 */
.long 0xf092e3ee /* xvtdivdp cr1,vs50,vs60 */
.long 0xf092e2ee /* xvtdivsp cr1,vs50,vs60 */
.long 0xf080e3aa /* xvtsqrtdp cr1,vs60 */
.long 0xf080e2aa /* xvtsqrtsp cr1,vs60 */
.long 0xf112e417 /* xxland vs40,vs50,vs60 */
.long 0xf112e457 /* xxlandc vs40,vs50,vs60 */
.long 0xf112e517 /* xxlnor vs40,vs50,vs60 */
.long 0xf112e497 /* xxlor vs40,vs50,vs60 */
.long 0xf112e4d7 /* xxlxor vs40,vs50,vs60 */
.long 0xf112e097 /* xxmrghw vs40,vs50,vs60 */
.long 0xf112e197 /* xxmrglw vs40,vs50,vs60 */
.long 0xf112e057 /* xxmrghd vs40,vs50,vs60 */
.long 0xf112e157 /* xxpermdi vs40,vs50,vs60,1 */
.long 0xf112e257 /* xxpermdi vs40,vs50,vs60,2 */
.long 0xf112e357 /* xxmrgld vs40,vs50,vs60 */
.long 0xf1129057 /* xxspltd vs40,vs50,0 */
.long 0xf1129057 /* xxspltd vs40,vs50,0 */
.long 0xf1129357 /* xxspltd vs40,vs50,1 */
.long 0xf1129357 /* xxspltd vs40,vs50,1 */
.long 0xf112e057 /* xxmrghd vs40,vs50,vs60 */
.long 0xf112e057 /* xxmrghd vs40,vs50,vs60 */
.long 0xf112e357 /* xxmrgld vs40,vs50,vs60 */
.long 0xf1129257 /* xxswapd vs40,vs50 */
.long 0xf1129257 /* xxswapd vs40,vs50 */
.long 0xf112e7bf /* xxsel vs40,vs50,vs60,vs62 */
.long 0xf112e217 /* xxsldwi vs40,vs50,vs60,2 */
.long 0xf102e293 /* xxspltw vs40,vs60,2 */
.long 0x7d00a699 /* lxvd2x vs40,0,r20 */
.long 0x7d0aa699 /* lxvd2x vs40,r10,r20 */
.long 0x7d00a799 /* stxvd2x vs40,0,r20 */
.long 0x7d0aa799 /* stxvd2x vs40,r10,r20 */