Skip to content

Commit

Permalink
Fix Windows x86 testing (dotnet#100805)
Browse files Browse the repository at this point in the history
dotnet#100375 broke optimized Windows x86 runs.
  • Loading branch information
MichalStrehovsky authored and matouskozak committed Apr 30, 2024
1 parent cff5a20 commit 442970c
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 442970c

Please sign in to comment.