riscv-isa-manual icon indicating copy to clipboard operation
riscv-isa-manual copied to clipboard

Inconsistency for Shift instructions in RV64I

Open ksungkeun84 opened this issue 10 months ago • 4 comments

Hello, I've found an inconsisten description about the encoding of shift instructions in RV64I. In page 36 (V20191213), specifically, it mentions that "The right shift type is encoded in bit 30." However, in the figure for SLLI/SRLI/SRAI/SLLIW/SRLIW/SRAIW, it seems that bit 30 is used to encode "Local" or "Arithmetic" shift.

If it is an actual issue and it needs to be fixed, I would like to contribute to fix it.

ksungkeun84 avatar Apr 16 '24 23:04 ksungkeun84

Logical vs. Arithmetic is what we mean by shift type. These are indeed the same bit.

aswaterman avatar Apr 16 '24 23:04 aswaterman

Hi @aswaterman, I see. "right" does not means a direction (left or right).

ksungkeun84 avatar Apr 17 '24 00:04 ksungkeun84

Actually, "right" does mean a direction. In this case bit30 determines the type of right shift, which can be either logical (which shifts in zeroes) or arithmetic (which shifts in sign bits). There are no different types of left shifts (there are always logical), so bit30 is only used for right shifts.

On Tue, Apr 16, 2024 at 5:01 PM Sungkeun Kim @.***> wrote:

Hi @aswaterman https://github.com/aswaterman, I see. "right" does not means a direction (left or right).

— Reply to this email directly, view it on GitHub https://github.com/riscv/riscv-isa-manual/issues/1349#issuecomment-2060090515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPXVJUHYXRN4HRTFS7ONHDY5W3T7AVCNFSM6AAAAABGKILITCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRQGA4TANJRGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

allenjbaum avatar Apr 17 '24 00:04 allenjbaum

Thanks @allenjbaum for the clarification :D

ksungkeun84 avatar Apr 17 '24 00:04 ksungkeun84