Skip to content

Commit

Permalink
Disable the Jitted Methods Counting Test When SSE(2) is Disabled (#94362
Browse files Browse the repository at this point in the history
)

* Disabled the Jitted Methods Counting Test when SSE2 is disabled.

* Added disabling condition to the JMCT when SSE is not enabled.
  • Loading branch information
ivdiazsa authored Nov 6, 2023
1 parent 5184067 commit 67114e2
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ public class JittedMethodsCountingTest
[Fact]
public static int TestEntryPoint()
{
// If either DOTNET_ReadyToRun or DOTNET_EnableHWIntrinsics are disabled
// (i.e. set to "0"), then this test ought to be skipped.
if (!IsReadyToRunEnabled() || !IsHardwareIntrinsicsEnabled())
// If either of DOTNET_ReadyToRun, DOTNET_EnableHWIntrinsics, or
// DOTNET_EnableSSE(2) are disabled (i.e. set to "0"), then this test
// ought to be skipped.
if (!IsReadyToRunEnabled() || !IsHardwareIntrinsicsEnabled() || !IsSSEEnabled())
{
Console.WriteLine("\nThis test is only supported in ReadyToRun scenarios"
+ " with Hardware Intrinsics enabled. Skipping...\n");
+ " with Hardware Intrinsics and SSE(2) enabled."
+ " Skipping...\n");
return 100;
}

Expand Down Expand Up @@ -48,4 +50,13 @@ private static bool IsHardwareIntrinsicsEnabled()
return (string.IsNullOrEmpty(dotnetEnableHWIntrinsics)
|| dotnetEnableHWIntrinsics != "0");
}

private static bool IsSSEEnabled()
{
string? dotnetSSE = Environment.GetEnvironmentVariable("DOTNET_EnableSSE");
string? dotnetSSE2 = Environment.GetEnvironmentVariable("DOTNET_EnableSSE2");

return ((string.IsNullOrEmpty(dotnetSSE) || dotnetSSE != "0")
&& (string.IsNullOrEmpty(dotnetSSE2) || dotnetSSE2 != "0"));
}
}

0 comments on commit 67114e2

Please sign in to comment.