Skip to content

Commit 7054508

Browse files
jakobbotschpull[bot]
authored andcommitted
JIT: Use new ABI representation in fgMorphMultiregStructArg (#103856)
Some minor arm32 diffs expected from allowing float typed fields in the "stack" part of split args. Also an arm64 diff from isHfa(simd8) types being passed like doubles, so we may load them as doubles now.
1 parent f40f31c commit 7054508

File tree

3 files changed

+170
-185
lines changed

3 files changed

+170
-185
lines changed

src/coreclr/jit/abi.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,34 @@ bool ABIPassingInformation::IsSplitAcrossRegistersAndStack() const
353353
return false;
354354
}
355355

356+
//-----------------------------------------------------------------------------
357+
// CountRegsAndStackSlots:
358+
// Count how many registers and stack slots are used for passing the
359+
// argument.
360+
//
361+
// Return Value:
362+
// Count of registers plus count of stack slots.
363+
//
364+
unsigned ABIPassingInformation::CountRegsAndStackSlots() const
365+
{
366+
unsigned numSlots = 0;
367+
368+
for (unsigned i = 0; i < NumSegments; i++)
369+
{
370+
const ABIPassingSegment& seg = Segment(i);
371+
if (seg.IsPassedInRegister())
372+
{
373+
numSlots++;
374+
}
375+
else
376+
{
377+
numSlots += (seg.Size + TARGET_POINTER_SIZE - 1) / TARGET_POINTER_SIZE;
378+
}
379+
}
380+
381+
return numSlots;
382+
}
383+
356384
//-----------------------------------------------------------------------------
357385
// FromSegment:
358386
// Create ABIPassingInformation from a single segment.

src/coreclr/jit/abi.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ struct ABIPassingInformation
7474
const ABIPassingSegment& Segment(unsigned index) const;
7575
ABIPassingSegment& Segment(unsigned index);
7676

77-
bool HasAnyRegisterSegment() const;
78-
bool HasAnyFloatingRegisterSegment() const;
79-
bool HasAnyStackSegment() const;
80-
bool HasExactlyOneRegisterSegment() const;
81-
bool HasExactlyOneStackSegment() const;
82-
bool IsSplitAcrossRegistersAndStack() const;
77+
bool HasAnyRegisterSegment() const;
78+
bool HasAnyFloatingRegisterSegment() const;
79+
bool HasAnyStackSegment() const;
80+
bool HasExactlyOneRegisterSegment() const;
81+
bool HasExactlyOneStackSegment() const;
82+
bool IsSplitAcrossRegistersAndStack() const;
83+
unsigned CountRegsAndStackSlots() const;
8384

8485
static ABIPassingInformation FromSegment(Compiler* comp, const ABIPassingSegment& segment);
8586
static ABIPassingInformation FromSegments(Compiler* comp,

0 commit comments

Comments
 (0)