DE version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
64% Positive
Analyzed from 762 words in the discussion.
Trending Topics
#code#hardware#users#volatile#metadata#cpu#binary#more#arm#faster

Discussion (17 Comments)Read Original on HackerNews
Contemporary out-of-order CPUs are incredibly over-provisioned; microarchitects will justify a new feature by another 0.1% gain on some benchmark. The end result is a CPU that's pretty decent at handling the sort of code bloat that comes from a binary translator.
There's also a big tradeoff in adding more optimizations to a binary translator. You would like to be able to precisely handle exceptions (especially ones caused by invalid memory accesses) while presenting a userspace exception handler with an architecturally valid state for the source program. There are some optimizations that would be easy to do in principle but are painful for maintaining this mapping between source program states and translated program states. The complexity burden combined with the difficulty of debugging that added complexity (or exhaustively verifying it up-front) shapes many of your decisions when writing a production binary translator. You should always have more Cool (tm) ideas than you actually use in practice.
(16x x86 regs fit in 32x Arm regs, whereas 32x in 32x is... much less of a fit)
MSVC2019+ now include "volatile metadata" to the output executables to make emulation on ARM faster[0][1], though it seems to be off by default since MSVC2022, I am curious to know why they disabled it.
Microsoft now also offers an "Arm64EC" ABI, that, as I understand it, helps calling into native ARM libraries from emulated x86 code by avoiding the need to translate calling conventions, but that's mostly relevant for third-party libraries in this context (I imagine that Microsoft ships all system libraries with the "emulation compatible" ABI with Prism?).
I'd be curious to see some Prism vs FEX (vs Rosetta vs Box64) benchmarks.
[0]: https://fex-emu.com/FEX-2504/#windows-pe-volatile-metadata-s...
[1]: https://learn.microsoft.com/en-us/cpp/build/reference/volati...
This seems to be a typo in the docs, VS2022 is 17.x and still generates volatile metadata. VS2026 is 18.x.
Last time I tested it, the penalty in Prism for running x64 code without volatile metadata was ~25% on Snapdragon X.
ARM64EC code is essentially x64 code pre-translated to ARM64. It's built against the x64 emulation ABI conventions but runs directly as native ARM64 code. Translation thunking conventions allow for cross-calling between ARM64EC and emulated x64 code.
A lot of the OS libs are shipped in Windows 11 ARM as ARM64X, so they're hybrid ARM64EC+ARM64. x86 libs like MSVCRT.DLL do still seem to be compiled with volatile metadata. DUMPBIN /LOADCONFIG reveals if volatile metadata has been included.
It seems there is a persistent rift between what hardware designers think users want and what users are asking for, only recently being addressed by major OEMs with products such as the MacBook Neo.
Nobody I personally know wants a faster CPU; they want competent, faster, native feeling software and more power efficient hardware. CPUs have been plenty fast for at least a decade now, for anything the majority of users and even gamers are doing. I'm playing through the new and notoriously demanding LEGO Batman game on an RTX 2080 and an i7-4790k, a CPU from 2013 that even the base M1 easily beats. The game runs fine. Most people I am confident do not need better than the M1.
Additionally people shipping Electron crap also don't address my needs at all, everything that is Web based I already have an installed browser for it.
> Nobody I personally know wants a faster CPU; they want competent, faster, native feeling software and more power efficient hardware.
I think you miss the point: what you claim that users want is not something that hardware designers have a lot of influence on (except for the aspect that the IC should be (more) power-efficient): these are rather problems that software developers are there to solve. So, hardware designers are simply the wrong persons to ask if you have such wishes.