Ben Shi via llvm-dev
2021-Aug-09 12:42 UTC
[llvm-dev] A question about support RV32E in the riscv target
Hello, Though the ABI / call-convention for rv32e has not be defined clear by the riscv organization. But besides that, is it possible to partial support it by adding target feature FeatureReserveX16---FeatureReserveX31 to the FeatureRV32E ? Just like def FeatureStdExtD : SubtargetFeature<"d", "HasStdExtD", "true", "'D' (Double-Precision Floating-Point)", [FeatureStdExtF]>; FeatureStdExtD implies FeatureStdExtF, we can make FeatureRV32E implies FeatureReserveX16---FeatureReserveX31 ? Is this a proper way to tell the register allocator do not use X16-X31 ? Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210809/23c7af78/attachment.html>
Craig Topper via llvm-dev
2021-Aug-09 23:03 UTC
[llvm-dev] A question about support RV32E in the riscv target
I would probably not do that. It creates a reverse relationship that can create unexpected surprises, for example passing "-mattr=-reserved-x31" would clear the RV32E feature. I would handle it in RISCVRegisterInfo::getReservedRegs or maybe RISCVSubtarget::isRegisterReservedByUser. I would use the latter if it is important that the other callers of isRegisterReservedByUser care about this. Though I think most of those generate an error which might not be what you want. ~Craig On Mon, Aug 9, 2021 at 5:43 AM Ben Shi via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hello, > > Though the ABI / call-convention for rv32e has not be defined clear by the > riscv organization. > > But besides that, is it possible to partial support it by adding target > feature FeatureReserveX16---FeatureReserveX31 to the FeatureRV32E ? > Just like > def FeatureStdExtD > : SubtargetFeature<"d", "HasStdExtD", "true", > "'D' (Double-Precision Floating-Point)", > [FeatureStdExtF]>; > > FeatureStdExtD implies FeatureStdExtF, we can make FeatureRV32E implies > FeatureReserveX16---FeatureReserveX31 ? > > Is this a proper way to tell the register allocator do not use X16-X31 ? > > Ben > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210809/b78b8a66/attachment.html>