Do this check because the ISA manual says (edited from the original translation):
If the AM* instruction has its rd == rj, an Instruction Non-defined Exception will be triggered when the instruction is executed.
If the AM* instruction has its rd == rk, the execution result is unpredictable. It is software's responsibility to avoid this situation.
Note that binutils does the same check except when rd == r0 but this
is undocumented.