Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 36efe1f

Browse files
Merge pull request #6137 from papaslavik/int_softfp_fix
Fix for #5877: pre-spill just the floating arguments
2 parents 429139c + 3c2ac22 commit 36efe1f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/jit/lclvars.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
565565
// For ARM, ARM64, and AMD64 varargs, all arguments go in integer registers
566566
var_types argType = mangleVarArgsType(varDsc->TypeGet());
567567
var_types origArgType = argType;
568+
// ARM softfp calling convention should affect only the floating point arguments.
569+
// Otherwise there appear too many surplus pre-spills and other memory operations
570+
// with the associated locations .
571+
bool isSoftFPPreSpill = opts.compUseSoftFP && varTypeIsFloating(varDsc->TypeGet());
568572
unsigned argSize = eeGetArgSize(argLst, &info.compMethodInfo->args);
569573
unsigned cSlots = argSize / TARGET_POINTER_SIZE; // the total number of slots of this argument
570574
bool isHfaArg = false;
@@ -599,7 +603,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
599603
// But we pre-spill user arguments in varargs methods and structs.
600604
//
601605
unsigned cAlign;
602-
bool preSpill = info.compIsVarArgs || opts.compUseSoftFP;
606+
bool preSpill = info.compIsVarArgs || isSoftFPPreSpill;
603607

604608
switch (origArgType)
605609
{
@@ -929,7 +933,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
929933
#else // !FEATURE_UNIX_AMD64_STRUCT_PASSING
930934
compArgSize += argSize;
931935
#endif // !FEATURE_UNIX_AMD64_STRUCT_PASSING
932-
if (info.compIsVarArgs || isHfaArg || opts.compUseSoftFP)
936+
if (info.compIsVarArgs || isHfaArg || isSoftFPPreSpill)
933937
{
934938
#if defined(_TARGET_X86_)
935939
varDsc->lvStkOffs = compArgSize;

0 commit comments

Comments
 (0)