Skip to content

Commit bbc4b45

Browse files
authored
add S390x architecture support (#1712)
1 parent 5d2160d commit bbc4b45

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/BenchmarkDotNet/Environments/Platform.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public enum Platform
3030
/// <summary>
3131
/// Wasm
3232
/// </summary>
33-
Wasm
33+
Wasm,
34+
35+
/// <summary>
36+
/// S390x
37+
/// </summary>
38+
S390x
3439
}
3540
}

src/BenchmarkDotNet/Extensions/ConfigurationExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public static string ToConfig(this Platform platform)
2020
return "ARM";
2121
case Platform.Arm64:
2222
return "ARM64";
23+
case Platform.S390x:
24+
return "S390x";
2325
default:
2426
return "AnyCPU";
2527
}

src/BenchmarkDotNet/Portability/RuntimeInformation.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ internal static Runtime GetCurrentRuntime()
233233

234234
public static Platform GetCurrentPlatform()
235235
{
236-
// it's not part of .NET Standard 2.0, so we use a hack
237-
// https://github.com/dotnet/runtime/blob/2c573b59aaaf3fd17e2ecab95ad3769f195d2dbc/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/Architecture.cs#L12
236+
// these are not part of .NET Standard 2.0, so we use a hack
237+
// https://github.com/dotnet/runtime/blob/d81ad044fa6830f5f31f6b6e8224ebf66a3c298c/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/Architecture.cs#L12-L13
238238
const Architecture Wasm = (Architecture)4;
239+
const Architecture S390x = (Architecture)5;
239240

240241
switch (ProcessArchitecture)
241242
{
@@ -249,6 +250,8 @@ public static Platform GetCurrentPlatform()
249250
return Platform.X86;
250251
case Wasm:
251252
return Platform.Wasm;
253+
case S390x:
254+
return Platform.S390x;
252255
default:
253256
throw new ArgumentOutOfRangeException();
254257
}

0 commit comments

Comments
 (0)