Hacker News new | ask | show | jobs
by _chris_ 1598 days ago
Custom opcodes have a protected spot in the opcode map; but there's nothing that prevents two different CPUs from using the same custom opcode pattern to mean two different instructions.

Conceivably, you could trap, look up something like the mvendor/march CSRs to triangulate CPUID, and Do the Right Thing, but you usually added a custom opcode because you believe your performance/use-case depends on it.

Basically, your Option #3: "don't distribute binaries with custom instructions." If it's so important, it should get pushed through the standards process and then the binaries can be portable.

1 comments

Isn't embedded a big piece of RISC-V? How important is portability? And that being said, why have a software implementation anyway? Doesn't that risk destroying performance in unexpected ways?