Hacker News new | past | comments | ask | show | jobs | submit login

Just FYI, the RISC-V instruction encoding is considerably freakier than just about anything else you could be exploring except perhaps Thumb-2. They had good reasons to make it like that, but still, if you’re planning on reading hexdumps RISC-V is not going to go easy on you, even if it’s simple from most other angles.



I’m intrigued why you say this as my impression was that RISC-V coding was very straightforward.


It’s mostly the immediates, I mean, how could I not mention the immediates. The other parts are indeed arranged fairly straightforwardly, but trying to read off a 5-bit register field crossing a byte boundary when the instruction is written in little endian—or even just a three-bit field somewhere in the middle to figure out what the instruction even is—is less than pleasant.

Again, I recognize this makes things simpler, not more difficult, for the hardware, and even a compiler’s emitter will spend very little code dealing with it. But it’s not easy on the eyes.


Makes sense - thanks!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: