lkml.org 
[lkml]   [2023]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/5] LoongArch: Use la.pcrel instead of la.abs for exception handlers
From
Date


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.

\
 
 \ /
  Last update: 2023-03-27 00:25    [W:0.056 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site