Skip to content

Commit

Permalink
Fix Windows x86 testing (#100805)
Browse files Browse the repository at this point in the history
#100375 broke optimized Windows x86 runs.
  • Loading branch information
MichalStrehovsky authored Apr 9, 2024
1 parent ae184d5 commit 129c6a7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,12 +1230,16 @@ private void ImportBinaryOperation(ILOpcode opcode)
break;
case ILOpcode.div:
case ILOpcode.div_un:
if (_compilation.TypeSystemContext.Target.Architecture == TargetArchitecture.ARM)
if (_compilation.TypeSystemContext.Target.Architecture is TargetArchitecture.ARM or TargetArchitecture.X86)
{
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.ULDiv), "_uldiv");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.LDiv), "_ldiv");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.UDiv), "_udiv");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.Div), "_div");

if (_compilation.TypeSystemContext.Target.Architecture is TargetArchitecture.ARM)
{
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.UDiv), "_udiv");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.Div), "_div");
}
}
else if (_compilation.TypeSystemContext.Target.Architecture == TargetArchitecture.ARM64)
{
Expand All @@ -1248,12 +1252,15 @@ private void ImportBinaryOperation(ILOpcode opcode)
break;
case ILOpcode.rem:
case ILOpcode.rem_un:
if (_compilation.TypeSystemContext.Target.Architecture == TargetArchitecture.ARM)
if (_compilation.TypeSystemContext.Target.Architecture is TargetArchitecture.ARM or TargetArchitecture.X86)
{
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.ULMod), "_ulmod");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.LMod), "_lmod");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.UMod), "_umod");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.Mod), "_mod");
if (_compilation.TypeSystemContext.Target.Architecture is TargetArchitecture.ARM)
{
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.UMod), "_umod");
_dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.Mod), "_mod");
}
}
else if (_compilation.TypeSystemContext.Target.Architecture == TargetArchitecture.ARM64)
{
Expand Down

0 comments on commit 129c6a7

Please sign in to comment.