@@ -2364,122 +2364,119 @@ void Compiler::compSetProcessor()
2364
2364
#ifdef _TARGET_XARCH_
2365
2365
opts.compSupportsISA = 0 ;
2366
2366
2367
- if (!jitFlags.IsSet (JitFlags::JIT_FLAG_PREJIT))
2368
- {
2369
2367
#ifdef FEATURE_CORECLR
2370
- if (JitConfig.EnableHWIntrinsic ())
2368
+ if (JitConfig.EnableHWIntrinsic ())
2369
+ {
2370
+ opts.setSupportedISA (InstructionSet_Base);
2371
+
2372
+ if (JitConfig.EnableSSE ())
2371
2373
{
2372
- opts.setSupportedISA (InstructionSet_Base);
2374
+ opts.setSupportedISA (InstructionSet_SSE);
2375
+ #ifdef _TARGET_AMD64_
2376
+ opts.setSupportedISA (InstructionSet_SSE_X64);
2377
+ #endif // _TARGET_AMD64_
2373
2378
2374
- if (JitConfig.EnableSSE ())
2379
+ if (JitConfig.EnableSSE2 ())
2375
2380
{
2376
- opts.setSupportedISA (InstructionSet_SSE );
2381
+ opts.setSupportedISA (InstructionSet_SSE2 );
2377
2382
#ifdef _TARGET_AMD64_
2378
- opts.setSupportedISA (InstructionSet_SSE_X64 );
2383
+ opts.setSupportedISA (InstructionSet_SSE2_X64 );
2379
2384
#endif // _TARGET_AMD64_
2380
2385
2381
- if (JitConfig.EnableSSE2 ())
2386
+ if (jitFlags. IsSet (JitFlags::JIT_FLAG_USE_AES) && JitConfig.EnableAES ())
2382
2387
{
2383
- opts.setSupportedISA (InstructionSet_SSE2);
2384
- #ifdef _TARGET_AMD64_
2385
- opts.setSupportedISA (InstructionSet_SSE2_X64);
2386
- #endif // _TARGET_AMD64_
2388
+ opts.setSupportedISA (InstructionSet_AES);
2389
+ }
2387
2390
2388
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_AES ) && JitConfig.EnableAES ())
2389
- {
2390
- opts.setSupportedISA (InstructionSet_AES );
2391
- }
2391
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_PCLMULQDQ ) && JitConfig.EnablePCLMULQDQ ())
2392
+ {
2393
+ opts.setSupportedISA (InstructionSet_PCLMULQDQ );
2394
+ }
2392
2395
2393
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_PCLMULQDQ) && JitConfig.EnablePCLMULQDQ ())
2394
- {
2395
- opts.setSupportedISA (InstructionSet_PCLMULQDQ);
2396
- }
2396
+ // We need to additionaly check that COMPlus_EnableSSE3_4 is set, as that
2397
+ // is a prexisting config flag that controls the SSE3+ ISAs
2398
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSE3) && JitConfig.EnableSSE3 () && JitConfig.EnableSSE3_4 ())
2399
+ {
2400
+ opts.setSupportedISA (InstructionSet_SSE3);
2397
2401
2398
- // We need to additionaly check that COMPlus_EnableSSE3_4 is set, as that
2399
- // is a prexisting config flag that controls the SSE3+ ISAs
2400
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSE3) && JitConfig.EnableSSE3 () &&
2401
- JitConfig.EnableSSE3_4 ())
2402
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSSE3) && JitConfig.EnableSSSE3 ())
2402
2403
{
2403
- opts.setSupportedISA (InstructionSet_SSE3 );
2404
+ opts.setSupportedISA (InstructionSet_SSSE3 );
2404
2405
2405
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSSE3 ) && JitConfig.EnableSSSE3 ())
2406
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSE41 ) && JitConfig.EnableSSE41 ())
2406
2407
{
2407
- opts.setSupportedISA (InstructionSet_SSSE3);
2408
+ opts.setSupportedISA (InstructionSet_SSE41);
2409
+ #ifdef _TARGET_AMD64_
2410
+ opts.setSupportedISA (InstructionSet_SSE41_X64);
2411
+ #endif // _TARGET_AMD64_
2408
2412
2409
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSE41 ) && JitConfig.EnableSSE41 ())
2413
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSE42 ) && JitConfig.EnableSSE42 ())
2410
2414
{
2411
- opts.setSupportedISA (InstructionSet_SSE41 );
2415
+ opts.setSupportedISA (InstructionSet_SSE42 );
2412
2416
#ifdef _TARGET_AMD64_
2413
- opts.setSupportedISA (InstructionSet_SSE41_X64 );
2417
+ opts.setSupportedISA (InstructionSet_SSE42_X64 );
2414
2418
#endif // _TARGET_AMD64_
2415
2419
2416
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_SSE42 ) && JitConfig.EnableSSE42 ())
2420
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_POPCNT ) && JitConfig.EnablePOPCNT ())
2417
2421
{
2418
- opts.setSupportedISA (InstructionSet_SSE42 );
2422
+ opts.setSupportedISA (InstructionSet_POPCNT );
2419
2423
#ifdef _TARGET_AMD64_
2420
- opts.setSupportedISA (InstructionSet_SSE42_X64 );
2424
+ opts.setSupportedISA (InstructionSet_POPCNT_X64 );
2421
2425
#endif // _TARGET_AMD64_
2426
+ }
2427
+
2428
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_AVX) && JitConfig.EnableAVX ())
2429
+ {
2430
+ opts.setSupportedISA (InstructionSet_AVX);
2422
2431
2423
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_POPCNT ) && JitConfig.EnablePOPCNT ())
2432
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_FMA ) && JitConfig.EnableFMA ())
2424
2433
{
2425
- opts.setSupportedISA (InstructionSet_POPCNT);
2426
- #ifdef _TARGET_AMD64_
2427
- opts.setSupportedISA (InstructionSet_POPCNT_X64);
2428
- #endif // _TARGET_AMD64_
2434
+ opts.setSupportedISA (InstructionSet_FMA);
2429
2435
}
2430
2436
2431
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_AVX ) && JitConfig.EnableAVX ())
2437
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_AVX2 ) && JitConfig.EnableAVX2 ())
2432
2438
{
2433
- opts.setSupportedISA (InstructionSet_AVX);
2434
-
2435
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_FMA) && JitConfig.EnableFMA ())
2436
- {
2437
- opts.setSupportedISA (InstructionSet_FMA);
2438
- }
2439
-
2440
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_AVX2) && JitConfig.EnableAVX2 ())
2441
- {
2442
- opts.setSupportedISA (InstructionSet_AVX2);
2443
- }
2439
+ opts.setSupportedISA (InstructionSet_AVX2);
2444
2440
}
2445
2441
}
2446
2442
}
2447
2443
}
2448
2444
}
2449
2445
}
2450
2446
}
2447
+ }
2451
2448
2452
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_LZCNT) && JitConfig.EnableLZCNT ())
2453
- {
2454
- opts.setSupportedISA (InstructionSet_LZCNT);
2449
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_LZCNT) && JitConfig.EnableLZCNT ())
2450
+ {
2451
+ opts.setSupportedISA (InstructionSet_LZCNT);
2455
2452
#ifdef _TARGET_AMD64_
2456
- opts.setSupportedISA (InstructionSet_LZCNT_X64);
2453
+ opts.setSupportedISA (InstructionSet_LZCNT_X64);
2457
2454
#endif // _TARGET_AMD64_
2458
- }
2455
+ }
2459
2456
2460
- // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
2461
- // in the emitter.
2462
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_BMI1) && JitConfig.EnableBMI1 () &&
2463
- compSupports (InstructionSet_AVX))
2464
- {
2465
- opts.setSupportedISA (InstructionSet_BMI1);
2457
+ // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
2458
+ // in the emitter.
2459
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_BMI1) && JitConfig.EnableBMI1 () && compSupports (InstructionSet_AVX))
2460
+ {
2461
+ opts.setSupportedISA (InstructionSet_BMI1);
2466
2462
#ifdef _TARGET_AMD64_
2467
- opts.setSupportedISA (InstructionSet_BMI1_X64);
2463
+ opts.setSupportedISA (InstructionSet_BMI1_X64);
2468
2464
#endif // _TARGET_AMD64_
2469
- }
2465
+ }
2470
2466
2471
- // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
2472
- // in the emitter.
2473
- if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_BMI2) && JitConfig.EnableBMI2 () &&
2474
- compSupports (InstructionSet_AVX))
2475
- {
2476
- opts.setSupportedISA (InstructionSet_BMI2);
2467
+ // We currently need to also check that AVX is supported as that controls the support for the VEX encoding
2468
+ // in the emitter.
2469
+ if (jitFlags.IsSet (JitFlags::JIT_FLAG_USE_BMI2) && JitConfig.EnableBMI2 () && compSupports (InstructionSet_AVX))
2470
+ {
2471
+ opts.setSupportedISA (InstructionSet_BMI2);
2477
2472
#ifdef _TARGET_AMD64_
2478
- opts.setSupportedISA (InstructionSet_BMI2_X64);
2473
+ opts.setSupportedISA (InstructionSet_BMI2_X64);
2479
2474
#endif // _TARGET_AMD64_
2480
- }
2481
2475
}
2476
+ }
2482
2477
#else // !FEATURE_CORECLR
2478
+ if (!jitFlags.IsSet (JitFlags::JIT_FLAG_PREJIT))
2479
+ {
2483
2480
// If this is not FEATURE_CORECLR, the only flags supported by the VM are AVX and AVX2.
2484
2481
// Furthermore, the only two configurations supported by the desktop JIT are SSE2 and AVX2,
2485
2482
// so if the latter is set, we also check all the in-between options.
@@ -2501,8 +2498,8 @@ void Compiler::compSetProcessor()
2501
2498
opts.setSupportedISA (InstructionSet_AVX);
2502
2499
opts.setSupportedISA (InstructionSet_AVX2);
2503
2500
}
2504
- #endif // !FEATURE_CORECLR
2505
2501
}
2502
+ #endif // !FEATURE_CORECLR
2506
2503
2507
2504
if (!compIsForInlining ())
2508
2505
{
0 commit comments