opcodes: LoongArch: add "ret" instruction to reduce typing
authorWANG Xuerui <git@xen0n.name>
Wed, 27 Jul 2022 11:07:57 +0000 (19:07 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Mon, 1 Aug 2022 07:57:32 +0000 (15:57 +0800)
commit20f2e2686c79a5ac951f0cc283f385c16bda5d50
treef3a9565eb2351df9305505f103df549576db42d8
parent3f6e97039ec6f476b6fe09768f4b89722ffef10f
opcodes: LoongArch: add "ret" instruction to reduce typing

This syntactic sugar is present in both classical and emerging
architectures, like Alpha, SPARC and RISC-V, and assembler macros
doing the same thing can already be found in the wild e.g. [1], proving
the feature's popularity. It's better to provide support directly in the
assembler so downstream users wouldn't have to re-invent this over and
over again.

[1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/loongarch/sysdep.h;h=c586df819cd90;hb=HEAD#l28
gas/testsuite/gas/loongarch/jmp_op.d
gas/testsuite/gas/loongarch/jmp_op.s
ld/testsuite/ld-loongarch-elf/jmp_op.d
ld/testsuite/ld-loongarch-elf/jmp_op.s
opcodes/loongarch-opc.c