Closed pcwang-thead closed 1 year ago
The immediate represents a shift amount and not the data width of the memory operation.
The displacement is calculated with zero_extend(_imm2_) << shamt
with shamt
being the immediate operand.
The fact that shamt
is not encoded in the instruction but "hard-wired" would allow us to skip it from the mnemonic.
This was discussed a couple of months ago, and it was decided to keep the shift amount in the mnemonic for the following reasons:
After the decision, the support for this extension landed in upstream Binutils. Binutils 2.40 was released a month ago and implements the currently documented mnemonic.
The immediate represents a shift amount and not the data width of the memory operation. The displacement is calculated with
zero_extend(_imm2_) << shamt
withshamt
being the immediate operand. The fact thatshamt
is not encoded in the instruction but "hard-wired" would allow us to skip it from the mnemonic.This was discussed a couple of months ago, and it was decided to keep the shift amount in the mnemonic for the following reasons:
- compatibility with existing code
- avoid programmer errors
After the decision, the support for this extension landed in upstream Binutils. Binutils 2.40 was released a month ago and implements the currently documented mnemonic.
Oh thanks for your reply , the reasons make sense to me then.
Actually, the
w
/d
in the name has indicated the data width.