On Thu, 2022-08-18 at 11:54 +0800, Lulu Cheng wrote:
> Sorry, I have already added the code of cmodel=extreme, and I am sorting out 
> the code and test cases.
> I still insist on using __attribute__(model(extreme)) to describe the 
> variables of precpu.
> I will send my patch today.

Ok, I can live with it.

A possible enhancement (we can add it later or abandon it if it won't
really produce any benefit):

The address of a per-CPU variable is

    per_cpu_buf_addr + cpu_offset + var_offset

Or, B + C + V as an abbreviation.  Currently we have $r21 = C, and the
faked address of per-cpu symbol is (B + V).  As (B + V) is large, we
have to use five (PC-rel) or four (Absolute) instructions to address it.

But in the future we can make $r21 = B + C, and the faked address V.  As
V <= 2GiB we can add model(low) and use a lu12i/addi pair to address V.

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to