From 50d2740d562edc68b2fbcacc0585c3acfc2c302f Mon Sep 17 00:00:00 2001 From: claziss Date: Tue, 21 Nov 2017 14:03:03 +0100 Subject: [PATCH] [ARC] Improve printing of pc-relative instructions. opcodes/ 2017-11-21 Claudiu Zissulescu * arc-dis.c (print_insn_arc): Pretty print pc-relative offsets. * arc-opc.c (SIMM21_A16_5): Make it pc-relative. gas/ 2017-11-21 Claudiu Zissulescu * testsuite/gas/arc/b.d : Update test. * testsuite/gas/arc/bl.d: Likewise. * testsuite/gas/arc/jli-1.d: Likewise. * testsuite/gas/arc/lp.d: Likewise. * testsuite/gas/arc/pcl-relocs.d: Likewise. * testsuite/gas/arc/pcrel-relocs.d: Likewise. * testsuite/gas/arc/pic-relocs.d: Likewise. * testsuite/gas/arc/plt-relocs.d: Likewise. * testsuite/gas/arc/pseudos.d: Likewise. * testsuite/gas/arc/relax-avoid2.d: Likewise. * testsuite/gas/arc/relax-avoid3.d: Likewise. * testsuite/gas/arc/relax-b.d: Likewise. * testsuite/gas/arc/tls-relocs.d: Likewise. * testsuite/gas/arc/relax-add01.d: Likewise. * testsuite/gas/arc/relax-add04.d: Likewise. * testsuite/gas/arc/relax-ld01.d: Likewise. * testsuite/gas/arc/relax-sub01.d: Likewise. * testsuite/gas/arc/relax-sub02.d: Likewise. * testsuite/gas/arc/relax-sub04.d: Likewise. * testsuite/gas/arc/pcl-print.s: New file. * testsuite/gas/arc/pcl-print.d: Likewise. * testsuite/gas/arc/nps400-12.d: Likewise. ld/ 2017-11-21 Claudiu Zissulescu * testsuite/ld-arc/jli-simple.d: Update test. --- gas/ChangeLog | 25 ++++++++++ gas/testsuite/gas/arc/b.d | 68 ++++++++++++++-------------- gas/testsuite/gas/arc/bl.d | 66 +++++++++++++-------------- gas/testsuite/gas/arc/jli-1.d | 2 +- gas/testsuite/gas/arc/lp.d | 56 +++++++++++------------ gas/testsuite/gas/arc/nps400-12.d | 6 +-- gas/testsuite/gas/arc/pcl-print.d | 8 ++++ gas/testsuite/gas/arc/pcl-print.s | 5 ++ gas/testsuite/gas/arc/pcl-relocs.d | 6 +-- gas/testsuite/gas/arc/pcrel-relocs.d | 10 ++-- gas/testsuite/gas/arc/pic-relocs.d | 4 +- gas/testsuite/gas/arc/plt-relocs.d | 10 ++-- gas/testsuite/gas/arc/pseudos.d | 56 +++++++++++------------ gas/testsuite/gas/arc/relax-add01.d | 2 +- gas/testsuite/gas/arc/relax-add04.d | 2 +- gas/testsuite/gas/arc/relax-avoid2.d | 2 +- gas/testsuite/gas/arc/relax-avoid3.d | 2 +- gas/testsuite/gas/arc/relax-b.d | 4 +- gas/testsuite/gas/arc/relax-ld01.d | 2 +- gas/testsuite/gas/arc/relax-sub01.d | 2 +- gas/testsuite/gas/arc/relax-sub02.d | 2 +- gas/testsuite/gas/arc/relax-sub04.d | 2 +- gas/testsuite/gas/arc/tls-relocs.d | 6 +-- ld/ChangeLog | 4 ++ ld/testsuite/ld-arc/jli-simple.dd | 4 +- opcodes/ChangeLog | 5 ++ opcodes/arc-dis.c | 62 ++++++++++++++++++------- opcodes/arc-opc.c | 2 +- 28 files changed, 251 insertions(+), 174 deletions(-) create mode 100644 gas/testsuite/gas/arc/pcl-print.d create mode 100644 gas/testsuite/gas/arc/pcl-print.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 24be5694f42..b60b7ea200a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,28 @@ +2017-11-21 Claudiu Zissulescu + + * testsuite/gas/arc/b.d : Update test. + * testsuite/gas/arc/bl.d: Likewise. + * testsuite/gas/arc/jli-1.d: Likewise. + * testsuite/gas/arc/lp.d: Likewise. + * testsuite/gas/arc/pcl-relocs.d: Likewise. + * testsuite/gas/arc/pcrel-relocs.d: Likewise. + * testsuite/gas/arc/pic-relocs.d: Likewise. + * testsuite/gas/arc/plt-relocs.d: Likewise. + * testsuite/gas/arc/pseudos.d: Likewise. + * testsuite/gas/arc/relax-avoid2.d: Likewise. + * testsuite/gas/arc/relax-avoid3.d: Likewise. + * testsuite/gas/arc/relax-b.d: Likewise. + * testsuite/gas/arc/tls-relocs.d: Likewise. + * testsuite/gas/arc/relax-add01.d: Likewise. + * testsuite/gas/arc/relax-add04.d: Likewise. + * testsuite/gas/arc/relax-ld01.d: Likewise. + * testsuite/gas/arc/relax-sub01.d: Likewise. + * testsuite/gas/arc/relax-sub02.d: Likewise. + * testsuite/gas/arc/relax-sub04.d: Likewise. + * testsuite/gas/arc/pcl-print.s: New file. + * testsuite/gas/arc/pcl-print.d: Likewise. + * testsuite/gas/arc/nps400-12.d: Likewise. + 2017-11-21 Alan Modra * config/tc-xtensa.c (finish_vinsn): Avoid multiple ngettext calls diff --git a/gas/testsuite/gas/arc/b.d b/gas/testsuite/gas/arc/b.d index 8f121cdad52..1addc7b3272 100644 --- a/gas/testsuite/gas/arc/b.d +++ b/gas/testsuite/gas/arc/b.d @@ -6,41 +6,41 @@ Disassembly of section .text: 00000000 : - 0: 0001 0000 b 0 - 4: 07fc ffc0 b -4 - 8: 07f8 ffc0 b -8 - c: 07f4 ffc1 beq -12 - 10: 07f0 ffc1 beq -16 - 14: 07ec ffc2 bne -20 - 18: 07e8 ffc2 bne -24 - 1c: 07e4 ffc3 bp -28 - 20: 07e0 ffc3 bp -32 - 24: 07dc ffc4 bn -36 - 28: 07d8 ffc4 bn -40 - 2c: 07d4 ffc5 bc -44 - 30: 07d0 ffc5 bc -48 - 34: 07cc ffc5 bc -52 - 38: 07c8 ffc6 bnc -56 - 3c: 07c4 ffc6 bnc -60 - 40: 07c0 ffc6 bnc -64 - 44: 07bc ffc7 bv -68 - 48: 07b8 ffc7 bv -72 - 4c: 07b4 ffc8 bnv -76 - 50: 07b0 ffc8 bnv -80 - 54: 07ac ffc9 bgt -84 - 58: 07a8 ffca bge -88 - 5c: 07a4 ffcb blt -92 - 60: 07a0 ffcc ble -96 - 64: 079c ffcd bhi -100 - 68: 0798 ffce bls -104 - 6c: 0794 ffcf bpnz -108 - 70: 0791 ffef b.d 0 + 0: 0001 0000 b 0 ;0 + 4: 07fc ffc0 b -4 ;0 + 8: 07f8 ffc0 b -8 ;0 + c: 07f4 ffc1 beq -12 ;0 + 10: 07f0 ffc1 beq -16 ;0 + 14: 07ec ffc2 bne -20 ;0 + 18: 07e8 ffc2 bne -24 ;0 + 1c: 07e4 ffc3 bp -28 ;0 + 20: 07e0 ffc3 bp -32 ;0 + 24: 07dc ffc4 bn -36 ;0 + 28: 07d8 ffc4 bn -40 ;0 + 2c: 07d4 ffc5 bc -44 ;0 + 30: 07d0 ffc5 bc -48 ;0 + 34: 07cc ffc5 bc -52 ;0 + 38: 07c8 ffc6 bnc -56 ;0 + 3c: 07c4 ffc6 bnc -60 ;0 + 40: 07c0 ffc6 bnc -64 ;0 + 44: 07bc ffc7 bv -68 ;0 + 48: 07b8 ffc7 bv -72 ;0 + 4c: 07b4 ffc8 bnv -76 ;0 + 50: 07b0 ffc8 bnv -80 ;0 + 54: 07ac ffc9 bgt -84 ;0 + 58: 07a8 ffca bge -88 ;0 + 5c: 07a4 ffcb blt -92 ;0 + 60: 07a0 ffcc ble -96 ;0 + 64: 079c ffcd bhi -100 ;0 + 68: 0798 ffce bls -104 ;0 + 6c: 0794 ffcf bpnz -108 ;0 + 70: 0791 ffef b.d -112 ;0 74: 264a 7000 nop - 78: 0789 ffcf b 0 - 7c: 0785 ffef b.d 0 + 78: 0789 ffcf b -120 ;0 + 7c: 0785 ffef b.d -124 ;0 80: 264a 7000 nop - 84: 077c ffe1 beq.d -132 + 84: 077c ffe1 beq.d -132 ;0 88: 264a 7000 nop - 8c: 0774 ffc2 bne -140 - 90: 0770 ffe6 bnc.d -144 + 8c: 0774 ffc2 bne -140 ;0 + 90: 0770 ffe6 bnc.d -144 ;0 94: 264a 7000 nop diff --git a/gas/testsuite/gas/arc/bl.d b/gas/testsuite/gas/arc/bl.d index 39672750479..615379cf25e 100644 --- a/gas/testsuite/gas/arc/bl.d +++ b/gas/testsuite/gas/arc/bl.d @@ -6,41 +6,41 @@ Disassembly of section .text: [0-9a-f]+ : - 0: 0802 0000 bl 0 - 4: 0ffc ffc0 bl 0 - 8: 0ff8 ffc0 bl 0 - c: 0ff4 ffc1 bleq 0 - 10: 0ff0 ffc1 bleq 0 - 14: 0fec ffc2 blne 0 - 18: 0fe8 ffc2 blne 0 - 1c: 0fe4 ffc3 blp 0 - 20: 0fe0 ffc3 blp 0 - 24: 0fdc ffc4 bln 0 - 28: 0fd8 ffc4 bln 0 - 2c: 0fd4 ffc5 blc 0 - 30: 0fd0 ffc5 blc 0 - 34: 0fcc ffc5 blc 0 - 38: 0fc8 ffc6 blnc 0 - 3c: 0fc4 ffc6 blnc 0 - 40: 0fc0 ffc6 blnc 0 - 44: 0fbc ffc7 blv 0 - 48: 0fb8 ffc7 blv 0 - 4c: 0fb4 ffc8 blnv 0 - 50: 0fb0 ffc8 blnv 0 - 54: 0fac ffc9 blgt 0 - 58: 0fa8 ffca blge 0 - 5c: 0fa4 ffcb bllt 0 - 60: 0fa0 ffcc blle 0 - 64: 0f9c ffcd blhi 0 - 68: 0f98 ffce blls 0 - 6c: 0f94 ffcf blpnz 0 - 70: 0f92 ffef bl.d 0 + 0: 0802 0000 bl 0 ;0 + 4: 0ffc ffc0 bl -4 ;0 + 8: 0ff8 ffc0 bl -8 ;0 + c: 0ff4 ffc1 bleq -12 ;0 + 10: 0ff0 ffc1 bleq -16 ;0 + 14: 0fec ffc2 blne -20 ;0 + 18: 0fe8 ffc2 blne -24 ;0 + 1c: 0fe4 ffc3 blp -28 ;0 + 20: 0fe0 ffc3 blp -32 ;0 + 24: 0fdc ffc4 bln -36 ;0 + 28: 0fd8 ffc4 bln -40 ;0 + 2c: 0fd4 ffc5 blc -44 ;0 + 30: 0fd0 ffc5 blc -48 ;0 + 34: 0fcc ffc5 blc -52 ;0 + 38: 0fc8 ffc6 blnc -56 ;0 + 3c: 0fc4 ffc6 blnc -60 ;0 + 40: 0fc0 ffc6 blnc -64 ;0 + 44: 0fbc ffc7 blv -68 ;0 + 48: 0fb8 ffc7 blv -72 ;0 + 4c: 0fb4 ffc8 blnv -76 ;0 + 50: 0fb0 ffc8 blnv -80 ;0 + 54: 0fac ffc9 blgt -84 ;0 + 58: 0fa8 ffca blge -88 ;0 + 5c: 0fa4 ffcb bllt -92 ;0 + 60: 0fa0 ffcc blle -96 ;0 + 64: 0f9c ffcd blhi -100 ;0 + 68: 0f98 ffce blls -104 ;0 + 6c: 0f94 ffcf blpnz -108 ;0 + 70: 0f92 ffef bl.d -112 ;0 74: 78e0 nop_s - 76: 0f8e ffcf bl 0 + 76: 0f8e ffcf bl -116 ;0 7a: 78e0 nop_s - 7c: 0f84 ffe1 bleq.d 0 + 7c: 0f84 ffe1 bleq.d -124 ;0 80: 78e0 nop_s - 82: 0f80 ffc2 blne 0 + 82: 0f80 ffc2 blne -128 ;0 86: 78e0 nop_s - 88: 0f78 ffe6 blnc.d 0 + 88: 0f78 ffe6 blnc.d -136 ;0 8c: 78e0 nop_s diff --git a/gas/testsuite/gas/arc/jli-1.d b/gas/testsuite/gas/arc/jli-1.d index 46587be1c92..2b2eba9219b 100644 --- a/gas/testsuite/gas/arc/jli-1.d +++ b/gas/testsuite/gas/arc/jli-1.d @@ -20,7 +20,7 @@ Disassembly of section .text: Disassembly of section .jlitab: 00000000 <__jli.foo>: - 0: 0001 0000 b 0 + 0: 0001 0000 b 0 ;0 0: R_ARC_S25H_PCREL foo #... diff --git a/gas/testsuite/gas/arc/lp.d b/gas/testsuite/gas/arc/lp.d index 50bfd4ac004..982126e9323 100644 --- a/gas/testsuite/gas/arc/lp.d +++ b/gas/testsuite/gas/arc/lp.d @@ -6,32 +6,32 @@ Disassembly of section .text: [0-9a-f]+ : - 0: 20a8 0e40 lp 72 - 4: 20e8 0de0 lp 72 - 8: 20e8 0d60 lp 72 - c: 20e8 0ce1 lpeq 72 - 10: 20e8 0c61 lpeq 72 - 14: 20e8 0be2 lpne 72 - 18: 20e8 0b62 lpne 72 - 1c: 20e8 0ae3 lpp 72 - 20: 20e8 0a63 lpp 72 - 24: 20e8 09e4 lpn 72 - 28: 20e8 0964 lpn 72 - 2c: 20e8 08e5 lpc 72 - 30: 20e8 0865 lpc 72 - 34: 20e8 07e5 lpc 72 - 38: 20e8 0766 lpnc 72 - 3c: 20e8 06e6 lpnc 72 - 40: 20e8 0666 lpnc 72 - 44: 20e8 05e7 lpv 72 - 48: 20e8 0567 lpv 72 - 4c: 20e8 04e8 lpnv 72 - 50: 20e8 0468 lpnv 72 - 54: 20e8 03e9 lpgt 72 - 58: 20e8 036a lpge 72 - 5c: 20e8 02eb lplt 72 - 60: 20e8 026c lple 72 - 64: 20e8 01ed lphi 72 - 68: 20e8 016e lpls 72 - 6c: 20e8 00ef lppnz 72 + 0: 20a8 0e40 lp 114 ;72 + 4: 20e8 0de0 lp 0x6e ;72 + 8: 20e8 0d60 lp 0x6a ;72 + c: 20e8 0ce1 lpeq 0x66 ;72 + 10: 20e8 0c61 lpeq 0x62 ;72 + 14: 20e8 0be2 lpne 0x5e ;72 + 18: 20e8 0b62 lpne 0x5a ;72 + 1c: 20e8 0ae3 lpp 0x56 ;72 + 20: 20e8 0a63 lpp 0x52 ;72 + 24: 20e8 09e4 lpn 0x4e ;72 + 28: 20e8 0964 lpn 0x4a ;72 + 2c: 20e8 08e5 lpc 0x46 ;72 + 30: 20e8 0865 lpc 0x42 ;72 + 34: 20e8 07e5 lpc 0x3e ;72 + 38: 20e8 0766 lpnc 0x3a ;72 + 3c: 20e8 06e6 lpnc 0x36 ;72 + 40: 20e8 0666 lpnc 0x32 ;72 + 44: 20e8 05e7 lpv 0x2e ;72 + 48: 20e8 0567 lpv 0x2a ;72 + 4c: 20e8 04e8 lpnv 0x26 ;72 + 50: 20e8 0468 lpnv 0x22 ;72 + 54: 20e8 03e9 lpgt 0x1e ;72 + 58: 20e8 036a lpge 0x1a ;72 + 5c: 20e8 02eb lplt 0x16 ;72 + 60: 20e8 026c lple 0x12 ;72 + 64: 20e8 01ed lphi 0xe ;72 + 68: 20e8 016e lpls 0xa ;72 + 6c: 20e8 00ef lppnz 0x6 ;72 70: 78e0 nop_s diff --git a/gas/testsuite/gas/arc/nps400-12.d b/gas/testsuite/gas/arc/nps400-12.d index 47e954ff238..a347d8efa06 100644 --- a/gas/testsuite/gas/arc/nps400-12.d +++ b/gas/testsuite/gas/arc/nps400-12.d @@ -54,6 +54,6 @@ Disassembly of section .text: 000000b4