Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
What exactly is the suggestion here? What needs to be changed in the code of the kata?
RISC-V srli Implementation Issue: It turn out not to be logical shift
If you're getting incorrect results with large inputs (especially numbers > 2^31), check your srli (Shift Right Logical Immediate) results. Some implementations might incorrectly perform arithmetic right shift instead of logical right shift.
Example of the issue:
Input: 3435973832
Correct srli result (input >> 3): 429496729
Incorrect result seen: 4187593113 (arithmetic shift behavior)
Brute Solution: Mask the result after shift to ensure upper bits are zero:
This issue particularly affects calculations involving division by powers of 2 using right shifts on large unsigned numbers.