[llvm-dev] [RFC] Working around a PS2 hardware errata

Dan Ravensloft via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 6 14:59:29 PST 2018


The MIPS R5900 core that powers the PlayStation 2's CPU has a hardware bug
that affects very short loops of 6 or less instructions where the processor
may fail to branch under "special conditions" (don't you love vague
hardware manuals?)

The obvious solution is to pad the loop with NOPs so that it is bigger than
6 instructions long.

However, I have a few questions to ask about this.

First, where would I go about adding a pass that detects and works around
this hardware bug? Presumably it would have to go as a pass after
instruction selection, but I'm unfamiliar with LLVM internals in this case.

Second, assuming I implemented a fix for this, would it get merged
upstream? The R5900 isn't a supported processor by either LLVM or GCC, so I
could understand some reluctance to merge it, even hidden behind a target
feature.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181106/320f995c/attachment.html>


More information about the llvm-dev mailing list