From a680de9a980e9d268846e8605af14ba1e7f3a39b Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Wed, 11 Nov 2015 19:52:52 -0600 Subject: Add assembler, disassembler and linker support for power9. include/opcode/ * ppc.h (PPC_OPCODE_POWER9): New define. (PPC_OPCODE_VSX3): Likewise. opcodes/ * ppc-dis.c (ppc_opts): Add "power9" and "pwr9" entries. Add PPC_OPCODE_VSX3 to the vsx entry. (powerpc_init_dialect): Set default dialect to power9. * ppc-opc.c (insert_dcmxs, extract_dcmxs, insert_dxd, extract_dxd, insert_dxdn, extract_dxdn, insert_l0, extract_l0, insert_l1, extract_l1 insert_xtq6, extract_xtq6): New static functions. (insert_esync): Test for illegal L operand value. (DCMX, DCMXS, DXD, NDXD, L0, L1, RC, FC, UIM6, X_R, RIC, PRS, XSQ6, XTQ6, LRAND, IMM8, DQX, DQX_MASK, DX, DX_MASK, VXVAPS_MASK, VXVA,XVA, XX2VA, XVARC, XBF_MASK, XX2UIM4_MASK, XX2BFD_MASK, XX2DCMXS_MASK, XVA_MASK, XRLA_MASK, XBFRARB_MASK, XLRAND_MASK, POWER9, PPCVEC3, PPCVSX3): New defines. (powerpc_opcodes) : Use XBF_MASK. : Use XBFRARB_MASK. : New instructions. : Disable on POWER9. : Add additional operands. include/elf/ * ppc.h (R_PPC_REL16DX_HA): New reloction. * ppc64.h (R_PPC64_REL16DX_HA): Likewise. bfd/ * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_REL16DX_HA. (ppc_elf_reloc_type_lookup): Handle R_PPC_REL16DX_HA. (ppc_elf_addr16_ha_reloc): Likewise. (ppc_elf_check_relocs): Likewise. (ppc_elf_relocate_section): Likewise. (is_insn_dq_form): Handle lxv and stxv instructions. * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_REL16DX_HA. (ppc64_elf_reloc_type_lookup): Handle R_PPC64_REL16DX_HA. (ppc64_elf_ha_reloc): Likewise. (ppc64_elf_check_relocs): Likewise. (ppc64_elf_relocate_section): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Likewise. * reloc.c (BFD_RELOC_PPC_REL16DX_HA): New. elfcpp/ * powerpc.h (R_POWERPC_REL16DX_HA): Define. gas/ * doc/as.texinfo (Target PowerPC): Document -mpower9 and -mpwr9. * doc/c-ppc.texi (PowerPC-Opts): Likewise. * config/tc-ppc.c (md_show_usage): Likewise. (md_assemble): Handle BFD_RELOC_PPC_REL16DX_HA. (md_apply_fix): Likewise. (ppc_handle_align): Handle power9's group ending nop. gas/testsuite/ * gas/ppc/altivec3.s: New test. * gas/ppc/altivec3.d: Likewise. * gas/ppc/vsx3.s: Likewise. * gas/ppc/vsx3.d: Likewise. * gas/ppc/power9.s: Likewise. * gas/ppc/power9.d: Likewise. * gas/ppc/ppc.exp: Run them. * gas/ppc/power8.s : Add new tests. * gas/ppc/power8.d: Likewise. * gas/ppc/vsx.s: : Rename invalid mnemonics ... : ...to this. * gas/ppc/vsx.d: Likewise. gold/ * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function. (Powerpc_relocate_functions::addr16dx_ha): Likewise. (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA. (Target_powerpc::Scan::global): Likewise. (Target_powerpc::Relocate::relocate): Likewise. ld/testsuite/ * ld-powerpc/addpcis.d: New test. * ld-powerpc/addpcis.s: New test. * ld-powerpc/powerpc.exp: Run it. --- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-powerpc/addpcis.d | 20 ++++++++++++++++++++ ld/testsuite/ld-powerpc/addpcis.s | 12 ++++++++++++ ld/testsuite/ld-powerpc/powerpc.exp | 1 + 4 files changed, 40 insertions(+) create mode 100644 ld/testsuite/ld-powerpc/addpcis.d create mode 100644 ld/testsuite/ld-powerpc/addpcis.s (limited to 'ld') diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 47a6253..adb696f 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-11-11 Alan Modra + Peter Bergner + + * ld-powerpc/addpcis.d: New test. + * ld-powerpc/addpcis.s: New test. + * ld-powerpc/powerpc.exp: Run it. + 2015-11-03 Renlin Li * ld-aarch64/aarch64-elf.exp: Run newly added test cases. diff --git a/ld/testsuite/ld-powerpc/addpcis.d b/ld/testsuite/ld-powerpc/addpcis.d new file mode 100644 index 0000000..c0e2679 --- /dev/null +++ b/ld/testsuite/ld-powerpc/addpcis.d @@ -0,0 +1,20 @@ +#source: addpcis.s +#as: -a64 -mpower9 +#ld: -melf64ppc -Ttext=0x10000000 --defsym ext1=0 --defsym ext2=0x8fff0000 +#objdump: -d -Mpower9 + +.*: file format .* + +Disassembly of section \.text: + +0+10000000 <_start>: + 10000000: (4c 60 f0 04|04 f0 60 4c) addpcis r3,-4096 + 10000004: (38 63 ff fc|fc ff 63 38) addi r3,r3,-4 + 10000008: (4c 9f 7f c5|c5 7f 9f 4c) addpcis r4,32767 + 1000000c: (38 84 ff f4|f4 ff 84 38) addi r4,r4,-12 + 10000010: (4c a0 00 05|05 00 a0 4c) addpcis r5,1 + 10000014: (38 a5 80 00|00 80 a5 38) addi r5,r5,-32768 + \.\.\. + +0+10008014 : + 10008014: (60 00 00 00|00 00 00 60) nop diff --git a/ld/testsuite/ld-powerpc/addpcis.s b/ld/testsuite/ld-powerpc/addpcis.s new file mode 100644 index 0000000..d535e63 --- /dev/null +++ b/ld/testsuite/ld-powerpc/addpcis.s @@ -0,0 +1,12 @@ + .text + .global _start +_start: + addpcis 3,(ext1-0f)@ha +0: addi 3,3,(ext1-0b)@l + addpcis 4,(ext2-0f)@ha +0: addi 4,4,(ext2-0b)@l + addpcis 5,(forw-0f)@ha +0: addi 5,5,(forw-0b)@l + .space 32764 +forw: + nop diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index 4211063..efb4026 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -288,6 +288,7 @@ if [ supports_ppc64 ] then { run_dump_test "tocnovar" run_dump_test "tlsld" run_dump_test "relocsort" + run_dump_test "addpcis" } run_dump_test "tlsld32" -- cgit v1.1