Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

emulating x86 on ARM with any kind of real preformanceis additionally tricky because the x86 archetechure has very strong memory gaurentees (dosent matter if memory is aligned, dosent matter when in the instruction pipeline you access it, etc) that ARM isnt even close to matching.

Emulating that requires a massive performance hit, because you essentially have to check every single memory access to make sure its not doing something invalid on ARM.



From what I've heard, x86 to PPC or ARM emulators are doing dynamic recompiling and instrumentation. It catches the illegal memory accesses and rebuilds the code responsible to add paths with slower code with alignment compensation.

A lot of x86 code is aligned for speed already so it's a pretty safe bet to assume alignment and fix it up if wrong.


…or you design your own ARM CPU that handles unaligned memory accesses fine, and run your emulator on that hardware.


AFAIK the ARM license doesn't allow to invent arbitrary extensions to the ISA. So this might not be allowed.


Apple has an architectural license. I would expect that allows them to add instructions (assuming modern ARM still has the concept of instruction set extensions)

Google didn’t answer that for me, but I found out that there now is a ”cp15 sctlr[1] (alignment bit)”. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.... says this about it:

”3.5.1. Alignment faults

If alignment fault checking is enabled (the A bit in CP15 c1 is set), the MMU generates an alignment fault on any data word access if the address is not word-aligned, or on any halfword access if the address is not halfword-aligned, irrespective of whether the MMU is enabled or not. An alignment fault is not generated on any instruction fetch or any byte access.”




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: