You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
I am seeing a problem with the SLLI/SRLI/SRAI commands for a RV32I target. . I have been
communicating with Palmer Dabbelt - he suggested I post this as an issue/bug.
The problem is the machine code for the 3 instructions are not following the spec for RV32I. It appears the 'shamt' field is overflowing into the higher order instruction words bits. According to the RiscV v2.1 spec, the upper 7 bits should be 0000000, 0000000, and 0100000 respectively for SLLI,SRLI, and SRAI.
I get the exact same list file and machine code for the following source code
Both source files are 'overloading' the 'shamt' field width. My expectation is for truncation and the machine code to look like the following when programing a 63 shamt value
I like the idea of error and halt for wrong shift amounts {'shamt'). My thinking is machine code that does not follow the RiscV spec, should not be generated.
I am seeing a problem with the SLLI/SRLI/SRAI commands for a RV32I target. . I have been
communicating with Palmer Dabbelt - he suggested I post this as an issue/bug.
What follows are primitive test cases.
RV32I assembly source file
assemble in the installed RiscV tools /bin directory
create a list file
The problem is the machine code for the 3 instructions are not following the spec for RV32I. It appears the 'shamt' field is overflowing into the higher order instruction words bits. According to the RiscV v2.1 spec, the upper 7 bits should be 0000000, 0000000, and 0100000 respectively for SLLI,SRLI, and SRAI.
I get the exact same list file and machine code for the following source code
Both source files are 'overloading' the 'shamt' field width. My expectation is for truncation and the machine code to look like the following when programing a 63 shamt value
01ff9f93 slli x31,x31,0x3f
01ff9f93 srli x31,x31,0x3f
41ff9f93 srai x31,x31,0x3f
Lastly - the RiscV toolchain was built from source.
This is on a recent 2017 install of openSUSE Leap 42.2
cheers
Dave
The text was updated successfully, but these errors were encountered: