[PATCH 0/7] Assorted LoongArch fixes
Chenghua Xu
xuchenghua@loongson.cn
Tue Nov 16 03:32:51 GMT 2021
Hi Xuerui,
Sorry for delay.
Changing the opcode orders are fine for me, but please consider using
"macro" instruction instead of "sugar" in the comments.
Adding 'ret' macro instruction should be hold, Maybe we need start a
discussion on LoongArch Documents. By the way, I dislike it.
Changing .text start should be hold, we need find the reason why other
target use 0x10000.
Thanks.
On 10/25/21 11:11 AM, 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(-)
>
More information about the Binutils
mailing list