[PATCH] LoongArch: Add fcsr register names support
Feiyang Chen
chris.chenfeiyang@gmail.com
Wed Jun 14 09:27:51 GMT 2023
On Wed, Jun 14, 2023 at 4:39 PM mengqinggang <mengqinggang@loongson.cn> wrote:
>
> 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.
>
I agree with you. I will send v2 later.
>
> 在 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