The article said:
Members of the Chinese Jiachen Project are running a contest with an aim to develop a microcode for AMD's modern Zen-based CPU to make them execute RISC-V programs natively.
First of all, I just want to point out that this contest was linked in a prior article:
As with that article, you linked the Chinese language version of the page. At the top, there's a way to switch it to English, which I'll link here:
And, as I commented on that article, what the contest actually says is:
"Complete microcode modifications for Zen-series CPUs to enable direct execution of RISC-V binary programs. If direct execution is not feasible, optimize the modified microcode to achieve a significant level of acceleration for RISC-V binaries."
So, they're not asserting that it's indeed possible (which I doubt), but leaving open the possibility that contestants can at least devise some microcode tweaks that improve the efficiency of RISC-V emulation or JIT execution.
The article said:
internally, modern x86 cores rely on proprietary engines running a reduced instruction set computer (RISC) ISA to handle complicated instructions. The internal RISC ISAs are not documented, but they should generally be similar to well-known RISC ISAs
There's been some reverse-engineering work done. For those who know a little about assembly language and want to get a rough idea what the micro-ops look like, start here:
The article said:
The Jianchen Project members want to find someone, who can modify AMD's Zen CPU microcode on a modern processor — say, an EPYC 9004-series — to execute RISC-V binaries.
They should really focus on Zen 5, exclusively. It has 3x the microcode table size, which will almost certainly be necessary for the more interesting and profitable hacks. Note the author (
😉 ):
The article said:
Back in the mid-2010s, AMD planned to offer both x86-64 and Armv8-A Zen CPUs
The ARM core, based on Zen, was internally called the K12. It's the last thing Jim Keller was known to work on, before he left AMD (for the second time).
The article said:
so it is highly likely that there was a microcode for the Zen 1 microarchitecture that supported an Aarch64 front-end ISA. That said, Zen 1 CPUs could feature multiple microcode layer 'slots,' one supporting x86-64 and another Aarch64.
Not likely. Everything that's come out about it suggests it was a distinct core, just that it differed mostly in the front-end.
There have been CPUs which did some sort of realtime translation/emulation. I think Transmeta was one example. I seem to recall that Itanium also had some sort of x86 mode, which I believe involved some kind of hardware-assisted emulation. However, the resulting performance was quite lackluster, I'm sure mostly owing to the limitations of IA64.
The article said:
One commenter criticized the contest format, suggesting it is a way to get complex work done for less than $3,000 pay.
Yeah, my thought was that they'd do better by getting people to collaborate. However, the contest certainly sparked interest and garnered attention. Maybe they'll try to combine some of the best ideas from contest entrants into an open source project, afterwards, and welcome contestants to stay involved.
The article said:
it does not look like the contest will achieve the stated goal.
The real goal is just to increase RISC-V execution performance. Whether you can achieve native execution or not is sort of a detail. A secondary benefit (not sure if it's actually a goal) is to crowd-source reverse engineering of AMD's micro-op language, which should shed further insight into the microarchitecture of their CPUs.
I think a fruitful example of the sort of thing that might improve RISC-V emulation is this hack Apple made to the ARM ISA, in order to facilitate faster x86 emulation:
Rosetta 2 is remarkably fast when compared to other x86-on-ARM emulators. I’ve spent a little time looking at how it works, out of idle curiosity, and found it to be quite unusual, so I figur…
dougallj.wordpress.com