This is an archive of the discontinued LLVM Phabricator instance.

Allow fp as an alias of s0

Authored by fpallares on Mar 11 2019, 7:19 AM.



The RISC-V Assembly Programmer's Manual defines fp as another alias of x8. However, our tablegen rules only recognise s0. This patch adds fp as another alias of x8. GCC also accepts fp.

Diff Detail


Event Timeline

fpallares created this revision.Mar 11 2019, 7:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2019, 7:19 AM
asb added a comment.Mar 11 2019, 8:17 AM

Thanks, I'd missed the fp alias as I was going by the riscv-elf-psabi-doc primarily.

I think rvi-alternate-abi-names.s would be a better name for the test. You can then add a comment explaining that: fp is an alternate ABI name for s0 it should be accepted in input, but s0 should be printed in preference. This is of course the behaviour your patch demonstrates!

fpallares updated this revision to Diff 190109.Mar 11 2019, 9:40 AM

Thank you Alex. I've updated the test name and I've added a comment.
Hope it looks better now.

asb accepted this revision.Mar 11 2019, 2:00 PM

Looks good to me, thanks!

This revision is now accepted and ready to land.Mar 11 2019, 2:00 PM
This revision was automatically updated to reflect the committed changes.

Great, thank you for reviewing!