Closed Nelson1225 closed 4 years ago
Does it possible to provide more clear error message than just all Error: illegal operands
?
Oh, I see your comment
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 :)
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
Updated.
Thanks for the approval :) I will start to improve the error message recently.
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