Repository: dotnet/runtime
File: src/coreclr/vm/codeman.cpp (C++)

Code before:
        CPUCompileFlags.Set(InstructionSet_GFNI_V256);
        CPUCompileFlags.Set(InstructionSet_GFNI_V512);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_Sha) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableSHA))
    {
        CPUCompileFlags.Set(InstructionSet_SHA);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_AvxVnniInt) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableAVXVNNIINT))
    {
        CPUCompileFlags.Set(InstructionSet_AVXVNNIINT);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_WaitPkg) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableWAITPKG))
    {
        CPUCompileFlags.Set(InstructionSet_WAITPKG);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_X86Serialize) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableX86Serialize))
    {
        CPUCompileFlags.Set(InstructionSet_X86Serialize);
    }
#elif defined(TARGET_ARM64)
    CPUCompileFlags.Set(InstructionSet_VectorT128);
    CPUCompileFlags.Set(InstructionSet_VectorT);

    if (g_pConfig->EnableHWIntrinsic())
    {
        CPUCompileFlags.Set(InstructionSet_ArmBase);
        CPUCompileFlags.Set(InstructionSet_AdvSimd);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Aes) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Aes))
    {
        CPUCompileFlags.Set(InstructionSet_Aes);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Atomics) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Atomics))
    {
        CPUCompileFlags.Set(InstructionSet_Atomics);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Rcpc) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Rcpc))
    {
        CPUCompileFlags.Set(InstructionSet_Rcpc);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Rcpc2) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Rcpc2))
    {
        CPUCompileFlags.Set(InstructionSet_Rcpc2);

Review comment (suggestion):
I would not expect both of these to be set simultaneously and would rather expect similar handling as for `VectorT128` vs `VectorT256` vs `VectorT512` on xarch where there can only be one set, as `Vector<T>` can only have "one size" (i.e. an exact bit-width or `VectorT` which indicates an unknown bit-width using SVE)

Code after:
        CPUCompileFlags.Set(InstructionSet_GFNI_V256);
        CPUCompileFlags.Set(InstructionSet_GFNI_V512);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_Sha) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableSHA))
    {
        CPUCompileFlags.Set(InstructionSet_SHA);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_AvxVnniInt) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableAVXVNNIINT))
    {
        CPUCompileFlags.Set(InstructionSet_AVXVNNIINT);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_WaitPkg) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableWAITPKG))
    {
        CPUCompileFlags.Set(InstructionSet_WAITPKG);
    }

    if (((cpuFeatures & XArchIntrinsicConstants_X86Serialize) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableX86Serialize))
    {
        CPUCompileFlags.Set(InstructionSet_X86Serialize);
    }
#elif defined(TARGET_ARM64)
    CPUCompileFlags.Set(InstructionSet_VectorT128);

    if (g_pConfig->EnableHWIntrinsic())
    {
        CPUCompileFlags.Set(InstructionSet_ArmBase);
        CPUCompileFlags.Set(InstructionSet_AdvSimd);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Aes) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Aes))
    {
        CPUCompileFlags.Set(InstructionSet_Aes);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Atomics) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Atomics))
    {
        CPUCompileFlags.Set(InstructionSet_Atomics);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Rcpc) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Rcpc))
    {
        CPUCompileFlags.Set(InstructionSet_Rcpc);
    }

    if (((cpuFeatures & ARM64IntrinsicConstants_Rcpc2) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableArm64Rcpc2))
    {
        CPUCompileFlags.Set(InstructionSet_Rcpc2);
    }