diff --git a/src/coreclr/inc/clrconfigvalues.h b/src/coreclr/inc/clrconfigvalues.h index 45674a77c35396..6427f717dee947 100644 --- a/src/coreclr/inc/clrconfigvalues.h +++ b/src/coreclr/inc/clrconfigvalues.h @@ -760,6 +760,7 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512F, W("EnableAVX512F RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512F_VL, W("EnableAVX512F_VL"), 1, "Allows AVX512F_VL+ hardware intrinsics to be disabled") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512VBMI, W("EnableAVX512VBMI"), 1, "Allows AVX512VBMI+ hardware intrinsics to be disabled") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512VBMI_VL, W("EnableAVX512VBMI_VL"), 1, "Allows AVX512VBMI_VL+ hardware intrinsics to be disabled") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX10v1, W("EnableAVX10v1"), 1, "Allows AVX10v1+ hardware intrinsics to be disabled") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVXVNNI, W("EnableAVXVNNI"), 1, "Allows AVXVNNI+ hardware intrinsics to be disabled") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableBMI1, W("EnableBMI1"), 1, "Allows BMI1+ hardware intrinsics to be disabled") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableBMI2, W("EnableBMI2"), 1, "Allows BMI2+ hardware intrinsics to be disabled") diff --git a/src/coreclr/inc/corinfoinstructionset.h b/src/coreclr/inc/corinfoinstructionset.h index e24bfab038ce0a..e3b57b6a1e043b 100644 --- a/src/coreclr/inc/corinfoinstructionset.h +++ b/src/coreclr/inc/corinfoinstructionset.h @@ -75,38 +75,44 @@ enum CORINFO_InstructionSet InstructionSet_AVX512DQ_VL=30, InstructionSet_AVX512VBMI=31, InstructionSet_AVX512VBMI_VL=32, - InstructionSet_VectorT128=33, - InstructionSet_VectorT256=34, - InstructionSet_VectorT512=35, - InstructionSet_X86Base_X64=36, - InstructionSet_SSE_X64=37, - InstructionSet_SSE2_X64=38, - InstructionSet_SSE3_X64=39, - InstructionSet_SSSE3_X64=40, - InstructionSet_SSE41_X64=41, - InstructionSet_SSE42_X64=42, - InstructionSet_AVX_X64=43, - InstructionSet_AVX2_X64=44, - InstructionSet_AES_X64=45, - InstructionSet_BMI1_X64=46, - InstructionSet_BMI2_X64=47, - InstructionSet_FMA_X64=48, - InstructionSet_LZCNT_X64=49, - InstructionSet_PCLMULQDQ_X64=50, - InstructionSet_POPCNT_X64=51, - InstructionSet_AVXVNNI_X64=52, - InstructionSet_MOVBE_X64=53, - InstructionSet_X86Serialize_X64=54, - InstructionSet_AVX512F_X64=55, - InstructionSet_AVX512F_VL_X64=56, - InstructionSet_AVX512BW_X64=57, - InstructionSet_AVX512BW_VL_X64=58, - InstructionSet_AVX512CD_X64=59, - InstructionSet_AVX512CD_VL_X64=60, - InstructionSet_AVX512DQ_X64=61, - InstructionSet_AVX512DQ_VL_X64=62, - InstructionSet_AVX512VBMI_X64=63, - InstructionSet_AVX512VBMI_VL_X64=64, + InstructionSet_AVX10v1=33, + InstructionSet_AVX10v1_V256=34, + InstructionSet_AVX10v1_V512=35, + InstructionSet_VectorT128=36, + InstructionSet_VectorT256=37, + InstructionSet_VectorT512=38, + InstructionSet_X86Base_X64=39, + InstructionSet_SSE_X64=40, + InstructionSet_SSE2_X64=41, + InstructionSet_SSE3_X64=42, + InstructionSet_SSSE3_X64=43, + InstructionSet_SSE41_X64=44, + InstructionSet_SSE42_X64=45, + InstructionSet_AVX_X64=46, + InstructionSet_AVX2_X64=47, + InstructionSet_AES_X64=48, + InstructionSet_BMI1_X64=49, + InstructionSet_BMI2_X64=50, + InstructionSet_FMA_X64=51, + InstructionSet_LZCNT_X64=52, + InstructionSet_PCLMULQDQ_X64=53, + InstructionSet_POPCNT_X64=54, + InstructionSet_AVXVNNI_X64=55, + InstructionSet_MOVBE_X64=56, + InstructionSet_X86Serialize_X64=57, + InstructionSet_AVX512F_X64=58, + InstructionSet_AVX512F_VL_X64=59, + InstructionSet_AVX512BW_X64=60, + InstructionSet_AVX512BW_VL_X64=61, + InstructionSet_AVX512CD_X64=62, + InstructionSet_AVX512CD_VL_X64=63, + InstructionSet_AVX512DQ_X64=64, + InstructionSet_AVX512DQ_VL_X64=65, + InstructionSet_AVX512VBMI_X64=66, + InstructionSet_AVX512VBMI_VL_X64=67, + InstructionSet_AVX10v1_X64=68, + InstructionSet_AVX10v1_V256_X64=69, + InstructionSet_AVX10v1_V512_X64=70, #endif // TARGET_AMD64 #ifdef TARGET_X86 InstructionSet_X86Base=1, @@ -141,38 +147,44 @@ enum CORINFO_InstructionSet InstructionSet_AVX512DQ_VL=30, InstructionSet_AVX512VBMI=31, InstructionSet_AVX512VBMI_VL=32, - InstructionSet_VectorT128=33, - InstructionSet_VectorT256=34, - InstructionSet_VectorT512=35, - InstructionSet_X86Base_X64=36, - InstructionSet_SSE_X64=37, - InstructionSet_SSE2_X64=38, - InstructionSet_SSE3_X64=39, - InstructionSet_SSSE3_X64=40, - InstructionSet_SSE41_X64=41, - InstructionSet_SSE42_X64=42, - InstructionSet_AVX_X64=43, - InstructionSet_AVX2_X64=44, - InstructionSet_AES_X64=45, - InstructionSet_BMI1_X64=46, - InstructionSet_BMI2_X64=47, - InstructionSet_FMA_X64=48, - InstructionSet_LZCNT_X64=49, - InstructionSet_PCLMULQDQ_X64=50, - InstructionSet_POPCNT_X64=51, - InstructionSet_AVXVNNI_X64=52, - InstructionSet_MOVBE_X64=53, - InstructionSet_X86Serialize_X64=54, - InstructionSet_AVX512F_X64=55, - InstructionSet_AVX512F_VL_X64=56, - InstructionSet_AVX512BW_X64=57, - InstructionSet_AVX512BW_VL_X64=58, - InstructionSet_AVX512CD_X64=59, - InstructionSet_AVX512CD_VL_X64=60, - InstructionSet_AVX512DQ_X64=61, - InstructionSet_AVX512DQ_VL_X64=62, - InstructionSet_AVX512VBMI_X64=63, - InstructionSet_AVX512VBMI_VL_X64=64, + InstructionSet_AVX10v1=33, + InstructionSet_AVX10v1_V256=34, + InstructionSet_AVX10v1_V512=35, + InstructionSet_VectorT128=36, + InstructionSet_VectorT256=37, + InstructionSet_VectorT512=38, + InstructionSet_X86Base_X64=39, + InstructionSet_SSE_X64=40, + InstructionSet_SSE2_X64=41, + InstructionSet_SSE3_X64=42, + InstructionSet_SSSE3_X64=43, + InstructionSet_SSE41_X64=44, + InstructionSet_SSE42_X64=45, + InstructionSet_AVX_X64=46, + InstructionSet_AVX2_X64=47, + InstructionSet_AES_X64=48, + InstructionSet_BMI1_X64=49, + InstructionSet_BMI2_X64=50, + InstructionSet_FMA_X64=51, + InstructionSet_LZCNT_X64=52, + InstructionSet_PCLMULQDQ_X64=53, + InstructionSet_POPCNT_X64=54, + InstructionSet_AVXVNNI_X64=55, + InstructionSet_MOVBE_X64=56, + InstructionSet_X86Serialize_X64=57, + InstructionSet_AVX512F_X64=58, + InstructionSet_AVX512F_VL_X64=59, + InstructionSet_AVX512BW_X64=60, + InstructionSet_AVX512BW_VL_X64=61, + InstructionSet_AVX512CD_X64=62, + InstructionSet_AVX512CD_VL_X64=63, + InstructionSet_AVX512DQ_X64=64, + InstructionSet_AVX512DQ_VL_X64=65, + InstructionSet_AVX512VBMI_X64=66, + InstructionSet_AVX512VBMI_VL_X64=67, + InstructionSet_AVX10v1_X64=68, + InstructionSet_AVX10v1_V256_X64=69, + InstructionSet_AVX10v1_V512_X64=70, #endif // TARGET_X86 }; @@ -346,6 +358,12 @@ struct CORINFO_InstructionSetFlags AddInstructionSet(InstructionSet_AVX512VBMI_X64); if (HasInstructionSet(InstructionSet_AVX512VBMI_VL)) AddInstructionSet(InstructionSet_AVX512VBMI_VL_X64); + if (HasInstructionSet(InstructionSet_AVX10v1)) + AddInstructionSet(InstructionSet_AVX10v1_X64); + if (HasInstructionSet(InstructionSet_AVX10v1_V256)) + AddInstructionSet(InstructionSet_AVX10v1_V256_X64); + if (HasInstructionSet(InstructionSet_AVX10v1_V512)) + AddInstructionSet(InstructionSet_AVX10v1_V512_X64); #endif // TARGET_AMD64 #ifdef TARGET_X86 #endif // TARGET_X86 @@ -542,6 +560,18 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins resultflags.RemoveInstructionSet(InstructionSet_AVX512VBMI_VL); if (resultflags.HasInstructionSet(InstructionSet_AVX512VBMI_VL_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512VBMI_VL)) resultflags.RemoveInstructionSet(InstructionSet_AVX512VBMI_VL_X64); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1_X64)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_X64); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256_X64)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V256_X64); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512_X64)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512_X64); if (resultflags.HasInstructionSet(InstructionSet_SSE) && !resultflags.HasInstructionSet(InstructionSet_X86Base)) resultflags.RemoveInstructionSet(InstructionSet_SSE); if (resultflags.HasInstructionSet(InstructionSet_SSE2) && !resultflags.HasInstructionSet(InstructionSet_SSE)) @@ -614,6 +644,34 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins resultflags.RemoveInstructionSet(InstructionSet_AVX512VBMI_VL); if (resultflags.HasInstructionSet(InstructionSet_AVX512VBMI_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL)) resultflags.RemoveInstructionSet(InstructionSet_AVX512VBMI_VL); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1) && !resultflags.HasInstructionSet(InstructionSet_AVX2)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1) && !resultflags.HasInstructionSet(InstructionSet_FMA)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512F)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512VBMI)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512VBMI_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); if (resultflags.HasInstructionSet(InstructionSet_VectorT128) && !resultflags.HasInstructionSet(InstructionSet_SSE2)) resultflags.RemoveInstructionSet(InstructionSet_VectorT128); if (resultflags.HasInstructionSet(InstructionSet_VectorT256) && !resultflags.HasInstructionSet(InstructionSet_AVX2)) @@ -700,6 +758,34 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins resultflags.RemoveInstructionSet(InstructionSet_AVX512VBMI_VL); if (resultflags.HasInstructionSet(InstructionSet_AVX512VBMI_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL)) resultflags.RemoveInstructionSet(InstructionSet_AVX512VBMI_VL); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1) && !resultflags.HasInstructionSet(InstructionSet_AVX2)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1) && !resultflags.HasInstructionSet(InstructionSet_FMA)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX10v1_V256)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512F)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512VBMI)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet_AVX10v1_V512) && !resultflags.HasInstructionSet(InstructionSet_AVX512VBMI_VL)) + resultflags.RemoveInstructionSet(InstructionSet_AVX10v1_V512); if (resultflags.HasInstructionSet(InstructionSet_VectorT128) && !resultflags.HasInstructionSet(InstructionSet_SSE2)) resultflags.RemoveInstructionSet(InstructionSet_VectorT128); if (resultflags.HasInstructionSet(InstructionSet_VectorT256) && !resultflags.HasInstructionSet(InstructionSet_AVX2)) @@ -902,6 +988,18 @@ inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet) return "AVX512VBMI_VL"; case InstructionSet_AVX512VBMI_VL_X64 : return "AVX512VBMI_VL_X64"; + case InstructionSet_AVX10v1 : + return "AVX10v1"; + case InstructionSet_AVX10v1_X64 : + return "AVX10v1_X64"; + case InstructionSet_AVX10v1_V256 : + return "AVX10v1_V256"; + case InstructionSet_AVX10v1_V256_X64 : + return "AVX10v1_V256_X64"; + case InstructionSet_AVX10v1_V512 : + return "AVX10v1_V512"; + case InstructionSet_AVX10v1_V512_X64 : + return "AVX10v1_V512_X64"; case InstructionSet_VectorT128 : return "VectorT128"; case InstructionSet_VectorT256 : @@ -974,6 +1072,12 @@ inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet) return "AVX512VBMI"; case InstructionSet_AVX512VBMI_VL : return "AVX512VBMI_VL"; + case InstructionSet_AVX10v1 : + return "AVX10v1"; + case InstructionSet_AVX10v1_V256 : + return "AVX10v1_V256"; + case InstructionSet_AVX10v1_V512 : + return "AVX10v1_V512"; case InstructionSet_VectorT128 : return "VectorT128"; case InstructionSet_VectorT256 : @@ -1044,6 +1148,9 @@ inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInst case READYTORUN_INSTRUCTION_Avx512DQ_VL: return InstructionSet_AVX512DQ_VL; case READYTORUN_INSTRUCTION_Avx512Vbmi: return InstructionSet_AVX512VBMI; case READYTORUN_INSTRUCTION_Avx512Vbmi_VL: return InstructionSet_AVX512VBMI_VL; + case READYTORUN_INSTRUCTION_Avx10v1: return InstructionSet_AVX10v1; + case READYTORUN_INSTRUCTION_Avx10v1_V256: return InstructionSet_AVX10v1_V256; + case READYTORUN_INSTRUCTION_Avx10v1_V512: return InstructionSet_AVX10v1_V512; case READYTORUN_INSTRUCTION_VectorT128: return InstructionSet_VectorT128; case READYTORUN_INSTRUCTION_VectorT256: return InstructionSet_VectorT256; case READYTORUN_INSTRUCTION_VectorT512: return InstructionSet_VectorT512; @@ -1078,6 +1185,9 @@ inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInst case READYTORUN_INSTRUCTION_Avx512DQ_VL: return InstructionSet_AVX512DQ_VL; case READYTORUN_INSTRUCTION_Avx512Vbmi: return InstructionSet_AVX512VBMI; case READYTORUN_INSTRUCTION_Avx512Vbmi_VL: return InstructionSet_AVX512VBMI_VL; + case READYTORUN_INSTRUCTION_Avx10v1: return InstructionSet_AVX10v1; + case READYTORUN_INSTRUCTION_Avx10v1_V256: return InstructionSet_AVX10v1_V256; + case READYTORUN_INSTRUCTION_Avx10v1_V512: return InstructionSet_AVX10v1_V512; case READYTORUN_INSTRUCTION_VectorT128: return InstructionSet_VectorT128; case READYTORUN_INSTRUCTION_VectorT256: return InstructionSet_VectorT256; case READYTORUN_INSTRUCTION_VectorT512: return InstructionSet_VectorT512; diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index e7d744d80bf517..0e9f6e2940bcb3 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID; #define GUID_DEFINED #endif // !GUID_DEFINED -constexpr GUID JITEEVersionIdentifier = { /* bdf34b26-0725-4ad6-9935-40bfd2a4c4fc */ - 0xbdf34b26, - 0x0725, - 0x4ad6, - {0x99, 0x35, 0x40, 0xbf, 0xd2, 0xa4, 0xc4, 0xfc} +constexpr GUID JITEEVersionIdentifier = { /* 3c216494-65f8-49e2-b69a-7f272193bcc6 */ + 0x3c216494, + 0x65f8, + 0x49e2, + {0xb6, 0x9a, 0x7f, 0x27, 0x21, 0x93, 0xbc, 0xc6} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreclr/inc/readytoruninstructionset.h b/src/coreclr/inc/readytoruninstructionset.h index 4ec3b030ae5bbb..fe388c04a60fc5 100644 --- a/src/coreclr/inc/readytoruninstructionset.h +++ b/src/coreclr/inc/readytoruninstructionset.h @@ -52,6 +52,9 @@ enum ReadyToRunInstructionSet READYTORUN_INSTRUCTION_VectorT512=41, READYTORUN_INSTRUCTION_Rcpc2=42, READYTORUN_INSTRUCTION_Sve=43, + READYTORUN_INSTRUCTION_Avx10v1=44, + READYTORUN_INSTRUCTION_Avx10v1_V256=45, + READYTORUN_INSTRUCTION_Avx10v1_V512=46, }; diff --git a/src/coreclr/jit/jitconfigvalues.h b/src/coreclr/jit/jitconfigvalues.h index 7c16c29b0972f9..5d6173e7973ed2 100644 --- a/src/coreclr/jit/jitconfigvalues.h +++ b/src/coreclr/jit/jitconfigvalues.h @@ -328,6 +328,7 @@ CONFIG_INTEGER(EnableAVX512F, W("EnableAVX512F"), 1) / CONFIG_INTEGER(EnableAVX512F_VL, W("EnableAVX512F_VL"), 1) // Allows AVX512F+ AVX512VL+ hardware intrinsics to be disabled CONFIG_INTEGER(EnableAVX512VBMI, W("EnableAVX512VBMI"), 1) // Allows AVX512VBMI+ hardware intrinsics to be disabled CONFIG_INTEGER(EnableAVX512VBMI_VL, W("EnableAVX512VBMI_VL"), 1) // Allows AVX512VBMI_VL+ hardware intrinsics to be disabled +CONFIG_INTEGER(EnableAVX10v1, W("EnableAVX10v1"), 1) // Allows AVX10v1+ hardware intrinsics to be disabled CONFIG_INTEGER(EnableAVXVNNI, W("EnableAVXVNNI"), 1) // Allows AVXVNNI+ hardware intrinsics to be disabled CONFIG_INTEGER(EnableBMI1, W("EnableBMI1"), 1) // Allows BMI1+ hardware intrinsics to be disabled CONFIG_INTEGER(EnableBMI2, W("EnableBMI2"), 1) // Allows BMI2+ hardware intrinsics to be disabled diff --git a/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs b/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs index 5cdd1a9fd2a936..98d06568878dd4 100644 --- a/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs +++ b/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs @@ -84,6 +84,9 @@ private static class XArchIntrinsicConstants public const int VectorT128 = 0x4000000; public const int VectorT256 = 0x8000000; public const int VectorT512 = 0x10000000; + public const int Avx10v1 = 0x20000000; + public const int Avx10v1_v256 = 0x40000000; + public const int Avx10v1_v512 = unchecked((int)0x80000000); public static void AddToBuilder(InstructionSetSupportBuilder builder, int flags) { @@ -139,6 +142,12 @@ public static void AddToBuilder(InstructionSetSupportBuilder builder, int flags) builder.AddSupportedInstructionSet("avx512vbmi_vl"); if ((flags & Serialize) != 0) builder.AddSupportedInstructionSet("serialize"); + if ((flags & Avx10v1) != 0) + builder.AddSupportedInstructionSet("avx10v1"); + if ((flags & Avx10v1_v256) != 0) + builder.AddSupportedInstructionSet("avx10v1_v256"); + if ((flags & Avx10v1_v512) != 0) + builder.AddSupportedInstructionSet("avx10v1_v512"); } public static int FromInstructionSet(InstructionSet instructionSet) @@ -202,6 +211,12 @@ public static int FromInstructionSet(InstructionSet instructionSet) InstructionSet.X64_AVX512VBMI_VL_X64 => Avx512Vbmi_vl, InstructionSet.X64_X86Serialize => Serialize, InstructionSet.X64_X86Serialize_X64 => Serialize, + InstructionSet.X64_AVX10v1 => Avx10v1, + InstructionSet.X64_AVX10v1_X64 => Avx10v1, + InstructionSet.X64_AVX10v1_V256 => Avx10v1_v256, + InstructionSet.X64_AVX10v1_V256_X64 => Avx10v1_v256, + InstructionSet.X64_AVX10v1_V512 => Avx10v1_v512, + InstructionSet.X64_AVX10v1_V512_X64 => Avx10v1_v512, // Baseline ISAs - they're always available InstructionSet.X64_SSE => 0, diff --git a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs index 284131d1641acc..0e2fec09e19d57 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs @@ -55,6 +55,9 @@ public enum ReadyToRunInstructionSet VectorT512=41, Rcpc2=42, Sve=43, + Avx10v1=44, + Avx10v1_V256=45, + Avx10v1_V512=46, } } diff --git a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs index 7000b482ec604a..533b017e2bae85 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs @@ -118,6 +118,12 @@ public static class ReadyToRunInstructionSetHelper case InstructionSet.X64_AVX512VBMI_X64: return ReadyToRunInstructionSet.Avx512Vbmi; case InstructionSet.X64_AVX512VBMI_VL: return ReadyToRunInstructionSet.Avx512Vbmi_VL; case InstructionSet.X64_AVX512VBMI_VL_X64: return ReadyToRunInstructionSet.Avx512Vbmi_VL; + case InstructionSet.X64_AVX10v1: return ReadyToRunInstructionSet.Avx10v1; + case InstructionSet.X64_AVX10v1_X64: return ReadyToRunInstructionSet.Avx10v1; + case InstructionSet.X64_AVX10v1_V256: return ReadyToRunInstructionSet.Avx10v1_V256; + case InstructionSet.X64_AVX10v1_V256_X64: return ReadyToRunInstructionSet.Avx10v1_V256; + case InstructionSet.X64_AVX10v1_V512: return ReadyToRunInstructionSet.Avx10v1_V512; + case InstructionSet.X64_AVX10v1_V512_X64: return ReadyToRunInstructionSet.Avx10v1_V512; case InstructionSet.X64_VectorT128: return ReadyToRunInstructionSet.VectorT128; case InstructionSet.X64_VectorT256: return ReadyToRunInstructionSet.VectorT256; case InstructionSet.X64_VectorT512: return ReadyToRunInstructionSet.VectorT512; @@ -191,6 +197,12 @@ public static class ReadyToRunInstructionSetHelper case InstructionSet.X86_AVX512VBMI_X64: return null; case InstructionSet.X86_AVX512VBMI_VL: return ReadyToRunInstructionSet.Avx512Vbmi_VL; case InstructionSet.X86_AVX512VBMI_VL_X64: return null; + case InstructionSet.X86_AVX10v1: return ReadyToRunInstructionSet.Avx10v1; + case InstructionSet.X86_AVX10v1_X64: return null; + case InstructionSet.X86_AVX10v1_V256: return ReadyToRunInstructionSet.Avx10v1_V256; + case InstructionSet.X86_AVX10v1_V256_X64: return null; + case InstructionSet.X86_AVX10v1_V512: return ReadyToRunInstructionSet.Avx10v1_V512; + case InstructionSet.X86_AVX10v1_V512_X64: return null; case InstructionSet.X86_VectorT128: return ReadyToRunInstructionSet.VectorT128; case InstructionSet.X86_VectorT256: return ReadyToRunInstructionSet.VectorT256; case InstructionSet.X86_VectorT512: return ReadyToRunInstructionSet.VectorT512; diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs b/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs index a5398c85ca0758..270d4834a9c2b2 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs @@ -73,6 +73,9 @@ public enum InstructionSet X64_AVX512DQ_VL = InstructionSet_X64.AVX512DQ_VL, X64_AVX512VBMI = InstructionSet_X64.AVX512VBMI, X64_AVX512VBMI_VL = InstructionSet_X64.AVX512VBMI_VL, + X64_AVX10v1 = InstructionSet_X64.AVX10v1, + X64_AVX10v1_V256 = InstructionSet_X64.AVX10v1_V256, + X64_AVX10v1_V512 = InstructionSet_X64.AVX10v1_V512, X64_VectorT128 = InstructionSet_X64.VectorT128, X64_VectorT256 = InstructionSet_X64.VectorT256, X64_VectorT512 = InstructionSet_X64.VectorT512, @@ -105,6 +108,9 @@ public enum InstructionSet X64_AVX512DQ_VL_X64 = InstructionSet_X64.AVX512DQ_VL_X64, X64_AVX512VBMI_X64 = InstructionSet_X64.AVX512VBMI_X64, X64_AVX512VBMI_VL_X64 = InstructionSet_X64.AVX512VBMI_VL_X64, + X64_AVX10v1_X64 = InstructionSet_X64.AVX10v1_X64, + X64_AVX10v1_V256_X64 = InstructionSet_X64.AVX10v1_V256_X64, + X64_AVX10v1_V512_X64 = InstructionSet_X64.AVX10v1_V512_X64, X86_X86Base = InstructionSet_X86.X86Base, X86_SSE = InstructionSet_X86.SSE, X86_SSE2 = InstructionSet_X86.SSE2, @@ -137,6 +143,9 @@ public enum InstructionSet X86_AVX512DQ_VL = InstructionSet_X86.AVX512DQ_VL, X86_AVX512VBMI = InstructionSet_X86.AVX512VBMI, X86_AVX512VBMI_VL = InstructionSet_X86.AVX512VBMI_VL, + X86_AVX10v1 = InstructionSet_X86.AVX10v1, + X86_AVX10v1_V256 = InstructionSet_X86.AVX10v1_V256, + X86_AVX10v1_V512 = InstructionSet_X86.AVX10v1_V512, X86_VectorT128 = InstructionSet_X86.VectorT128, X86_VectorT256 = InstructionSet_X86.VectorT256, X86_VectorT512 = InstructionSet_X86.VectorT512, @@ -169,6 +178,9 @@ public enum InstructionSet X86_AVX512DQ_VL_X64 = InstructionSet_X86.AVX512DQ_VL_X64, X86_AVX512VBMI_X64 = InstructionSet_X86.AVX512VBMI_X64, X86_AVX512VBMI_VL_X64 = InstructionSet_X86.AVX512VBMI_VL_X64, + X86_AVX10v1_X64 = InstructionSet_X86.AVX10v1_X64, + X86_AVX10v1_V256_X64 = InstructionSet_X86.AVX10v1_V256_X64, + X86_AVX10v1_V512_X64 = InstructionSet_X86.AVX10v1_V512_X64, } public enum InstructionSet_ARM64 { @@ -237,38 +249,44 @@ public enum InstructionSet_X64 AVX512DQ_VL = 30, AVX512VBMI = 31, AVX512VBMI_VL = 32, - VectorT128 = 33, - VectorT256 = 34, - VectorT512 = 35, - X86Base_X64 = 36, - SSE_X64 = 37, - SSE2_X64 = 38, - SSE3_X64 = 39, - SSSE3_X64 = 40, - SSE41_X64 = 41, - SSE42_X64 = 42, - AVX_X64 = 43, - AVX2_X64 = 44, - AES_X64 = 45, - BMI1_X64 = 46, - BMI2_X64 = 47, - FMA_X64 = 48, - LZCNT_X64 = 49, - PCLMULQDQ_X64 = 50, - POPCNT_X64 = 51, - AVXVNNI_X64 = 52, - MOVBE_X64 = 53, - X86Serialize_X64 = 54, - AVX512F_X64 = 55, - AVX512F_VL_X64 = 56, - AVX512BW_X64 = 57, - AVX512BW_VL_X64 = 58, - AVX512CD_X64 = 59, - AVX512CD_VL_X64 = 60, - AVX512DQ_X64 = 61, - AVX512DQ_VL_X64 = 62, - AVX512VBMI_X64 = 63, - AVX512VBMI_VL_X64 = 64, + AVX10v1 = 33, + AVX10v1_V256 = 34, + AVX10v1_V512 = 35, + VectorT128 = 36, + VectorT256 = 37, + VectorT512 = 38, + X86Base_X64 = 39, + SSE_X64 = 40, + SSE2_X64 = 41, + SSE3_X64 = 42, + SSSE3_X64 = 43, + SSE41_X64 = 44, + SSE42_X64 = 45, + AVX_X64 = 46, + AVX2_X64 = 47, + AES_X64 = 48, + BMI1_X64 = 49, + BMI2_X64 = 50, + FMA_X64 = 51, + LZCNT_X64 = 52, + PCLMULQDQ_X64 = 53, + POPCNT_X64 = 54, + AVXVNNI_X64 = 55, + MOVBE_X64 = 56, + X86Serialize_X64 = 57, + AVX512F_X64 = 58, + AVX512F_VL_X64 = 59, + AVX512BW_X64 = 60, + AVX512BW_VL_X64 = 61, + AVX512CD_X64 = 62, + AVX512CD_VL_X64 = 63, + AVX512DQ_X64 = 64, + AVX512DQ_VL_X64 = 65, + AVX512VBMI_X64 = 66, + AVX512VBMI_VL_X64 = 67, + AVX10v1_X64 = 68, + AVX10v1_V256_X64 = 69, + AVX10v1_V512_X64 = 70, } public enum InstructionSet_X86 @@ -307,38 +325,44 @@ public enum InstructionSet_X86 AVX512DQ_VL = 30, AVX512VBMI = 31, AVX512VBMI_VL = 32, - VectorT128 = 33, - VectorT256 = 34, - VectorT512 = 35, - X86Base_X64 = 36, - SSE_X64 = 37, - SSE2_X64 = 38, - SSE3_X64 = 39, - SSSE3_X64 = 40, - SSE41_X64 = 41, - SSE42_X64 = 42, - AVX_X64 = 43, - AVX2_X64 = 44, - AES_X64 = 45, - BMI1_X64 = 46, - BMI2_X64 = 47, - FMA_X64 = 48, - LZCNT_X64 = 49, - PCLMULQDQ_X64 = 50, - POPCNT_X64 = 51, - AVXVNNI_X64 = 52, - MOVBE_X64 = 53, - X86Serialize_X64 = 54, - AVX512F_X64 = 55, - AVX512F_VL_X64 = 56, - AVX512BW_X64 = 57, - AVX512BW_VL_X64 = 58, - AVX512CD_X64 = 59, - AVX512CD_VL_X64 = 60, - AVX512DQ_X64 = 61, - AVX512DQ_VL_X64 = 62, - AVX512VBMI_X64 = 63, - AVX512VBMI_VL_X64 = 64, + AVX10v1 = 33, + AVX10v1_V256 = 34, + AVX10v1_V512 = 35, + VectorT128 = 36, + VectorT256 = 37, + VectorT512 = 38, + X86Base_X64 = 39, + SSE_X64 = 40, + SSE2_X64 = 41, + SSE3_X64 = 42, + SSSE3_X64 = 43, + SSE41_X64 = 44, + SSE42_X64 = 45, + AVX_X64 = 46, + AVX2_X64 = 47, + AES_X64 = 48, + BMI1_X64 = 49, + BMI2_X64 = 50, + FMA_X64 = 51, + LZCNT_X64 = 52, + PCLMULQDQ_X64 = 53, + POPCNT_X64 = 54, + AVXVNNI_X64 = 55, + MOVBE_X64 = 56, + X86Serialize_X64 = 57, + AVX512F_X64 = 58, + AVX512F_VL_X64 = 59, + AVX512BW_X64 = 60, + AVX512BW_VL_X64 = 61, + AVX512CD_X64 = 62, + AVX512CD_VL_X64 = 63, + AVX512DQ_X64 = 64, + AVX512DQ_VL_X64 = 65, + AVX512VBMI_X64 = 66, + AVX512VBMI_VL_X64 = 67, + AVX10v1_X64 = 68, + AVX10v1_V256_X64 = 69, + AVX10v1_V512_X64 = 70, } public unsafe struct InstructionSetFlags : IEnumerable @@ -674,6 +698,18 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL_X64); if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512VBMI_VL_X64)) resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_X64); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_X64)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V256)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V256_X64); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V256_X64)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512_X64); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512_X64)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); if (resultflags.HasInstructionSet(InstructionSet.X64_SSE)) resultflags.AddInstructionSet(InstructionSet.X64_X86Base); if (resultflags.HasInstructionSet(InstructionSet.X64_SSE2)) @@ -746,6 +782,34 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI); if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512VBMI_VL)) resultflags.AddInstructionSet(InstructionSet.X64_AVX512BW_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX2); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1)) + resultflags.AddInstructionSet(InstructionSet.X64_FMA); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V256)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512F); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512F_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512CD); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512CD_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512BW); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512BW_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512DQ); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512DQ_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL); if (resultflags.HasInstructionSet(InstructionSet.X64_VectorT128)) resultflags.AddInstructionSet(InstructionSet.X64_SSE2); if (resultflags.HasInstructionSet(InstructionSet.X64_VectorT256)) @@ -833,6 +897,34 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target resultflags.AddInstructionSet(InstructionSet.X86_AVX512VBMI); if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512VBMI_VL)) resultflags.AddInstructionSet(InstructionSet.X86_AVX512BW_VL); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX2); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1)) + resultflags.AddInstructionSet(InstructionSet.X86_FMA); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V256)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512F); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512F_VL); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512CD); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512CD_VL); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512BW); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512BW_VL); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512DQ); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512DQ_VL); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512VBMI); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V512)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX512VBMI_VL); if (resultflags.HasInstructionSet(InstructionSet.X86_VectorT128)) resultflags.AddInstructionSet(InstructionSet.X86_SSE2); if (resultflags.HasInstructionSet(InstructionSet.X86_VectorT256)) @@ -969,6 +1061,12 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI); if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512VBMI_VL_X64)) resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_X64)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V256_X64)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V512_X64)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); if (resultflags.HasInstructionSet(InstructionSet.X64_X86Base)) resultflags.AddInstructionSet(InstructionSet.X64_SSE); if (resultflags.HasInstructionSet(InstructionSet.X64_SSE)) @@ -1041,6 +1139,34 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL); if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512BW_VL)) resultflags.AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX2)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X64_FMA)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX10v1_V256)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512F)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512F_VL)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512CD)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512CD_VL)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512BW)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512BW_VL)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512DQ)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512DQ_VL)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512VBMI)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X64_AVX512VBMI_VL)) + resultflags.AddInstructionSet(InstructionSet.X64_AVX10v1_V512); if (resultflags.HasInstructionSet(InstructionSet.X64_SSE2)) resultflags.AddInstructionSet(InstructionSet.X64_VectorT128); if (resultflags.HasInstructionSet(InstructionSet.X64_AVX2)) @@ -1128,6 +1254,34 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe resultflags.AddInstructionSet(InstructionSet.X86_AVX512VBMI_VL); if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512BW_VL)) resultflags.AddInstructionSet(InstructionSet.X86_AVX512VBMI_VL); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX2)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X86_FMA)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V256); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX10v1_V256)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512F)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512F_VL)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512CD)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512CD_VL)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512BW)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512BW_VL)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512DQ)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512DQ_VL)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512VBMI)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); + if (resultflags.HasInstructionSet(InstructionSet.X86_AVX512VBMI_VL)) + resultflags.AddInstructionSet(InstructionSet.X86_AVX10v1_V512); if (resultflags.HasInstructionSet(InstructionSet.X86_SSE2)) resultflags.AddInstructionSet(InstructionSet.X86_VectorT128); if (resultflags.HasInstructionSet(InstructionSet.X86_AVX2)) @@ -1248,6 +1402,9 @@ public static IEnumerable ArchitectureToValidInstructionSets yield return new InstructionSetInfo("avx512dq_vl", "Avx512DQ_VL", InstructionSet.X64_AVX512DQ_VL, true); yield return new InstructionSetInfo("avx512vbmi", "Avx512Vbmi", InstructionSet.X64_AVX512VBMI, true); yield return new InstructionSetInfo("avx512vbmi_vl", "Avx512Vbmi_VL", InstructionSet.X64_AVX512VBMI_VL, true); + yield return new InstructionSetInfo("avx10v1", "Avx10v1", InstructionSet.X64_AVX10v1, true); + yield return new InstructionSetInfo("avx10v1_v256", "Avx10v1_V256", InstructionSet.X64_AVX10v1_V256, true); + yield return new InstructionSetInfo("avx10v1_v512", "Avx10v1_V512", InstructionSet.X64_AVX10v1_V512, true); yield return new InstructionSetInfo("vectort128", "VectorT128", InstructionSet.X64_VectorT128, true); yield return new InstructionSetInfo("vectort256", "VectorT256", InstructionSet.X64_VectorT256, true); yield return new InstructionSetInfo("vectort512", "VectorT512", InstructionSet.X64_VectorT512, true); @@ -1286,6 +1443,9 @@ public static IEnumerable ArchitectureToValidInstructionSets yield return new InstructionSetInfo("avx512dq_vl", "Avx512DQ_VL", InstructionSet.X86_AVX512DQ_VL, true); yield return new InstructionSetInfo("avx512vbmi", "Avx512Vbmi", InstructionSet.X86_AVX512VBMI, true); yield return new InstructionSetInfo("avx512vbmi_vl", "Avx512Vbmi_VL", InstructionSet.X86_AVX512VBMI_VL, true); + yield return new InstructionSetInfo("avx10v1", "Avx10v1", InstructionSet.X86_AVX10v1, true); + yield return new InstructionSetInfo("avx10v1_v256", "Avx10v1_V256", InstructionSet.X86_AVX10v1_V256, true); + yield return new InstructionSetInfo("avx10v1_v512", "Avx10v1_V512", InstructionSet.X86_AVX10v1_V512, true); yield return new InstructionSetInfo("vectort128", "VectorT128", InstructionSet.X86_VectorT128, true); yield return new InstructionSetInfo("vectort256", "VectorT256", InstructionSet.X86_VectorT256, true); yield return new InstructionSetInfo("vectort512", "VectorT512", InstructionSet.X86_VectorT512, true); @@ -1378,6 +1538,12 @@ public void Set64BitInstructionSetVariants(TargetArchitecture architecture) AddInstructionSet(InstructionSet.X64_AVX512VBMI_X64); if (HasInstructionSet(InstructionSet.X64_AVX512VBMI_VL)) AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL_X64); + if (HasInstructionSet(InstructionSet.X64_AVX10v1)) + AddInstructionSet(InstructionSet.X64_AVX10v1_X64); + if (HasInstructionSet(InstructionSet.X64_AVX10v1_V256)) + AddInstructionSet(InstructionSet.X64_AVX10v1_V256_X64); + if (HasInstructionSet(InstructionSet.X64_AVX10v1_V512)) + AddInstructionSet(InstructionSet.X64_AVX10v1_V512_X64); break; case TargetArchitecture.X86: @@ -1432,6 +1598,9 @@ public void Set64BitInstructionSetVariantsUnconditionally(TargetArchitecture arc AddInstructionSet(InstructionSet.X64_AVX512DQ_VL_X64); AddInstructionSet(InstructionSet.X64_AVX512VBMI_X64); AddInstructionSet(InstructionSet.X64_AVX512VBMI_VL_X64); + AddInstructionSet(InstructionSet.X64_AVX10v1_X64); + AddInstructionSet(InstructionSet.X64_AVX10v1_V256_X64); + AddInstructionSet(InstructionSet.X64_AVX10v1_V512_X64); break; case TargetArchitecture.X86: @@ -1464,6 +1633,9 @@ public void Set64BitInstructionSetVariantsUnconditionally(TargetArchitecture arc AddInstructionSet(InstructionSet.X86_AVX512DQ_VL_X64); AddInstructionSet(InstructionSet.X86_AVX512VBMI_X64); AddInstructionSet(InstructionSet.X86_AVX512VBMI_VL_X64); + AddInstructionSet(InstructionSet.X86_AVX10v1_X64); + AddInstructionSet(InstructionSet.X86_AVX10v1_V256_X64); + AddInstructionSet(InstructionSet.X86_AVX10v1_V512_X64); break; } } @@ -1741,6 +1913,24 @@ public static InstructionSet LookupPlatformIntrinsicInstructionSet(TargetArchite else { return InstructionSet.X64_AVX512VBMI; } + case "Avx10v1": + if (nestedTypeName == "X64") + { return InstructionSet.X64_AVX10v1_X64; } + else + { return InstructionSet.X64_AVX10v1; } + + case "Avx10v1_V256": + if (nestedTypeName == "X64") + { return InstructionSet.X64_AVX10v1_V256_X64; } + else + { return InstructionSet.X64_AVX10v1_V256; } + + case "Avx10v1_V512": + if (nestedTypeName == "X64") + { return InstructionSet.X64_AVX10v1_V512_X64; } + else + { return InstructionSet.X64_AVX10v1_V512; } + case "VectorT128": { return InstructionSet.X64_VectorT128; } @@ -1844,6 +2034,15 @@ public static InstructionSet LookupPlatformIntrinsicInstructionSet(TargetArchite else { return InstructionSet.X86_AVX512VBMI; } + case "Avx10v1": + { return InstructionSet.X86_AVX10v1; } + + case "Avx10v1_V256": + { return InstructionSet.X86_AVX10v1_V256; } + + case "Avx10v1_V512": + { return InstructionSet.X86_AVX10v1_V512; } + case "VectorT128": { return InstructionSet.X86_VectorT128; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt index 7b6e15b87bd84a..5f1953f71e9190 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt @@ -57,6 +57,9 @@ instructionset ,X86 ,Avx512DQ , ,35 ,AVX512DQ instructionset ,X86 ,Avx512DQ_VL , ,36 ,AVX512DQ_VL ,avx512dq_vl instructionset ,X86 ,Avx512Vbmi , ,37 ,AVX512VBMI ,avx512vbmi instructionset ,X86 ,Avx512Vbmi_VL , ,38 ,AVX512VBMI_VL ,avx512vbmi_vl +instructionset ,X86 ,Avx10v1 , ,44 ,AVX10v1 ,avx10v1 +instructionset ,X86 ,Avx10v1_V256 , ,45 ,AVX10v1_V256 ,avx10v1_v256 +instructionset ,X86 ,Avx10v1_V512 , ,46 ,AVX10v1_V512 ,avx10v1_v512 instructionset ,X86 ,VectorT128 , ,39 ,VectorT128 ,vectort128 instructionset ,X86 ,VectorT256 , ,40 ,VectorT256 ,vectort256 instructionset ,X86 ,VectorT512 , ,41 ,VectorT512 ,vectort512 @@ -90,6 +93,9 @@ instructionset64bit,X86 ,AVX512DQ instructionset64bit,X86 ,AVX512DQ_VL instructionset64bit,X86 ,AVX512VBMI instructionset64bit,X86 ,AVX512VBMI_VL +instructionset64bit,X86 ,AVX10v1 +instructionset64bit,X86 ,AVX10v1_V256 +instructionset64bit,X86 ,AVX10v1_V512 vectorinstructionset,X86 ,Vector128 vectorinstructionset,X86 ,Vector256 @@ -131,6 +137,20 @@ implication ,X86 ,AVX512DQ_VL ,AVX512F_VL implication ,X86 ,AVX512VBMI ,AVX512BW implication ,X86 ,AVX512VBMI_VL ,AVX512VBMI implication ,X86 ,AVX512VBMI_VL ,AVX512BW_VL +implication ,X86 ,AVX10v1 ,AVX2 +implication ,X86 ,AVX10v1 ,FMA +implication ,X86 ,AVX10v1_V256 ,AVX10v1 +implication ,X86 ,AVX10v1_V512 ,AVX10v1_V256 +implication ,X86 ,AVX10v1_V512 ,AVX512F +implication ,X86 ,AVX10v1_V512 ,AVX512F_VL +implication ,X86 ,AVX10v1_V512 ,AVX512CD +implication ,X86 ,AVX10v1_V512 ,AVX512CD_VL +implication ,X86 ,AVX10v1_V512 ,AVX512BW +implication ,X86 ,AVX10v1_V512 ,AVX512BW_VL +implication ,X86 ,AVX10v1_V512 ,AVX512DQ +implication ,X86 ,AVX10v1_V512 ,AVX512DQ_VL +implication ,X86 ,AVX10v1_V512 ,AVX512VBMI +implication ,X86 ,AVX10v1_V512 ,AVX512VBMI_VL implication ,X86 ,VectorT128 ,SSE2 implication ,X86 ,VectorT256 ,AVX2 implication ,X86 ,VectorT512 ,AVX512F diff --git a/src/coreclr/vm/codeman.cpp b/src/coreclr/vm/codeman.cpp index e9394c267c3804..c5dd920815a56b 100644 --- a/src/coreclr/vm/codeman.cpp +++ b/src/coreclr/vm/codeman.cpp @@ -1445,6 +1445,26 @@ void EEJitManager::SetCpuInfo() { CPUCompileFlags.Set(InstructionSet_X86Serialize); } + + // As Avx10v1_V512 could imply Avx10v1_V256 and Avx10v1, and Avx10v1_V256 could imply Avx10v1 + // then the flag check here can be conducted for only once, and let + // `EnusreValidInstructionSetSupport` to handle the illegal combination. + // To ensure `EnusreValidInstructionSetSupport` handle the dependency correctly, the implication + // defined in InstructionSetDesc.txt should be explicit, no transitive implication should be assumed. + if (((cpuFeatures & XArchIntrinsicConstants_Avx10v1) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableAVX10v1)) + { + CPUCompileFlags.Set(InstructionSet_AVX10v1); + } + + if (((cpuFeatures & XArchIntrinsicConstants_Avx10v1_V256) != 0)) + { + CPUCompileFlags.Set(InstructionSet_AVX10v1_V256); + } + + if (((cpuFeatures & XArchIntrinsicConstants_Avx10v1_V512) != 0)) + { + CPUCompileFlags.Set(InstructionSet_AVX10v1_V512); + } #elif defined(TARGET_ARM64) #if !defined(TARGET_WINDOWS) diff --git a/src/native/minipal/cpufeatures.c b/src/native/minipal/cpufeatures.c index aeb7686dbec761..89b30724aafd10 100644 --- a/src/native/minipal/cpufeatures.c +++ b/src/native/minipal/cpufeatures.c @@ -277,6 +277,28 @@ int minipal_getcpufeatures(void) { result |= XArchIntrinsicConstants_AvxVnni; } + + if ((cpuidInfo[CPUID_EDX] & (1 << 19)) != 0) // Avx10 + { + __cpuidex(cpuidInfo, 0x00000024, 0x00000000); + if((cpuidInfo[CPUID_EBX] & 0xFF) >= 1) // Avx10v1 - CPUID.(EAX=24H, ECX=00H):EBX[7:0] >= 1 + { + if ((cpuidInfo[CPUID_EBX] & (1 << 16)) != 0) + { + result |= XArchIntrinsicConstants_Avx10v1; + } + + if ((cpuidInfo[CPUID_EBX] & (1 << 17)) != 0) + { + result |= XArchIntrinsicConstants_Avx10v1_V256; + } + + if ((cpuidInfo[CPUID_EBX] & (1 << 18)) != 0) + { + result |= XArchIntrinsicConstants_Avx10v1_V512; + } + } + } } } } diff --git a/src/native/minipal/cpufeatures.h b/src/native/minipal/cpufeatures.h index 3b8d0de8aa8656..a5a803e5d2888f 100644 --- a/src/native/minipal/cpufeatures.h +++ b/src/native/minipal/cpufeatures.h @@ -40,6 +40,9 @@ enum XArchIntrinsicConstants XArchIntrinsicConstants_VectorT128 = 0x4000000, XArchIntrinsicConstants_VectorT256 = 0x8000000, XArchIntrinsicConstants_VectorT512 = 0x10000000, + XArchIntrinsicConstants_Avx10v1 = 0x20000000, + XArchIntrinsicConstants_Avx10v1_V256 = 0x40000000, + XArchIntrinsicConstants_Avx10v1_V512 = 0x80000000, }; #endif // HOST_X86 || HOST_AMD64