Skip to content
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

sltiu note incorrect? (RV32I Base Integer Instructions) #18

Open
MarkGFaust opened this issue Mar 20, 2021 · 0 comments
Open

sltiu note incorrect? (RV32I Base Integer Instructions) #18

MarkGFaust opened this issue Mar 20, 2021 · 0 comments

Comments

@MarkGFaust
Copy link

Is this note correct? I believe the immediate field is sign extended (not zero extended) and then is treated (along with rs1) as an unsigned value for the comparison.

See RISC-V Instruction Set Manual, Volume I: Unprivileged ISA, December 13, 2019. Page 18:

"SLTI (set less than immediate) places the value 1 in register rd if register rs1 is less than the sign extended immediate when both are treated as signed numbers, else 0 is written to rd. SLTIU is
similar but compares the values as unsigned numbers (i.e., the immediate is first sign-extended to
XLEN bits then treated as an unsigned number)."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant