Skip to content

Set minimum ISAs when compiling native code#130556

Open
MichalPetryka wants to merge 3 commits into
dotnet:mainfrom
MichalPetryka:patch-67
Open

Set minimum ISAs when compiling native code#130556
MichalPetryka wants to merge 3 commits into
dotnet:mainfrom
MichalPetryka:patch-67

Conversation

@MichalPetryka

Copy link
Copy Markdown
Contributor

Match native compiler configuration with .NET 11.

For MSVC see x64 and ARM64, for Unixes see GCC.

@am11 Is this the right place for this? I found no usages of /arch or -march anywhere so I just put this here.
cc @jkotas @tannergooding @EgorBo any reason why we wouldn't do this?

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 11, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@am11

am11 commented Jul 11, 2026

Copy link
Copy Markdown
Member

I think it'd be better to place them near:

add_compile_options(-march=armv7-a)
if(ARM_SOFTFP)
add_definitions(-DARM_SOFTFP)
add_compile_options(-mfloat-abi=softfp)
endif(ARM_SOFTFP)
endif(CLR_CMAKE_HOST_UNIX_ARM)
if(CLR_CMAKE_HOST_UNIX_ARMV6)
add_compile_options(-mfpu=vfp)
add_definitions(-DCLR_ARM_FPU_CAPABILITY=0x0)
add_compile_options(-march=armv6zk)
add_compile_options(-mcpu=arm1176jzf-s)
add_compile_options(-mfloat-abi=hard)
endif(CLR_CMAKE_HOST_UNIX_ARMV6)
if(CLR_CMAKE_HOST_UNIX_RISCV64)
add_compile_options(-march=rv64gc)
add_compile_options(-mabi=lp64d)
endif(CLR_CMAKE_HOST_UNIX_RISCV64)

@tannergooding

Copy link
Copy Markdown
Member

I believe we explicitly wanted to wait at least 1 release so that any users got a clear error message and we didn't see big perf wins for the JIT or VM, with the GC already opportunistically using things like LSE

But, I'll defer to Jan

@jkotas

jkotas commented Jul 12, 2026

Copy link
Copy Markdown
Member

Related to #118101

@jkotas

jkotas commented Jul 12, 2026

Copy link
Copy Markdown
Member

I think it'd be better to place them near:

Yes, I makes sense to have all baselines together.

endif()
elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
if(CLR_CMAKE_HOST_WIN32)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/arch:armv8.0+lse>)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should set LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT define as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants