[llvm] Add Instruction selection support for x87 ld/st (PR #97016)
Evgenii Kudriashov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 05:42:43 PDT 2024
================
@@ -195,6 +195,14 @@ X86InstructionSelector::getRegClass(LLT Ty, const RegisterBank &RB) const {
return &X86::VR512RegClass;
}
+ if (RB.getID() == X86::PSRRegBankID) {
+ if (Ty.getSizeInBits() == 80)
+ return &X86::RFP80RegClass;
+ if (Ty.getSizeInBits() == 64)
+ return &X86::RFP64RegClass;
+ return &X86::RFP32RegClass;
----------------
e-kud wrote:
This is about whether it is guaranteed that type sizes of `PSRRegBankID` are limited by `32`, `64` and `80`. Or do we have to check on `32` as well to hit `llvm_unreachable` if something out of these three types comes.
I'm also thinking about whether it is better to rewrite this function to use switches instead of if/else...
https://github.com/llvm/llvm-project/pull/97016
More information about the llvm-commits
mailing list