Skip to content

Commit 3872177

Browse files
committed
[Xtensa] Define register type for CC
Implement getRegisterTypeForCallingConv() method in XtensaTargetLowering
1 parent 2f4bf48 commit 3872177

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

llvm/lib/Target/Xtensa/XtensaISelLowering.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,16 @@ XtensaTargetLowering::XtensaTargetLowering(const TargetMachine &tm,
340340
computeRegisterProperties(STI.getRegisterInfo());
341341
}
342342

343+
/// Return the register type for a given MVT
344+
MVT XtensaTargetLowering::getRegisterTypeForCallingConv(LLVMContext &Context,
345+
CallingConv::ID CC,
346+
EVT VT) const {
347+
if (VT.isFloatingPoint())
348+
return MVT::i32;
349+
350+
return TargetLowering::getRegisterTypeForCallingConv(Context, CC, VT);
351+
}
352+
343353
/// If a physical register, this returns the register that receives the
344354
/// exception address on entry to an EH pad.
345355
Register XtensaTargetLowering::getExceptionPointerRegister(

llvm/lib/Target/Xtensa/XtensaISelLowering.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ class XtensaTargetLowering : public TargetLowering {
102102
return LHSTy.getSizeInBits() <= 32 ? MVT::i32 : MVT::i64;
103103
}
104104

105+
/// Return the register type for a given MVT
106+
MVT getRegisterTypeForCallingConv(LLVMContext &Context, CallingConv::ID CC,
107+
EVT VT) const override;
108+
105109
EVT getSetCCResultType(const DataLayout &, LLVMContext &,
106110
EVT VT) const override {
107111
if (!VT.isVector())

0 commit comments

Comments
 (0)