Samuel Thibault <[email protected]> writes:

> 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
Sure, I understand your point.  So lets keep $t0 as syscall number reg
for now. :)
-- 
Donjuanplatinum, Yifei Yao <[email protected]>
GPG: 1C9E EEE5 4C8E D5A8 3039  1C87 A9F6 8632 D259 40E6
满堂兮美人 忽独与余兮目成

Reply via email to