Hello,
I am using v2.2.4 and v2.2.5.
While most of the immediate instructions (addi, srli, etc.) check for the immediate value to be within the allowed range, the lui instruction does not check for the same.
lui supports only 20-bit of immediate values. If we specify a larger range, the last 20-bits are only considered with extra bits being ignored. It would be rather better to display such instances as error so that any inadvertent typing mistakes are detected early.
Example: lui x9, 0x123456 will get used as lui x9, 0x23456
Can confirm that this indeed is a bug. At first glance, this seems to be related to width-checking logic in instruction.h not handling truncated integers correctly.
Hello, I am using v2.2.4 and v2.2.5. While most of the immediate instructions (addi, srli, etc.) check for the immediate value to be within the allowed range, the lui instruction does not check for the same. lui supports only 20-bit of immediate values. If we specify a larger range, the last 20-bits are only considered with extra bits being ignored. It would be rather better to display such instances as error so that any inadvertent typing mistakes are detected early.
Example: lui x9, 0x123456 will get used as lui x9, 0x23456
Regards, Rajesh