Wow! This might actually make it possible for Actually Portable Executable to support running on Windows ARM. I'm already putting the ARM code inside all my binaries. There's just never been a way to encode that in the PE headers. But if my emulated WinMain() function for x86-64 could detect that it's being emulated and then simply ask a WIN32 API to jump to the ARM entrypoint instead, it'd be the perfect solution to my problems. I actually think I'm going to rush out and buy a Windows ARM computer right now.
And this kind of beautiful insanity is why you're one of my favorite developers of this era.
Also,
> I'm already putting the ARM code inside all my binaries.
Wait, I thought CPU architecture was the one limitation that did affect APE - you mean on unix-likes APE binaries are already compatible across amd64 and aarch64?
Edit: rereading https://justine.lol/cosmo3/ it does say that, doesn't it - and ARM64 listing "Windows (non-native)" just means that one platform uses (for the next few hours-days, at least...) emulation. That's amazing:)
Windows 9x can run 16-bit realmode (V86), 16-bit protected mode, and 32-bit protected mode code in the same process by using different segment descriptors. Too bad amd64 wasn't compatible with that model, nor the virtualisation features that came afterwards, or Intel could've made ARM32/64-mode segments a reality if they decided to add an ARM decoder to their microarchitecture.
> ... 16-bit realmode (V86), 16-bit protected mode, and 32-bit protected mode code in the same process by using different segment descriptors...
> ...Intel could've made ARM32/64-mode segments a reality...
While I myself admire this particular breed of masochism, the direction that Intel currently wants to take is apparently quite the opposite.
In May last year, they proposed X86S[1][2][3] which tosses out 16-bit support completely, along with 32 bit kernel mode (i.e. the CPU boots directly into 64 bit mode, 32 bit code is only supported in ring 3).
The proposal trims a lot of historical baggage, including fancy segmentation/TSS shenanigans, privilege rings 1 & 2, I/O port access from ring 3, non-flat memory models, etc... limiting the CPU to 64 bit kernel mode, and 64 or 32 bit x86 user mode. With the requirement for 64 bit kernel mode, it effectively also removes un-paged memory access.
Sounds similar to what NVidia was doing with their Project Denver cores, using a mix of emulated ARM and native VLIW instructions with gradual compilation from one to another.
* Allows incremental porting of large codebases to ARM. (It's not always feasible to port everything at once-- I have a few projects with lots of hand-optimized SSE code, for example.)
* Allows usage of third-party x64 DLLs in ARM apps without recompilation. (Source isn't always available or might be too much of a headache to port on your own.)
I feel like binary translation is a better approach. It’s a temporary workaround that allows users to use non-native programs while they are ported properly. ARM64EC seems like it will incentivize “eh that’s good enough” partial porting efforts that will never result in a full port, while making the whole system more complicated, with a larger attack surface (binary translation also makes the system more complicated, but it seems more isolated/less integrated with the rest of OS).
The use-case is huge apps that have a native plugin ecosystem, think Photoshop and friends. Regular apps will typically just compile separate x64 and ARM64 versions
Yes, bite the bullet and port. Of course it makes no sense.
These sorts of things are only conceived in conversations between two huge corporations.
Like Microsoft needs game developers to build for ARM. There’s no market there. So their “people” author GPT-like content at each other, with a ratio of like 10 middlemen hours per 1 engineer hour, to agree to something that narratively fulfills a desire to build games for ARM. I can speculate endlessly how a conversation between MS and EA led to this exact standard but it’s meaningless, I mean both MS and EA do a ton of things that make no sense, and I can’t come up with nonsense answers.
Anyway, so this thing gets published many, many months after it got on some MS PM’s boss’s partner’s radar. Like the fucking devices are out! It’s too late for any of this to matter.
Is it really even a big enough concern to think about them? Windows 10 on ARM lacks x64 emulation support and the devices never sold well. I can't imagine there's too too many Windows 10 on ARM devices hanging around still running Windows 10.
Rosetta 2 operates on the process level -- on an Apple Silicon system, a process can run an ARM executable and run all ARM code, or can run an x86_64 executable and run all x86_64 code. ARM64EC allows processes to run a mixture of native and emulated code. Whether this is actually useful is debatable, but the option exists.
[+] [-] jart|1 year ago|reply
[+] [-] yjftsjthsd-h|1 year ago|reply
Also,
> I'm already putting the ARM code inside all my binaries.
Wait, I thought CPU architecture was the one limitation that did affect APE - you mean on unix-likes APE binaries are already compatible across amd64 and aarch64?
Edit: rereading https://justine.lol/cosmo3/ it does say that, doesn't it - and ARM64 listing "Windows (non-native)" just means that one platform uses (for the next few hours-days, at least...) emulation. That's amazing:)
[+] [-] mappu|1 year ago|reply
[+] [-] justinfrankel|1 year ago|reply
[+] [-] lewurm|1 year ago|reply
If you have an Apple Silicon machine you can run a Windows Insider build via UTM in a VM.
[+] [-] zorgmonkey|1 year ago|reply
[+] [-] dwattttt|1 year ago|reply
EDIT: Or maybe what you're looking for is hybrid PEs? https://ffri.github.io/ProjectChameleon/new_reloc_chpev2/
[+] [-] darby_nine|1 year ago|reply
[+] [-] dboreham|1 year ago|reply
Down the rabbit hole...
> buy a Windows ARM computer
You can still get Surface Pro X (16G/LTE) on Amazon for $800
[+] [-] szundi|1 year ago|reply
[+] [-] Aissen|1 year ago|reply
[+] [-] classichasclass|1 year ago|reply
[+] [-] userbinator|1 year ago|reply
[+] [-] st_goliath|1 year ago|reply
> ...Intel could've made ARM32/64-mode segments a reality...
While I myself admire this particular breed of masochism, the direction that Intel currently wants to take is apparently quite the opposite.
In May last year, they proposed X86S[1][2][3] which tosses out 16-bit support completely, along with 32 bit kernel mode (i.e. the CPU boots directly into 64 bit mode, 32 bit code is only supported in ring 3).
The proposal trims a lot of historical baggage, including fancy segmentation/TSS shenanigans, privilege rings 1 & 2, I/O port access from ring 3, non-flat memory models, etc... limiting the CPU to 64 bit kernel mode, and 64 or 32 bit x86 user mode. With the requirement for 64 bit kernel mode, it effectively also removes un-paged memory access.
[1] https://en.wikipedia.org/wiki/X86-64#X86S
[2] https://www.intel.com/content/www/us/en/developer/articles/t...
[3] https://news.ycombinator.com/item?id=36006446
[+] [-] Dwedit|1 year ago|reply
[+] [-] sylware|1 year ago|reply
Everything seems to converge more and more toward RISC-V these days.
[+] [-] Symmetry|1 year ago|reply
[+] [-] frozenport|1 year ago|reply
It seems like this is when you have the source or the libs but choose to mix x86 and arm?
It would seem if you have the source etc you should just bite the bullet and port everything.
[+] [-] adamjs|1 year ago|reply
* Allows incremental porting of large codebases to ARM. (It's not always feasible to port everything at once-- I have a few projects with lots of hand-optimized SSE code, for example.)
* Allows usage of third-party x64 DLLs in ARM apps without recompilation. (Source isn't always available or might be too much of a headache to port on your own.)
[+] [-] avidphantasm|1 year ago|reply
[+] [-] anaisbetts|1 year ago|reply
[+] [-] doctorpangloss|1 year ago|reply
These sorts of things are only conceived in conversations between two huge corporations.
Like Microsoft needs game developers to build for ARM. There’s no market there. So their “people” author GPT-like content at each other, with a ratio of like 10 middlemen hours per 1 engineer hour, to agree to something that narratively fulfills a desire to build games for ARM. I can speculate endlessly how a conversation between MS and EA led to this exact standard but it’s meaningless, I mean both MS and EA do a ton of things that make no sense, and I can’t come up with nonsense answers.
Anyway, so this thing gets published many, many months after it got on some MS PM’s boss’s partner’s radar. Like the fucking devices are out! It’s too late for any of this to matter.
You can’t play Overwatch on a Snapdragon whatever (https://www.pcgamer.com/hardware/gaming-laptops/emulation-pr... ) End of story. Who cares what the ABI details are.
Microsoft OWNS Blizzard and couldn’t figure this out. Whom is this for?
[+] [-] Tempest1981|1 year ago|reply
So what should developers do re: Win10 users? Separate builds for them?
[+] [-] goosedragons|1 year ago|reply
[+] [-] pjmlp|1 year ago|reply
In reality, yes, different builds, like it already happened with previous Windows versions.
[+] [-] AshamedCaptain|1 year ago|reply
If you meant x86 win10 users you can use the win11 sdk to target them
[+] [-] TiredOfLife|1 year ago|reply
Snapdragon 835 is also horribly slow.
[+] [-] spullara|1 year ago|reply
[+] [-] duskwuff|1 year ago|reply
[+] [-] anaisbetts|1 year ago|reply
[+] [-] tedunangst|1 year ago|reply
[+] [-] nomercy400|1 year ago|reply
If not, is this not just another target architecture? You cannot use it on arm64 architectures, and your app already supports x86.
[+] [-] ComputerGuru|1 year ago|reply