3
3
using System . IO ;
4
4
using System . Linq ;
5
5
using System . Text ;
6
+ using BenchmarkDotNet . ConsoleArguments ;
6
7
using BenchmarkDotNet . Environments ;
7
8
using BenchmarkDotNet . Extensions ;
9
+ using BenchmarkDotNet . Jobs ;
8
10
using BenchmarkDotNet . Loggers ;
9
11
using BenchmarkDotNet . Portability ;
10
12
using BenchmarkDotNet . Portability . Cpu ;
@@ -219,8 +221,20 @@ private string GetCurrentInstructionSet(Platform platform)
219
221
=> string . Join ( "," , GetCurrentProcessInstructionSets ( platform ) ) ;
220
222
221
223
// based on https://github.com/dotnet/runtime/blob/ce61c09a5f6fc71d8f717d3fc4562f42171869a0/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs#L727
222
- private static IEnumerable < string > GetCurrentProcessInstructionSets ( Platform platform )
224
+ private IEnumerable < string > GetCurrentProcessInstructionSets ( Platform platform )
223
225
{
226
+ if ( ! ConfigParser . TryParse ( TargetFrameworkMoniker , out RuntimeMoniker runtimeMoniker ) )
227
+ {
228
+ throw new NotSupportedException ( $ "Invalid TFM: '{ TargetFrameworkMoniker } '") ;
229
+ }
230
+
231
+ if ( platform == RuntimeInformation . GetCurrentPlatform ( ) // "native" does not support cross-compilation (so does BDN for now)
232
+ && runtimeMoniker >= RuntimeMoniker . NativeAot80 )
233
+ {
234
+ yield return "native" ; // added in .NET 8 https://github.com/dotnet/runtime/pull/87865
235
+ yield break ;
236
+ }
237
+
224
238
switch ( platform )
225
239
{
226
240
case Platform . X86 :
@@ -242,7 +256,7 @@ private static IEnumerable<string> GetCurrentProcessInstructionSets(Platform pla
242
256
if ( HardwareIntrinsics . IsX86PclmulqdqSupported ) yield return "pclmul" ;
243
257
if ( HardwareIntrinsics . IsX86PopcntSupported ) yield return "popcnt" ;
244
258
if ( HardwareIntrinsics . IsX86AvxVnniSupported ) yield return "avxvnni" ;
245
- if ( HardwareIntrinsics . IsX86SerializeSupported ) yield return "serialize" ;
259
+ if ( HardwareIntrinsics . IsX86SerializeSupported && runtimeMoniker > RuntimeMoniker . NativeAot70 ) yield return "serialize" ; // https://github.com/dotnet/BenchmarkDotNet/issues/2463#issuecomment-1809625008
246
260
break ;
247
261
case Platform . Arm64 :
248
262
if ( HardwareIntrinsics . IsArmBaseSupported ) yield return "base" ;
0 commit comments