-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign-extending load for byte and word data #38
Comments
Seems reasonable as long as an eye is kept on how much complexity we introduce with changes that add new instructions and flags and generally things to remember. |
Actually I'm not sure why we need this. We have LOAD{W,B} and SIGX{W,B}. I'm not sure what benefit we get out of combining them. It adds unnecessary complexity to the implementation. The whole point of a RISC architecture is that we have a lot of orthogonal instructions: loads and sign-extension, not loads, sign-extension and sign-extending loads. We could do this, I'm just not sure that we should. |
I know that RISC doesn't mean "few instructions", but it does mean that memory access and data manipulation should be separated. I'm not sure if you think that we should consider sign-extension to be data manipulation, I think we should. |
Taking a quick look, the SPARC (the most classic RISC CPU) have loads with sign extend. I don't think that should add extra complexity. |
But why |
I think that this instruction would be very useful on assembly, not only to make the life more easier to an compiler, if not to make the life easy to everyone.
The idea is add two new load instructions : LOADSB and LOADSW
This two instructions does the same that LOADB and LOADW, but extends the sign, filling the most significant bits of the register with 0 or 1 on function of the sign of the read byte/word.
The text was updated successfully, but these errors were encountered: