News for hackers. Stuff that matters.
Re:ARM-Ed Mac: We Have an Answer by wolfgke on Sunday March 22, 2020 @06:48PM (#22659491)
> One day they _may_ be sufficiently better than Intel that Apple could pull a “Rosetta” a second time on the Mac, translating apps from x86 to ARM at the software level.

Emulating x86 on ARM is very hard because x86 has a strong memory model while ARM has a weak one. This either makes emulation very slow or will break lots of multithreaded applications.

The other emulation direction (ARM on x86) works much better.

Re:ARM-Ed Mac: We Have an Answer by jlokier on Sunday March 22, 2020 @08:41PM (#22660228)
That's true for now. But due to RISC-V's openness, ARM has recently started allowing licensees to add extra features to the architecture.

If emulation were taken seriously, Apple could add extra features to their ARM-ISA processors in support of x86 emulation, including x86 compatible implicit memory barriers.

Re:ARM-Ed Mac: We Have an Answer by doyouevensunbro on Sunday March 22, 2020 @09:06PM (#22660357)
Don’t they still have to deal with the fact that Intel has been vocal about suing anyone doing x86 emulation?
Re:ARM-Ed Mac: We Have an Answer by jlokier on Sunday March 22, 2020 @11:00PM (#22660863)
QEMU exists and so do others, and has for many years, so I think x86 software emulation might turn out to be fair game.

In fact, out of Intel and ARM, ARM is the only one I know that tried to shut down software emulation...

(ARM blocked parts of QEMU from being published for a while, citing "you must have read the manual to implement this therefore you are bound by the terms of the manual". They also had an open source design removed from OpenCores.)

It would not be completely silly to modify QEMU with x86 guest and modified-ARM target (for implicit-barrier mode), and then just use QEMU for the emulation.

As long as implicit-barrier mode was generic enough I think Intel would have an interesting time claiming it infringed some patent of theirs. Making it efficient would remain Apple's problem but they are good at that. (Or were until the CPU designers left to start Nuvia.)

If Intel won that, implicit-barrier would have to be explicit-barrier which is just normal ARM, but there is no fundamental reason why that cannot be fast, if the processor is designed to expect a lot of barriers and optimised accordingly. Especially if a dense instruction encoding is created for it.

(Everything I just said applies to RISC-V as well as ARM, should Apple decide to change course again.)

Re:ARM-Ed Mac: We Have an Answer by doyouevensunbro on Monday March 23, 2020 @02:48AM (#22661787)
Ok I’m not completely crazy, found the article:

https://www.forbes.com/sites/tiriasresearch/2017/06/16/intel...

Thanks for clearing that up. Wonder what the difference is that this article mentions.

Re:ARM-Ed Mac: We Have an Answer by mrpippy on Monday March 23, 2020 @02:24AM (#22661699)
Have they? I've never heard anything about that. Microsoft has been shipping x86 emulation in ARM64 machines for the past few years. (And does original Xbox back-compat emulate x86 also? Or was it statically recompiled to PPC somehow?)
Re:ARM-Ed Mac: We Have an Answer by scarface74 on Sunday March 22, 2020 @11:40PM (#22661054)
There have been x86 emulators forever. I had SoftPC in 1992
Re:ARM-Ed Mac: We Have an Answer by fulafel on Monday March 23, 2020 @02:19AM (#22661681)
I think it's a safe guess that such an emulation would be made correctness-first.

But most apps are not very parallelized, only computationally heavy ones are. Those are of course going to suffer from emulation anyway. As a performance lower bound we can imagine that it would emulate a single-core x86 so the memory model differences wouldn't come into play.

Microsoft already has x86 emulation working in Windows for ARM, anyone know implementation details of that, or even publications?

Re:ARM-Ed Mac: We Have an Answer by wolfgke on Monday March 23, 2020 @04:09AM (#22662052)
> Microsoft already has x86 emulation working in Windows for ARM, anyone know implementation details of that, or even publications?

It seems to depend on a feature that is specific for Qualcomm processors: https://news.ycombinator.com/item?id=14318877

Re:ARM-Ed Mac: We Have an Answer by kyberias on Monday March 23, 2020 @05:10AM (#22662278)
> Emulating x86 on ARM is very hard because x86 has a strong memory model while ARM has a weak one.

I know that to be true, but could you point me to some articles and documentation that tell more. I'd like to learn more.

Re:ARM-Ed Mac: We Have an Answer by wolfgke on Monday March 23, 2020 @10:19AM (#22664315)
Re:ARM-Ed Mac: We Have an Answer by kyberias on Monday March 23, 2020 @04:20PM (#22668303)
Oh, right, looks like I didn't learn that the last time (two years ago) :D Thanks, again.