Skip to content

bmi and bmi2 instruction set missing from new ilc #119819

@loldot

Description

@loldot

Description

When upgrading my dotnet application from .net sdk 9 to 10-rc.1, I am no longer able to publish with the following settings:

  <PropertyGroup>
    <PublishAot>true</PublishAot>
    <IlcInstructionSet>avx2,bmi2,fma,pclmul,popcnt,aes,lzcnt</IlcInstructionSet>
    <OptimizationPreference>Speed</OptimizationPreference>
    <DebuggerSupport>false</DebuggerSupport>
    <InvariantGlobalization>true</InvariantGlobalization>
    <StackTraceSupport>false</StackTraceSupport>
  </PropertyGroup>

I receive the following error:

EXEC : error Unrecognized instruction set bmi2

Reproduction Steps

git clone git@github.com:loldot/missing-ilc.git
cd missing-ilc
dotnet publish -c Release -r win-x64

~.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\tools\ilc.exe

The allowable values for the --instruction-set option are described in the table below. Each architecture has a different set of valid instruction sets, and multiple instruction sets may be specified by separating the instructions sets by a ','. For example 'avx2,bmi,lzcnt'
arm64: base, neon, aes, crc, dotprod, rdma, sha1, sha2, lse, rcpc, vectort128, rcpc2, sve, sve2
x86: base, base, base, sse4.2, sse4.2, sse4.2, sse4.2, sse4.2, avx, avx2, avx2, avx2, avx2, avx2, avx2, avx2, avx512, avx512, avx512, avx512, avx512, avx512, avx512, avx512, avx512, avx512v2, avx512v2, avx512v2, avx512v3, avx512v3, avx512v3, avx512v3, avx512v3, avx512v3, avx512v3, avx10v1, avx10v1, avx10v1, avx10v1, avx10v1, avx10v1, avx10v2, avx10v2, apx, aes, aes_v256, aes_v512, aes, aes_v256, aes_v512, avx512vp2intersect, avx512vp2intersect, avxifma, avxvnni, gfni, gfni_v256, gfni_v512, sha, waitpkg, x86serialize, vectort128, vectort256, vectort512, avxvnniint, avxvnniint_v512, avxvnniint, avxvnniint_v512
x64: base, base, base, sse4.2, sse4.2, sse4.2, sse4.2, sse4.2, avx, avx2, avx2, avx2, avx2, avx2, avx2, avx2, avx512, avx512, avx512, avx512, avx512, avx512, avx512, avx512, avx512, avx512v2, avx512v2, avx512v2, avx512v3, avx512v3, avx512v3, avx512v3, avx512v3, avx512v3, avx512v3, avx10v1, avx10v1, avx10v1, avx10v1, avx10v1, avx10v1, avx10v2, avx10v2, apx, aes, aes_v256, aes_v512, aes, aes_v256, aes_v512, avx512vp2intersect, avx512vp2intersect, avxifma, avxvnni, gfni, gfni_v256, gfni_v512, sha, waitpkg, x86serialize, vectort128, vectort256, vectort512, avxvnniint, avxvnniint_v512, avxvnniint, avxvnniint_v512
riscv64: base, zba, zbb

~.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\9.0.9\tools\ilc.exe

The allowable values for the --instruction-set option are described in the table below. Each architecture has a different set of valid instruction sets, and multiple instruction sets may be specified by separating the instructions sets by a ','. For example 'avx2,bmi,lzcnt'
arm64: base, neon, aes, crc, dotprod, rdma, sha1, sha2, lse, rcpc, vectort128, rcpc2, sve
x86: base, sse, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2, aes, bmi, bmi2, fma, lzcnt, pclmul, popcnt, avxvnni, movbe, serialize, evex, avx512f, avx512f_vl, avx512bw, avx512bw_vl, avx512cd, avx512cd_vl, avx512dq, avx512dq_vl, avx512vbmi, avx512vbmi_vl, avx10v1, avx10v1_v512, vectort128, vectort256, vectort512
x64: base, sse, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2, aes, bmi, bmi2, fma, lzcnt, pclmul, popcnt, avxvnni, movbe, serialize, evex, avx512f, avx512f_vl, avx512bw, avx512bw_vl, avx512cd, avx512cd_vl, avx512dq, avx512dq_vl, avx512vbmi, avx512vbmi_vl, avx10v1, avx10v1_v512, vectort128, vectort256, vectort512

The following CPU names are predefined groups of instruction sets and can be used in --instruction-set too:
x86-x64, x86-x64-v2, x86-x64-v3, skylake, x86-x64-v4, armv8-a, armv8.1-a, armv8.2-a, armv8.3-a, armv8.4-a, armv8.5-a, armv8.6-a, apple-m1

Expected behavior

I didn't see this on the list of breaking changes, so I would expect it to compile without issue on the new sdk

https://learn.microsoft.com/en-us/dotnet/core/compatibility/10.0?toc=%2Fdotnet%2Ffundamentals%2Ftoc.json&bc=%2Fdotnet%2Fbreadcrumb%2Ftoc.json

Actual behavior

Publishing as aot fails

Regression?

No response

Known Workarounds

Changing to <IlcInstructionSet>x86-64-v3</IlcInstructionSet> works

Configuration

dotnet --info

.NET SDK:
Version: 10.0.100-rc.1.25451.107
Commit: 2db1f5ee2b
Workload version: 10.0.100-manifests.0e2d47c4
MSBuild version: 17.15.0-preview-25451-107+2db1f5ee2

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.0-rc.1.25451.107
Architecture: x64
Commit: 2db1f5ee2b

.NET SDKs installed:
8.0.120 [C:\Program Files\dotnet\sdk]
8.0.317 [C:\Program Files\dotnet\sdk]
8.0.414 [C:\Program Files\dotnet\sdk]
9.0.304 [C:\Program Files\dotnet\sdk]
10.0.100-rc.1.25451.107 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
DOTNET_ASPIRE_CONTAINER_RUNTIME [podman]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

systeminfo
Host Name: **************
OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.26100 N/A Build 26100
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
Registered Owner: ***************
Registered Organization:
Product ID: 00330-80000-00000-AA692
Original Install Date: 29.12.2024, 00:13:12
System Boot Time: 17.09.2025, 17:02:37
System Manufacturer: Komplett
System Model: KomplettPC
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: Intel64 Family 6 Model 151 Stepping 2 GenuineIntel ~3700 Mhz
BIOS Version: American Megatrends Inc. 1604, 15.12.2023
Windows Directory: C:\WINDOWS
System Directory: C:\WINDOWS\system32
Boot Device: \Device\HarddiskVolume1
System Locale: en-us;English (United States)
Input Locale: no;Norwegian (Bokmal)
Time Zone: (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Total Physical Memory: 65 349 MB
Available Physical Memory: 42 317 MB
Virtual Memory: Max Size: 69 445 MB
Virtual Memory: Available: 45 011 MB
Virtual Memory: In Use: 24 434 MB
Page File Location(s): C:\pagefile.sys
Domain: WORKGROUP
Logon Server: \********
Hotfix(s): 3 Hotfix(s) Installed.
[01]: KB5064401
[02]: KB5065426
[03]: KB5064531
Network Card(s): 4 NIC(s) Installed.
[01]: Intel(R) Wi-Fi 6 AX201 160MHz
Connection Name: Wi-Fi
Status: Media disconnected
[02]: Bluetooth Device (Personal Area Network)
Connection Name: Bluetooth Network Connection
Status: Media disconnected
[03]: Realtek Gaming 2.5GbE Family Controller
Connection Name: Ethernet
DHCP Enabled: Yes
DHCP Server: 192.168.10.1
IP address(es)
[01]: 192.168.10.157
[02]: fe80::d670:441:bf67:a947
[03]: 2a01:799:b2a:8100:c1a4:1432:eba4:efa5
[04]: 2a01:799:b2a:8100:cbb8:aea9:f4ea:20c3
[04]: Wintun Userspace Tunnel
Connection Name: Tailscale
DHCP Enabled: No
IP address(es)
[01]: 100.120.96.52
[02]: fe80::21a8:10a6:6a3b:793e
[03]: fd7a:115c:a1e0::701:6035
Virtualization-based security: Status: Running
Required Security Properties:
Available Security Properties:
Base Virtualization Support
DMA Protection
UEFI Code Readonly
SMM Security Mitigations 1.0
Mode Based Execution Control
APIC Virtualization
Services Configured:
Hypervisor enforced Code Integrity
Services Running:
Hypervisor enforced Code Integrity
App Control for Business policy: Enforced
App Control for Business user mode policy: Off
Security Features Enabled:
Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions