riscvarchive / riscv-binutils-gdb

RISC-V backports for binutils-gdb. Development is done upstream at the FSF.
GNU General Public License v2.0
147 stars 233 forks source link

Riscv binutils 2.33.1 rvv 0.8.x constraint #188

Closed Nelson1225 closed 4 years ago

Nelson1225 commented 4 years ago

Currently, assembler is hard to know what the LMUL exactly is when assembling. Therefore, we can just check the part of the constraints in the static assemble-time.

The currently supported vector constraints:

Another thing is that we just report "Error: illegal operands" messages for all vector constraints now. It would be nice if we can report the clearer error message, so this may be the next stuff we can improve.

Thanks Best Regards Nelson

kito-cheng commented 4 years ago

Does it possible to provide more clear error message than just all Error: illegal operands ?

kito-cheng commented 4 years ago

Oh, I see your comment

Nelson1225 commented 4 years ago

Oh, I see your comment

Yes, and I think we can improve it by extend the "insn->match_func" in the riscv_ip.

For example, insn->match_func (insn, ip->insn_opcode, &error);

and then we can update different error message by different match_func.

But we need to check if other assembler changes are required. For now, when assembler parsing one assembly instruction, we will check all candidates which have the same opcode name. So stop the checking and report error message before the last candidate shouldn't be an expected behavior. Also, if there are too many candidates, then it is hard to report the correct error message, like the ".insn" directive. It would be nice if we can improve that :)

Nelson1225 commented 4 years ago

The series commits should be updated based on the following pull request https://github.com/riscv/riscv-binutils-gdb/pull/191

Therefore, I will fix the conflicts and update the commits after the above pull request is approved and merged :)

Thanks and best regards Nelson

Nelson1225 commented 4 years ago

Updated.

Nelson1225 commented 4 years ago

Thanks for the approval :) I will start to improve the error message recently.