Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-04 Thread Xi Ruoyao via Gcc-patches
On Sun, 2022-09-04 at 00:38 -0700, Fangrui Song wrote: > On Sun, Sep 4, 2022 at 12:00 AM Lulu Cheng > wrote: > > I have thought about this problem. For example, there is no '%plt' > > in > > aarch64, but I think it can be added and easily distinguished at the > > assembly code level, > > > > so

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-04 Thread Fangrui Song via Gcc-patches
On Sun, Sep 4, 2022 at 12:00 AM Lulu Cheng wrote: > > > 在 2022/9/4 下午2:35, Xi Ruoyao 写道: > > On Sun, 2022-09-04 at 11:22 +0800, Lulu Cheng wrote: > >> 在 2022/9/4 上午10:51, Xi Ruoyao 写道: > >> > >>> On Sun, 2022-09-04 at 10:26 +0800, Lulu Cheng wrote: > >>> > If the above modifications are not a

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-04 Thread Lulu Cheng
在 2022/9/4 下午2:35, Xi Ruoyao 写道: On Sun, 2022-09-04 at 11:22 +0800, Lulu Cheng wrote: 在 2022/9/4 上午10:51, Xi Ruoyao 写道: On Sun, 2022-09-04 at 10:26 +0800, Lulu Cheng wrote: If the above modifications are not added, the function call is:  bl %plt(test1) now is :  bl test1 Regardin

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-03 Thread Xi Ruoyao via Gcc-patches
On Sun, 2022-09-04 at 11:22 +0800, Lulu Cheng wrote: > > 在 2022/9/4 上午10:51, Xi Ruoyao 写道: >   > > On Sun, 2022-09-04 at 10:26 +0800, Lulu Cheng wrote: > >   > > > If the above modifications are not added, the function call is: > > > > > >  bl %plt(test1) > > > > > > now is : > > > > > >  bl te

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-03 Thread Lulu Cheng
在 2022/9/4 上午10:51, Xi Ruoyao 写道: On Sun, 2022-09-04 at 10:26 +0800, Lulu Cheng wrote: If the above modifications are not added, the function call is:  bl %plt(test1) now is :  bl test1 Regarding "%plt(...)", in the binutils code: /* For compatible old asm code. */ if (0 == str

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-03 Thread Xi Ruoyao via Gcc-patches
On Sun, 2022-09-04 at 10:26 +0800, Lulu Cheng wrote: > If the above modifications are not added, the function call is: > >  bl %plt(test1) > > now is : > >  bl test1 Regarding "%plt(...)", in the binutils code: /* For compatible old asm code. */ if (0 == strcmp (op_c_str, "plt")) b

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-03 Thread Lulu Cheng
I think the following modification should be added: git diff loongarch/predicates.md +;; Do not use GOT to access external symbols, when define +;; TARGET_DIRECT_EXTERN_ACCESS. +  (define_predicate "is_const_call_local_symbol"    (and (match_operand 0 "const_call_insn_operand")     (ior (mat

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-03 Thread Fangrui Song via Gcc-patches
On Fri, Sep 2, 2022 at 4:31 AM Xi Ruoyao via Gcc-patches wrote: > > On Thu, 2022-09-01 at 18:54 +0800, Xi Ruoyao wrote: > > We'd like to introduce a new codegen option to align with the old > > "-Wa,-mla-global-with-pcrel" and avoid a performance & size regression > > building the Linux kernel wit

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-02 Thread Xi Ruoyao via Gcc-patches
On Thu, 2022-09-01 at 18:54 +0800, Xi Ruoyao wrote: > We'd like to introduce a new codegen option to align with the old > "-Wa,-mla-global-with-pcrel" and avoid a performance & size regression > building the Linux kernel with new-reloc toolchain.  And it should be > also useful for building statica

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-01 Thread Xi Ruoyao via Gcc-patches
On Fri, 2022-09-02 at 11:12 +0800, Huacai Chen wrote: > On Thu, Sep 1, 2022 at 6:56 PM Xi Ruoyao wrote: > > > > We'd like to introduce a new codegen option to align with the old > > "-Wa,-mla-global-with-pcrel" and avoid a performance & size > > regression > > building the Linux kernel with new-r

Re: [PATCH] LoongArch: add -mdirect-extern-access option

2022-09-01 Thread Huacai Chen via Gcc-patches
Hi, Ruoyao, On Thu, Sep 1, 2022 at 6:56 PM Xi Ruoyao wrote: > > We'd like to introduce a new codegen option to align with the old > "-Wa,-mla-global-with-pcrel" and avoid a performance & size regression > building the Linux kernel with new-reloc toolchain. And it should be > also useful for buil

[PATCH] LoongArch: add -mdirect-extern-access option

2022-09-01 Thread Xi Ruoyao via Gcc-patches
We'd like to introduce a new codegen option to align with the old "-Wa,-mla-global-with-pcrel" and avoid a performance & size regression building the Linux kernel with new-reloc toolchain. And it should be also useful for building statically linked executables, firmwares (EDK2 for example), and ot