XUANTIE-RV / thead-extension-spec

XuanTie vendor extension Instruction Set spec
Apache License 2.0
30 stars 20 forks source link

mempair: Remove unneeded 5th imm operand in XTheadMemPair #24

Closed pcwang-thead closed 1 year ago

pcwang-thead commented 1 year ago

Actually, the w/d in the name has indicated the data width.

cmuellner commented 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.

pcwang-thead commented 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:

  • 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.