[PATCH] LoongArch: Add fcsr register names support
mengqinggang
mengqinggang@loongson.cn
Wed Jun 14 08:39:38 GMT 2023
I think forbid r4-r31 is a safer choice.
To prevent the use of general registers (r0-r3) in the future, a warning
message can be output.
在 2023/6/14 下午3:28, Feiyang Chen 写道:
> On Wed, Jun 14, 2023 at 3:07 PM mengqinggang <mengqinggang@loongson.cn> wrote:
>> Because there are only fcsr0-fcsr3, whether fc_htab just append r0-r3?
>>
>> Any general register bigger than r3 is invalid?
>>
> I believe this is a good approach, similar to what LLVM appears to do.
> However, I'm not certain if there might be some code intentionally
> using r4, as the manual doesn't explicitly forbid its usage, only
> stating that doing so would result in undefined outcomes.
>
>> 在 2023/6/12 下午4:36, Feiyang Chen 写道:
>>> + /* Add general purpose registers for backward compatibility. */
>>> + for (i = 0; i < ARRAY_SIZE (loongarch_r_normal_name); i++)
>>> + str_hash_insert (fc_htab, loongarch_r_normal_name[i], (void *) (i + 1),
>>> + 0);
More information about the Binutils
mailing list