Hello,

Donjuanplatinum, le mar. 01 déc. 2026 20:56:41 +0800, a ecrit:
> Sergey Bugaev <[email protected]> writes:
> 
> > On Tue, Dec 1, 2026 at 1:13 PM Donjuanplatinum <[email protected]> 
> > wrote:
> >> The concern with $t0 is that GCC/llvm and other toolschains may use it
> >> quite frequently for temp values and reg allocation
> >
> > And why is that an issue?
> >
> > You might want to ask the LoongArch engineer whether there is some
> > reason why using t0 on LoongArch64 should be more of a concern than x8
> > on AArch64 and rax on x86_64 (which are also used for temporaries). If
> > it's the same thing, then it shouldn't be a problem. But if there's
> > some important architectural reason why t0 should not be used for that
> > (an "unknown unknown" for me), then that's another thing.
> 
> My reasoning is that, while there may be some uncertainty about using
> $t0, we haven't identified similar concerns with $t8. Since they belong
> to the same class of temporary registers and have the same
> calling-convention properties, I think it makes sense to use $t8 for
> now.

Well, yes, but $t0 has the same concerns as $t8.

I'm not really buying the compiler argument: a compiler can use
something else, and since system calls are hidden behind a glibc stub
function, we don't have anything to optimize, the compiler cannot assume
that the function doesn't erase $t0.

Better stay simple :)

Samuel

Reply via email to