@@ -565,6 +565,10 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
565
565
// For ARM, ARM64, and AMD64 varargs, all arguments go in integer registers
566
566
var_types argType = mangleVarArgsType (varDsc->TypeGet ());
567
567
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 ());
568
572
unsigned argSize = eeGetArgSize (argLst, &info.compMethodInfo ->args );
569
573
unsigned cSlots = argSize / TARGET_POINTER_SIZE; // the total number of slots of this argument
570
574
bool isHfaArg = false ;
@@ -599,7 +603,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
599
603
// But we pre-spill user arguments in varargs methods and structs.
600
604
//
601
605
unsigned cAlign;
602
- bool preSpill = info.compIsVarArgs || opts. compUseSoftFP ;
606
+ bool preSpill = info.compIsVarArgs || isSoftFPPreSpill ;
603
607
604
608
switch (origArgType)
605
609
{
@@ -929,7 +933,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
929
933
#else // !FEATURE_UNIX_AMD64_STRUCT_PASSING
930
934
compArgSize += argSize;
931
935
#endif // !FEATURE_UNIX_AMD64_STRUCT_PASSING
932
- if (info.compIsVarArgs || isHfaArg || opts. compUseSoftFP )
936
+ if (info.compIsVarArgs || isHfaArg || isSoftFPPreSpill )
933
937
{
934
938
#if defined(_TARGET_X86_)
935
939
varDsc->lvStkOffs = compArgSize;
0 commit comments