@@ -57,23 +57,27 @@ enum CORINFO_InstructionSet
57
57
InstructionSet_Vector128=17 ,
58
58
InstructionSet_Vector256=18 ,
59
59
InstructionSet_AVXVNNI=19 ,
60
- InstructionSet_X86Base_X64=20 ,
61
- InstructionSet_SSE_X64=21 ,
62
- InstructionSet_SSE2_X64=22 ,
63
- InstructionSet_SSE3_X64=23 ,
64
- InstructionSet_SSSE3_X64=24 ,
65
- InstructionSet_SSE41_X64=25 ,
66
- InstructionSet_SSE42_X64=26 ,
67
- InstructionSet_AVX_X64=27 ,
68
- InstructionSet_AVX2_X64=28 ,
69
- InstructionSet_AES_X64=29 ,
70
- InstructionSet_BMI1_X64=30 ,
71
- InstructionSet_BMI2_X64=31 ,
72
- InstructionSet_FMA_X64=32 ,
73
- InstructionSet_LZCNT_X64=33 ,
74
- InstructionSet_PCLMULQDQ_X64=34 ,
75
- InstructionSet_POPCNT_X64=35 ,
76
- InstructionSet_AVXVNNI_X64=36 ,
60
+ InstructionSet_Sha1=20 ,
61
+ InstructionSet_Sha256=21 ,
62
+ InstructionSet_SHA=22 ,
63
+ InstructionSet_X86Base_X64=23 ,
64
+ InstructionSet_SSE_X64=24 ,
65
+ InstructionSet_SSE2_X64=25 ,
66
+ InstructionSet_SSE3_X64=26 ,
67
+ InstructionSet_SSSE3_X64=27 ,
68
+ InstructionSet_SSE41_X64=28 ,
69
+ InstructionSet_SSE42_X64=29 ,
70
+ InstructionSet_AVX_X64=30 ,
71
+ InstructionSet_AVX2_X64=31 ,
72
+ InstructionSet_AES_X64=32 ,
73
+ InstructionSet_BMI1_X64=33 ,
74
+ InstructionSet_BMI2_X64=34 ,
75
+ InstructionSet_FMA_X64=35 ,
76
+ InstructionSet_LZCNT_X64=36 ,
77
+ InstructionSet_PCLMULQDQ_X64=37 ,
78
+ InstructionSet_POPCNT_X64=38 ,
79
+ InstructionSet_AVXVNNI_X64=39 ,
80
+ InstructionSet_SHA_X64=40 ,
77
81
#endif // TARGET_AMD64
78
82
#ifdef TARGET_X86
79
83
InstructionSet_X86Base=1 ,
@@ -95,23 +99,27 @@ enum CORINFO_InstructionSet
95
99
InstructionSet_Vector128=17 ,
96
100
InstructionSet_Vector256=18 ,
97
101
InstructionSet_AVXVNNI=19 ,
98
- InstructionSet_X86Base_X64=20 ,
99
- InstructionSet_SSE_X64=21 ,
100
- InstructionSet_SSE2_X64=22 ,
101
- InstructionSet_SSE3_X64=23 ,
102
- InstructionSet_SSSE3_X64=24 ,
103
- InstructionSet_SSE41_X64=25 ,
104
- InstructionSet_SSE42_X64=26 ,
105
- InstructionSet_AVX_X64=27 ,
106
- InstructionSet_AVX2_X64=28 ,
107
- InstructionSet_AES_X64=29 ,
108
- InstructionSet_BMI1_X64=30 ,
109
- InstructionSet_BMI2_X64=31 ,
110
- InstructionSet_FMA_X64=32 ,
111
- InstructionSet_LZCNT_X64=33 ,
112
- InstructionSet_PCLMULQDQ_X64=34 ,
113
- InstructionSet_POPCNT_X64=35 ,
114
- InstructionSet_AVXVNNI_X64=36 ,
102
+ InstructionSet_Sha1=20 ,
103
+ InstructionSet_Sha256=21 ,
104
+ InstructionSet_SHA=22 ,
105
+ InstructionSet_X86Base_X64=23 ,
106
+ InstructionSet_SSE_X64=24 ,
107
+ InstructionSet_SSE2_X64=25 ,
108
+ InstructionSet_SSE3_X64=26 ,
109
+ InstructionSet_SSSE3_X64=27 ,
110
+ InstructionSet_SSE41_X64=28 ,
111
+ InstructionSet_SSE42_X64=29 ,
112
+ InstructionSet_AVX_X64=30 ,
113
+ InstructionSet_AVX2_X64=31 ,
114
+ InstructionSet_AES_X64=32 ,
115
+ InstructionSet_BMI1_X64=33 ,
116
+ InstructionSet_BMI2_X64=34 ,
117
+ InstructionSet_FMA_X64=35 ,
118
+ InstructionSet_LZCNT_X64=36 ,
119
+ InstructionSet_PCLMULQDQ_X64=37 ,
120
+ InstructionSet_POPCNT_X64=38 ,
121
+ InstructionSet_AVXVNNI_X64=39 ,
122
+ InstructionSet_SHA_X64=40 ,
115
123
#endif // TARGET_X86
116
124
117
125
};
@@ -211,6 +219,8 @@ struct CORINFO_InstructionSetFlags
211
219
AddInstructionSet (InstructionSet_POPCNT_X64);
212
220
if (HasInstructionSet (InstructionSet_AVXVNNI))
213
221
AddInstructionSet (InstructionSet_AVXVNNI_X64);
222
+ if (HasInstructionSet (InstructionSet_SHA))
223
+ AddInstructionSet (InstructionSet_SHA_X64);
214
224
#endif // TARGET_AMD64
215
225
#ifdef TARGET_X86
216
226
#endif // TARGET_X86
@@ -352,6 +362,10 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins
352
362
resultflags.RemoveInstructionSet (InstructionSet_AVXVNNI);
353
363
if (resultflags.HasInstructionSet (InstructionSet_AVXVNNI_X64) && !resultflags.HasInstructionSet (InstructionSet_AVXVNNI))
354
364
resultflags.RemoveInstructionSet (InstructionSet_AVXVNNI_X64);
365
+ if (resultflags.HasInstructionSet (InstructionSet_SHA) && !resultflags.HasInstructionSet (InstructionSet_SHA_X64))
366
+ resultflags.RemoveInstructionSet (InstructionSet_SHA);
367
+ if (resultflags.HasInstructionSet (InstructionSet_SHA_X64) && !resultflags.HasInstructionSet (InstructionSet_SHA))
368
+ resultflags.RemoveInstructionSet (InstructionSet_SHA_X64);
355
369
if (resultflags.HasInstructionSet (InstructionSet_SSE) && !resultflags.HasInstructionSet (InstructionSet_X86Base))
356
370
resultflags.RemoveInstructionSet (InstructionSet_SSE);
357
371
if (resultflags.HasInstructionSet (InstructionSet_SSE2) && !resultflags.HasInstructionSet (InstructionSet_SSE))
@@ -382,6 +396,10 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins
382
396
resultflags.RemoveInstructionSet (InstructionSet_POPCNT);
383
397
if (resultflags.HasInstructionSet (InstructionSet_Vector256) && !resultflags.HasInstructionSet (InstructionSet_AVX))
384
398
resultflags.RemoveInstructionSet (InstructionSet_Vector256);
399
+ if (resultflags.HasInstructionSet (InstructionSet_Sha1) && !resultflags.HasInstructionSet (InstructionSet_SHA))
400
+ resultflags.RemoveInstructionSet (InstructionSet_Sha1);
401
+ if (resultflags.HasInstructionSet (InstructionSet_Sha256) && !resultflags.HasInstructionSet (InstructionSet_SHA))
402
+ resultflags.RemoveInstructionSet (InstructionSet_Sha256);
385
403
#endif // TARGET_AMD64
386
404
#ifdef TARGET_X86
387
405
if (resultflags.HasInstructionSet (InstructionSet_SSE) && !resultflags.HasInstructionSet (InstructionSet_X86Base))
@@ -414,6 +432,10 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins
414
432
resultflags.RemoveInstructionSet (InstructionSet_POPCNT);
415
433
if (resultflags.HasInstructionSet (InstructionSet_Vector256) && !resultflags.HasInstructionSet (InstructionSet_AVX))
416
434
resultflags.RemoveInstructionSet (InstructionSet_Vector256);
435
+ if (resultflags.HasInstructionSet (InstructionSet_Sha1) && !resultflags.HasInstructionSet (InstructionSet_SHA))
436
+ resultflags.RemoveInstructionSet (InstructionSet_Sha1);
437
+ if (resultflags.HasInstructionSet (InstructionSet_Sha256) && !resultflags.HasInstructionSet (InstructionSet_SHA))
438
+ resultflags.RemoveInstructionSet (InstructionSet_Sha256);
417
439
#endif // TARGET_X86
418
440
419
441
} while (!oldflags.Equals (resultflags));
@@ -544,6 +566,14 @@ inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet)
544
566
return " AVXVNNI" ;
545
567
case InstructionSet_AVXVNNI_X64 :
546
568
return " AVXVNNI_X64" ;
569
+ case InstructionSet_Sha1 :
570
+ return " Sha1" ;
571
+ case InstructionSet_Sha256 :
572
+ return " Sha256" ;
573
+ case InstructionSet_SHA :
574
+ return " SHA" ;
575
+ case InstructionSet_SHA_X64 :
576
+ return " SHA_X64" ;
547
577
#endif // TARGET_AMD64
548
578
#ifdef TARGET_X86
549
579
case InstructionSet_X86Base :
@@ -584,6 +614,12 @@ inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet)
584
614
return " Vector256" ;
585
615
case InstructionSet_AVXVNNI :
586
616
return " AVXVNNI" ;
617
+ case InstructionSet_Sha1 :
618
+ return " Sha1" ;
619
+ case InstructionSet_Sha256 :
620
+ return " Sha256" ;
621
+ case InstructionSet_SHA :
622
+ return " SHA" ;
587
623
#endif // TARGET_X86
588
624
589
625
default :
@@ -632,6 +668,7 @@ inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInst
632
668
case READYTORUN_INSTRUCTION_Pclmulqdq: return InstructionSet_PCLMULQDQ;
633
669
case READYTORUN_INSTRUCTION_Popcnt: return InstructionSet_POPCNT;
634
670
case READYTORUN_INSTRUCTION_AvxVnni: return InstructionSet_AVXVNNI;
671
+ case READYTORUN_INSTRUCTION_Sha: return InstructionSet_SHA;
635
672
#endif // TARGET_AMD64
636
673
#ifdef TARGET_X86
637
674
case READYTORUN_INSTRUCTION_X86Base: return InstructionSet_X86Base;
@@ -651,6 +688,7 @@ inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInst
651
688
case READYTORUN_INSTRUCTION_Pclmulqdq: return InstructionSet_PCLMULQDQ;
652
689
case READYTORUN_INSTRUCTION_Popcnt: return InstructionSet_POPCNT;
653
690
case READYTORUN_INSTRUCTION_AvxVnni: return InstructionSet_AVXVNNI;
691
+ case READYTORUN_INSTRUCTION_Sha: return InstructionSet_SHA;
654
692
#endif // TARGET_X86
655
693
656
694
default :
0 commit comments