[PATCH 0/7] Assorted LoongArch fixes

WANG Xuerui i.swmail@xen0n.name
Thu Nov 11 01:08:02 GMT 2021


On 10/25/21 11:11, WANG Xuerui wrote:

> From: WANG Xuerui <git@xen0n.name>
>
> Hi everyone,
>
> Here's some tweaks and fixes that pushes LoongArch a little closer to
> other architectures, to hopefully reduce learning costs for newcomers.
>
> - The ubiquitous "ret" instruction is added as syntactic sugar for
>    "jirl $zero, $ra, 0".
> - The starting address for .text is changed to 0x10000 which many other
>    architectures use; the previous value is inherited from MIPS with no
>    reason.
> - Syntax for jumps are slightly tweaked, primarily for making sure that
>    multiple register operands always come in LSB-first order, for
>    consistency.
>
> The patches have been brewing since August, and are used to build a
> whole Gentoo system without problem. I'll add support for disassembling
> known idioms (things like "andi $zero, $zero, 0" -> "nop") and syntactic
> sugars in a future series.
>
> WANG Xuerui (7):
>    opcodes: LoongArch: explicitly define b{lt/gt/le/ge}z as syntactic
>      sugars
>    opcodes: LoongArch: move definition of jr to sugar section
>    opcodes: LoongArch: sort loongarch_jmp_opcodes entries by opcodes
>    opcodes: LoongArch: make all non-native jumps desugar to canonical
>      b{gt/le}[u] forms
>    opcodes: LoongArch: add "ret" instruction to reduce typing
>    opcodes: LoongArch: make beq/bne's operand order "rd, rj" to be
>      consistent with all others
>    LoongArch: make .text start at 0x10000
>
>   ld/emulparams/elf64loongarch-defs.sh |  2 +-
>   opcodes/loongarch-opc.c              | 38 +++++++++++++---------------
>   2 files changed, 18 insertions(+), 22 deletions(-)
>
Friendly ping for review? I have several more patches waiting already, 
or I'll have to rebase instead.


More information about the Binutils mailing list