mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-03 14:21:30 +00:00
[mips] Fix passing of small structures for big-endian O32.
Summary: Like N32/N64, they must be passed in the upper bits of the register. The new code could be merged with the existing if-statements but I've refrained from doing this since it will make porting the O32 implementation to tablegen harder later. Reviewers: vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6463 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223148 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2267,6 +2267,9 @@ SDValue MipsTargetLowering::lowerFP_TO_SINT(SDValue Op,
|
||||
static bool CC_MipsO32(unsigned ValNo, MVT ValVT, MVT LocVT,
|
||||
CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
|
||||
CCState &State, const MCPhysReg *F64Regs) {
|
||||
const MipsSubtarget &Subtarget =
|
||||
State.getMachineFunction().getTarget()
|
||||
.getSubtarget<const MipsSubtarget>();
|
||||
|
||||
static const unsigned IntRegsSize = 4, FloatRegsSize = 2;
|
||||
|
||||
@@ -2277,6 +2280,19 @@ static bool CC_MipsO32(unsigned ValNo, MVT ValVT, MVT LocVT,
|
||||
if (ArgFlags.isByVal())
|
||||
return true;
|
||||
|
||||
// Promote i8 and i16
|
||||
if (ArgFlags.isInReg() && !Subtarget.isLittle()) {
|
||||
if (LocVT == MVT::i8 || LocVT == MVT::i16 || LocVT == MVT::i32) {
|
||||
LocVT = MVT::i32;
|
||||
if (ArgFlags.isSExt())
|
||||
LocInfo = CCValAssign::SExtUpper;
|
||||
else if (ArgFlags.isZExt())
|
||||
LocInfo = CCValAssign::ZExtUpper;
|
||||
else
|
||||
LocInfo = CCValAssign::AExtUpper;
|
||||
}
|
||||
}
|
||||
|
||||
// Promote i8 and i16
|
||||
if (LocVT == MVT::i8 || LocVT == MVT::i16) {
|
||||
LocVT = MVT::i32;
|
||||
|
||||
Reference in New Issue
Block a user