[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <295efdc0-388e-cda4-120c-5f9c4740b208@loongson.cn>
Date: Thu, 16 Feb 2023 16:03:10 +0800
From: Youling Tang <tangyouling@...ngson.cn>
To: Xi Ruoyao <xry111@...111.site>, Jinyang He <hejinyang@...ngson.cn>,
Huacai Chen <chenhuacai@...nel.org>
Cc: Xuerui Wang <kernel@...0n.name>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org, Xuefeng Li <lixuefeng@...ngson.cn>,
Jianmin lv <lvjianmin@...ngson.cn>,
Tiezhu Yang <yangtiezhu@...ngson.cn>
Subject: Re: [PATCH v4 2/5] LoongArch: Use la.pcrel instead of la.abs for
exception handlers
On 02/16/2023 03:10 PM, Xi Ruoyao wrote:
> On Thu, 2023-02-16 at 14:59 +0800, Jinyang He wrote:
>> +.macro la.abs reg, sym
>> +766:
>> + nop
>> + nop
>> + nop
>> + nop
>
> In the "formal" version we can code
>
> lu12i.w reg, 0
> ori reg, reg, 0
> lu32i.d reg, 0
> lu52i.d reg, reg, 0
>
> here. Then we only need to fixup the immediate slot so we can avoid
> using parse_r.
>
>
>> + .pushsection ".laabs", "aw", %progbits
>> +768:
>> + .word 768b-766b
>> + parse_r regno, \reg
>> + .word regno
>> + .dword \sym
>> + .popsection
>> +.endm
I will try to modify a version for testing, using the following
definition, when the RELOCATABLE is turned on, the "la.abs macro" is
used, otherwise the "la.abs pseudo instruction" is still used as before.
#ifdef CONFIG_RELOCATABLE
.macro la.abs reg, sym
lu12i.w reg, 0
ori reg, reg, 0
lu32i.d reg, 0
lu52i.d reg, reg, 0
.endm
#endif
Youling.
Powered by blists - more mailing lists