[v5,0/6] LoongArch: colored disassembly and readability tweaks

Message ID 20230628115103.3440262-1-i.swmail@xen0n.name
Headers
Series LoongArch: colored disassembly and readability tweaks |

Message

WANG Xuerui June 28, 2023, 11:50 a.m. UTC
  From: WANG Xuerui <git@xen0n.name>

Hi,

This series implements colored output for LoongArch disassembly, and
some minor tweaks to the output so there is less clutter.

The 4th revision was sent back in February but at that time the Loongson
maintainers were busy with linker relaxation support; now that the work
was done let's try upstreaming this series again, hopefully for
inclusion in binutils 2.41.

Changes from v4:

- Rebased (mainly test case changes)

Changes from v3:

- Fixed ld test cases (make check-gas and make check-ld both pass on
  x86_64 and loongarch64)
- Branch target address is now correctly printed in comment style, plus
  code simplification as suggested

Changes from v2:

- Fixed test cases
- Added the fixed "LoongArch: support disassembling certain pseudo-
  instructions" patch into this series
- Fixed ".insn" in the last patch to say ".word" instead (MIPS muscle
  memory strikes back hard)
- Fixed some commit messages
- Added mengqinggang to Cc list

WANG Xuerui (6):
  LoongArch: support disassembling certain pseudo-instructions
  opcodes/loongarch: remove unused code
  opcodes/loongarch: implement style support in the disassembler
  opcodes/loongarch: style disassembled address offsets as such
  opcodes/loongarch: do not print hex notation for signed immediates
  opcodes/loongarch: print unrecognized insn words with the .word
    directive

 gas/config/tc-loongarch.c                     |   3 +-
 gas/testsuite/gas/loongarch/imm_ins.d         |  84 ++++++-------
 gas/testsuite/gas/loongarch/imm_ins_32.d      |  54 ++++-----
 gas/testsuite/gas/loongarch/imm_op.d          |  44 +++----
 gas/testsuite/gas/loongarch/jmp_op.d          |  44 +++----
 gas/testsuite/gas/loongarch/li.d              |   8 +-
 gas/testsuite/gas/loongarch/load_store_op.d   |  80 ++++++------
 gas/testsuite/gas/loongarch/macro_op.d        |   4 +-
 gas/testsuite/gas/loongarch/macro_op_32.d     |   4 +-
 .../gas/loongarch/macro_op_large_abs.d        |  12 +-
 .../gas/loongarch/macro_op_large_pc.d         |  12 +-
 gas/testsuite/gas/loongarch/nop.d             |   2 +-
 gas/testsuite/gas/loongarch/privilege_op.d    |   8 +-
 gas/testsuite/gas/loongarch/raw-insn.d        |  11 ++
 gas/testsuite/gas/loongarch/raw-insn.s        |   7 ++
 gas/testsuite/gas/loongarch/reloc.d           |   2 +-
 gas/testsuite/gas/loongarch/uleb128.d         |   2 +-
 include/opcode/loongarch.h                    |   7 +-
 ld/testsuite/ld-loongarch-elf/jmp_op.d        |  40 +++---
 ld/testsuite/ld-loongarch-elf/macro_op.d      |  24 ++--
 ld/testsuite/ld-loongarch-elf/macro_op_32.d   |   4 +-
 opcodes/disassemble.c                         |   5 +
 opcodes/loongarch-dis.c                       | 114 ++++++++----------
 opcodes/loongarch-opc.c                       |  73 ++++++-----
 24 files changed, 334 insertions(+), 314 deletions(-)
 create mode 100644 gas/testsuite/gas/loongarch/raw-insn.d
 create mode 100644 gas/testsuite/gas/loongarch/raw-insn.s
  

Comments

mengqinggang June 29, 2023, 1:39 a.m. UTC | #1
Hi,

According to previous communication,  whether needs  to add a sign-off if
your email not assign the copyright of the FSF for non-obvious patch.

Some references: https://sourceware.org/binutils/wiki/HowToContribute


在 2023/6/28 下午7:50, WANG Xuerui 写道:
> From: WANG Xuerui <git@xen0n.name>
>
> Hi,
>
> This series implements colored output for LoongArch disassembly, and
> some minor tweaks to the output so there is less clutter.
>
> The 4th revision was sent back in February but at that time the Loongson
> maintainers were busy with linker relaxation support; now that the work
> was done let's try upstreaming this series again, hopefully for
> inclusion in binutils 2.41.
>
> Changes from v4:
>
> - Rebased (mainly test case changes)
>
> Changes from v3:
>
> - Fixed ld test cases (make check-gas and make check-ld both pass on
>    x86_64 and loongarch64)
> - Branch target address is now correctly printed in comment style, plus
>    code simplification as suggested
>
> Changes from v2:
>
> - Fixed test cases
> - Added the fixed "LoongArch: support disassembling certain pseudo-
>    instructions" patch into this series
> - Fixed ".insn" in the last patch to say ".word" instead (MIPS muscle
>    memory strikes back hard)
> - Fixed some commit messages
> - Added mengqinggang to Cc list
>
> WANG Xuerui (6):
>    LoongArch: support disassembling certain pseudo-instructions
>    opcodes/loongarch: remove unused code
>    opcodes/loongarch: implement style support in the disassembler
>    opcodes/loongarch: style disassembled address offsets as such
>    opcodes/loongarch: do not print hex notation for signed immediates
>    opcodes/loongarch: print unrecognized insn words with the .word
>      directive
>
>   gas/config/tc-loongarch.c                     |   3 +-
>   gas/testsuite/gas/loongarch/imm_ins.d         |  84 ++++++-------
>   gas/testsuite/gas/loongarch/imm_ins_32.d      |  54 ++++-----
>   gas/testsuite/gas/loongarch/imm_op.d          |  44 +++----
>   gas/testsuite/gas/loongarch/jmp_op.d          |  44 +++----
>   gas/testsuite/gas/loongarch/li.d              |   8 +-
>   gas/testsuite/gas/loongarch/load_store_op.d   |  80 ++++++------
>   gas/testsuite/gas/loongarch/macro_op.d        |   4 +-
>   gas/testsuite/gas/loongarch/macro_op_32.d     |   4 +-
>   .../gas/loongarch/macro_op_large_abs.d        |  12 +-
>   .../gas/loongarch/macro_op_large_pc.d         |  12 +-
>   gas/testsuite/gas/loongarch/nop.d             |   2 +-
>   gas/testsuite/gas/loongarch/privilege_op.d    |   8 +-
>   gas/testsuite/gas/loongarch/raw-insn.d        |  11 ++
>   gas/testsuite/gas/loongarch/raw-insn.s        |   7 ++
>   gas/testsuite/gas/loongarch/reloc.d           |   2 +-
>   gas/testsuite/gas/loongarch/uleb128.d         |   2 +-
>   include/opcode/loongarch.h                    |   7 +-
>   ld/testsuite/ld-loongarch-elf/jmp_op.d        |  40 +++---
>   ld/testsuite/ld-loongarch-elf/macro_op.d      |  24 ++--
>   ld/testsuite/ld-loongarch-elf/macro_op_32.d   |   4 +-
>   opcodes/disassemble.c                         |   5 +
>   opcodes/loongarch-dis.c                       | 114 ++++++++----------
>   opcodes/loongarch-opc.c                       |  73 ++++++-----
>   24 files changed, 334 insertions(+), 314 deletions(-)
>   create mode 100644 gas/testsuite/gas/loongarch/raw-insn.d
>   create mode 100644 gas/testsuite/gas/loongarch/raw-insn.s
>
  
WANG Xuerui June 29, 2023, 3:29 a.m. UTC | #2
On 2023/6/29 09:39, mengqinggang wrote:
> Hi,
> 
> According to previous communication,  whether needs  to add a sign-off if
> your email not assign the copyright of the FSF for non-obvious patch.
> 
> Some references: https://sourceware.org/binutils/wiki/HowToContribute

Ah, okay. (I seem to never be able to find time for such paperwork.) 
I'll send v6 anyway because the another deprecation patch I sent 
yesterday will need its test case adjusted after this series gets in.)

> 
> 
> 在 2023/6/28 下午7:50, WANG Xuerui 写道:
>> From: WANG Xuerui <git@xen0n.name>
>>
>> Hi,
>>
>> This series implements colored output for LoongArch disassembly, and
>> some minor tweaks to the output so there is less clutter.
>>
>> The 4th revision was sent back in February but at that time the Loongson
>> maintainers were busy with linker relaxation support; now that the work
>> was done let's try upstreaming this series again, hopefully for
>> inclusion in binutils 2.41.
>>
>> Changes from v4:
>>
>> - Rebased (mainly test case changes)
>>
>> Changes from v3:
>>
>> - Fixed ld test cases (make check-gas and make check-ld both pass on
>>    x86_64 and loongarch64)
>> - Branch target address is now correctly printed in comment style, plus
>>    code simplification as suggested
>>
>> Changes from v2:
>>
>> - Fixed test cases
>> - Added the fixed "LoongArch: support disassembling certain pseudo-
>>    instructions" patch into this series
>> - Fixed ".insn" in the last patch to say ".word" instead (MIPS muscle
>>    memory strikes back hard)
>> - Fixed some commit messages
>> - Added mengqinggang to Cc list
>>
>> WANG Xuerui (6):
>>    LoongArch: support disassembling certain pseudo-instructions
>>    opcodes/loongarch: remove unused code
>>    opcodes/loongarch: implement style support in the disassembler
>>    opcodes/loongarch: style disassembled address offsets as such
>>    opcodes/loongarch: do not print hex notation for signed immediates
>>    opcodes/loongarch: print unrecognized insn words with the .word
>>      directive
>>
>>   gas/config/tc-loongarch.c                     |   3 +-
>>   gas/testsuite/gas/loongarch/imm_ins.d         |  84 ++++++-------
>>   gas/testsuite/gas/loongarch/imm_ins_32.d      |  54 ++++-----
>>   gas/testsuite/gas/loongarch/imm_op.d          |  44 +++----
>>   gas/testsuite/gas/loongarch/jmp_op.d          |  44 +++----
>>   gas/testsuite/gas/loongarch/li.d              |   8 +-
>>   gas/testsuite/gas/loongarch/load_store_op.d   |  80 ++++++------
>>   gas/testsuite/gas/loongarch/macro_op.d        |   4 +-
>>   gas/testsuite/gas/loongarch/macro_op_32.d     |   4 +-
>>   .../gas/loongarch/macro_op_large_abs.d        |  12 +-
>>   .../gas/loongarch/macro_op_large_pc.d         |  12 +-
>>   gas/testsuite/gas/loongarch/nop.d             |   2 +-
>>   gas/testsuite/gas/loongarch/privilege_op.d    |   8 +-
>>   gas/testsuite/gas/loongarch/raw-insn.d        |  11 ++
>>   gas/testsuite/gas/loongarch/raw-insn.s        |   7 ++
>>   gas/testsuite/gas/loongarch/reloc.d           |   2 +-
>>   gas/testsuite/gas/loongarch/uleb128.d         |   2 +-
>>   include/opcode/loongarch.h                    |   7 +-
>>   ld/testsuite/ld-loongarch-elf/jmp_op.d        |  40 +++---
>>   ld/testsuite/ld-loongarch-elf/macro_op.d      |  24 ++--
>>   ld/testsuite/ld-loongarch-elf/macro_op_32.d   |   4 +-
>>   opcodes/disassemble.c                         |   5 +
>>   opcodes/loongarch-dis.c                       | 114 ++++++++----------
>>   opcodes/loongarch-opc.c                       |  73 ++++++-----
>>   24 files changed, 334 insertions(+), 314 deletions(-)
>>   create mode 100644 gas/testsuite/gas/loongarch/raw-insn.d
>>   create mode 100644 gas/testsuite/gas/loongarch/raw-insn.s
>>
>