@@ -557,6 +557,10 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
557
557
// For ARM, ARM64, and AMD64 varargs, all arguments go in integer registers
558
558
var_types argType = mangleVarArgsType (varDsc->TypeGet ());
559
559
var_types origArgType = argType;
560
+ // ARM softfp calling convention should affect only the floating point arguments.
561
+ // Otherwise there appear too many surplus pre-spills and other memory operations
562
+ // with the associated locations .
563
+ bool isSoftFPPreSpill = opts.compUseSoftFP && varTypeIsFloating (varDsc->TypeGet ());
560
564
unsigned argSize = eeGetArgSize (argLst, &info.compMethodInfo ->args );
561
565
unsigned cSlots = argSize / TARGET_POINTER_SIZE; // the total number of slots of this argument
562
566
bool isHfaArg = false ;
@@ -591,7 +595,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
591
595
// But we pre-spill user arguments in varargs methods and structs.
592
596
//
593
597
unsigned cAlign;
594
- bool preSpill = info.compIsVarArgs || opts. compUseSoftFP ;
598
+ bool preSpill = info.compIsVarArgs || isSoftFPPreSpill ;
595
599
596
600
switch (origArgType)
597
601
{
@@ -921,7 +925,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
921
925
#else // !FEATURE_UNIX_AMD64_STRUCT_PASSING
922
926
compArgSize += argSize;
923
927
#endif // !FEATURE_UNIX_AMD64_STRUCT_PASSING
924
- if (info.compIsVarArgs || isHfaArg || opts. compUseSoftFP )
928
+ if (info.compIsVarArgs || isHfaArg || isSoftFPPreSpill )
925
929
{
926
930
#if defined(_TARGET_X86_)
927
931
varDsc->lvStkOffs = compArgSize;
0 commit comments