Re: [PATCH] LoongArch: gcc: Modify gas uleb128 support test.

2023-09-14 Thread mengqinggang
Thank you very much, we will send a new patch use this. 在 2023/9/14 下午8:09, Xi Ruoyao 写道: On Thu, 2023-09-14 at 19:54 +0800, chenglulu wrote: Sorry, it's my problem. We will modify it as soon as possible. Try this: diff --git a/gcc/configure.ac b/gcc/configure.ac index cb4be11facd..10027a4aa

[PATCH v2] Modify gas uleb128 support test

2023-09-14 Thread mengqinggang
Some assemblers (GNU as for LoongArch) generates relocations for leb128 symbol arithmetic for relaxation, we need to disable relaxation probing leb128 support then. gcc/ChangeLog: * configure: Regenerate. * configure.ac: Checking assembler for -mno-relax support. Disable relaxation wh

[PATCH] LoongArch: Fix lo_sum rtx cost

2023-09-16 Thread mengqinggang
The cost of lo_sum rtx for addi.d instruction my be a very big number if computed by common function. It may cause some symbols saving to stack and loading from stack if there no enough registers during loop optimization. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_rtx_costs

[PATCH v3] Modify gas uleb128 support test

2023-09-19 Thread mengqinggang
Some assemblers (GNU as for LoongArch) generates relocations for leb128 symbol arithmetic for relaxation, we need to disable relaxation probing leb128 support then. gcc/ChangeLog: * configure: Regenerate. * configure.ac: Checking assembler for -mno-relax support. Disable relaxation wh

[PATCH v2] LoongArch: Add support for TLS descriptors

2024-02-28 Thread mengqinggang
Generate la.tls.desc macro instruction for TLS descriptors model. la.tls.desc expand to pcalau12i $a0, %desc_pc_hi20(a) ld.d $a1, $a0, %desc_ld_pc_lo12(a) addi.d$a0, $a0, %desc_add_pc_lo12(a) jirl $ra, $a1, %desc_call(a) The default is TLS descriptors, but can be configure w

Re: [PATCH v2] LoongArch: Add support for TLS descriptors

2024-03-01 Thread mengqinggang
Thanks, I try to send a new version patch next week. 在 2024/2/29 下午2:08, Xi Ruoyao 写道: On Thu, 2024-02-29 at 09:42 +0800, mengqinggang wrote: Generate la.tls.desc macro instruction for TLS descriptors model. la.tls.desc expand to   pcalau12i $a0, %desc_pc_hi20(a)   ld.d  $a1, $a0

Re: [PATCH] LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme code model to allow the IE to LE linker relaxation

2024-03-06 Thread mengqinggang
Hi, Whether to add an option to control the generation of R_LARCH_RELAX, similar to as -mrelax/-mno-relax. 在 2024/2/29 下午3:11, Xi Ruoyao 写道: In Binutils we need to make IE to LE relaxation only allowed when there is an R_LARCH_RELAX after R_LARCH_TLE_IE_PC_{HI20,LO12} so an invalid "partial" r

Re: [PATCH] LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme code model to allow the IE to LE linker relaxation

2024-03-06 Thread mengqinggang
Hi, Thanks, this patch is LGTM. 在 2024/3/7 上午10:56, Xi Ruoyao 写道: On Thu, 2024-03-07 at 10:43 +0800, mengqinggang wrote: Hi, Whether to add an option to control the generation of R_LARCH_RELAX, similar to as -mrelax/-mno-relax. There are already -mrelax and -mno-relax, they can be checked

[PATCH v3] LoongArch: Add support for TLS descriptors.

2024-03-11 Thread mengqinggang
Add support for TLS descriptors on normal code model and extreme code model. Normal code model instruction sequence: -mno-explicit-relocs: la.tls.desc $r4, s add.d $r12, $r4, $r2 -mexplicit-relocs: pcalau12i $r4,%desc_pc_hi20(s) addi.d $r4,$r4,%desc_pc_lo12(s)

Re: [PATCH v3] LoongArch: Add support for TLS descriptors.

2024-03-11 Thread mengqinggang
The patch is here: https://sourceware.org/pipermail/gcc-patches/2024-March/647578.html, first email was blocked by the server. 在 2024/3/11 下午4:21, mengqinggang 写道: Add support for TLS descriptors on normal code model and extreme code model. Normal code model instruction sequence: -mno

[PATCH v4] LoongArch: Add support for TLS descriptors

2024-03-12 Thread mengqinggang
Add support for TLS descriptors on normal code model and extreme code model. Normal code model instruction sequence: -mno-explicit-relocs: la.tls.desc $r4, s add.d $r12, $r4, $r2 -mexplicit-relocs: pcalau12i $r4,%desc_pc_hi20(s) addi.d $r4,$r4,%desc_pc_lo12(s)

Re: [PATCH v4] LoongArch: Add support for TLS descriptors

2024-03-12 Thread mengqinggang
在 2024/3/13 上午6:15, Xi Ruoyao 写道: On Tue, 2024-03-12 at 17:20 +0800, mengqinggang wrote: +(define_insn "@got_load_tls_desc" +  [(set (match_operand:P 0 "register_operand" "=r") + (unspec:P +     [(match_operand:P 1 "symbolic_operan

[PATCH v5] LoongArch: Add support for TLS descriptors

2024-03-18 Thread mengqinggang
Add support for TLS descriptors on normal code model and extreme code model. Normal code model instruction sequence: -mno-explicit-relocs: la.tls.desc $r4, s add.d $r12, $r4, $r2 -mexplicit-relocs: pcalau12i $r4,%desc_pc_hi20(s) addi.d $r4,$r4,%desc_pc_lo12(s)

[PATCH] LoongArch: Add support for TLS descriptors

2023-12-01 Thread mengqinggang
Generate la.tls.desc macro instruction for TLS descriptors model. la.tls.desc expand to pcalau12i $a0, %desc_pc_hi20(a) ld.d $a1, $a0, %desc_ld_pc_lo12(a) addi.d$a0, $a0, %desc_add_pc_lo12(a) jirl $ra, $a1, %desc_call(a) The default is TLS descriptors, but can be configure w

Re: [PATCH] LoongArch: Add support for TLS descriptors

2023-12-01 Thread mengqinggang
This is mainly for the convenience of testing, and we will consider the issues you mentioned. 在 2023/12/1 下午6:01, Xi Ruoyao 写道: On Fri, 2023-12-01 at 17:55 +0800, mengqinggang wrote: Generate la.tls.desc macro instruction for TLS descriptors model. la.tls.desc expand to   pcalau12i $a0