Tuesday, June 29, 2021

ARM64EC: Building Native and Interoperable Apps for Windows 11 on ARM

Today, we’re announcing ARM64EC (“Emulation Compatible”), a new way to build apps for Windows 11 on ARM. With the latest Visual Studio tools in preview and the Windows 11 Insider SDK, you’ll be able to take advantage of ARM64EC to incrementally transition your app to running with native speed on ARM, even if you have dependencies or plugins that don’t support ARM yet.

About ARM64EC

ARM64EC is a new application binary interface (ABI) for Windows 11 on ARM that runs with native speed and is interoperable with x64. An app, process, or even a module can freely mix and match ARM64EC and x64 as needed. The ARM64EC code in the app will run natively while any x64 code will run using Windows 11 on ARM’s built-in emulation.

The ARM64EC ABI differs slightly from the existing ARM64 ABI in ways that make it binary compatible with x64 code. Specifically, the ARM64EC ABI follows x64 software conventions including calling convention, stack usage, and data alignment, making ARM64EC and x64 interoperable. Apps built as ARM64EC may contain x64 code but do not have to, since ARM64EC is its own complete, first-class ABI for Windows.

Developer Benefits

Traditionally, rebuilding an app for ARM has meant recompiling the entire app. The result is a great native experience for the customer that unlocks the full power of the ARM device. However, from a developer perspective, porting an app can be all-or-nothing, since all the binaries within a process need to be rebuilt before a customer can see the benefit.

With ARM64EC, you can choose to start small and build incrementally. You can identify a part of your codebase that would benefit most from native performance and rebuild it as ARM64EC. The rest of the app will remain fully functional as emulated x64, but the recompiled ARM64EC parts will now have native speed.  Over time, you can recompile more of the app as ARM64EC to further improve performance and conserve battery life for your app’s customers.

The ability to mix and match x64 and ARM64EC makes it possible to build an app for Windows 11 on ARM even if it depends on x64 code outside of your control. Projects with third-party dependencies that don’t support ARM can leave them as x64.  And apps with an in-proc plugin ecosystem can build as ARM64EC to get native speed, while continuing to load and use x64 plugins.

Conclusion

We’re motivated by the potential of ARM64EC and excited to see the kinds of apps developers can build for Windows 11 on ARM using this technology. Internally, we’ve rebuilt the binaries of the Windows 11 on ARM operating system itself with ARM64EC so that any system code loaded by x64 apps runs with native speed.  In addition, the Office team is using ARM64EC in the coming 64-bit Office for ARM so that existing x64 plugins will work seamlessly.

You can get started with ARM64EC by downloading the latest Windows Insider SDK and Visual Studio Preview, then following the steps on docs.microsoft.com to add an ARM64EC configuration.  Looking forward, we’ll have more content to share as we walk through in more detail how to take advantage of ARM64EC in your apps.



from Hacker News https://ift.tt/3hgrteq

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.