Live data from Hacker News

Unicorn: lightweight, multi-platform, multi-architecture CPU emulator framework

unicorn-engine.org

41–42 of 42 posts

Re: Unicorn: lightweight, multi-platform, multi-architecture CPU emulator framework

#41

Earlier quoted context omitted.

Oh, my bad, misremembered.

You may be thinking of Rubinius?

Nah, I was thinking of JavaScriptCore. They replaced their last tier JIT a few years back; it used to be LLVM, but now it's a custom backend "B3".

Re: Unicorn: lightweight, multi-platform, multi-architecture CPU emulator framework

#42
post #32

Earlier quoted context omitted.

Hey, author of dynarmic here. > more context on why they're switching I started working on an AArch64 (ARMv8) frontend for dynarmic upon request from yuzu's developers. At the time, they decided to switch over because dynarmic has better performance compared to unicorn. To be honest, I feel like unicorn has instrumentation as a primary goal. Dynarmic has different goals: (a) performance and (b) ease of integration in…

QEMU hasn't got round to pointer-authentication yet either, so that's pretty good going. I like the "fuzz-test one implementation against another" approach. That's quite similar to how we test QEMU against real hardware (at least for straightforward userspace insns): https://git.linaro.org/people/peter.maydell/risu.git/tree/RE... (Upstream in QEMU we're talking/working on trying to improve our support for instrumenta…

> QEMU hasn't got round to pointer-authentication yet either, so that's pretty good going.

Thanks very much! I do however note we're not trying for full system emulation for v8; we're primarily interested in userspace emulation since that's our primary usecase, so system instructions aren't necessary for us, which does reduce our workload!

While we're on that topic, we make a few simplifying assumptions for performance reasons (e.g. no self-modifying code). Thinking about it, I feel like I should document these assumptions somewhere; I'll do that when I can.

> That's quite similar to how we test QEMU against real hardware

That's great! I love semi-automated testing.

An emulator vs emulator fuzz test has some advantages: You can test more instructions than you are able to on hardware. For example, you can test arbitrary jump instructions and memory instructions (assuming the emulations have sufficient instrumentation to catch arbitrary memory reads/writes and jumps off into the ether).

We fuzz against unicorn here: https://github.com/MerryMage/dynarmic/blob/master/tests/A64/.... This uses our instruction table (https://github.com/MerryMage/dynarmic/blob/master/src/fronte...) to generate instructions.

Post reply on HN