Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does anyone know why the jal RISC-V instruction scrambles it bits in this way?

https://msyksphinz-self.github.io/riscv-isadoc/html/rvi.html...



RISC-V's instruction encoding is designed to keep the bits of literals in common positions between different instruction types. I believe this is to simplify/speed up instruction decoding. The MSB of the literal is always the MSB of the instruction, which makes sign extension consistent. Most of the other bits in the J-type encoding line up nicely with the I-type or U-type encodings.




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

Search: