This improves diagnostic by using the same changes set up to fix the same problem on AArch64, see D40363.
This applies to all instructions that contain a memory operand and are currently not disabled via some feature flag.
Paths
| Differential D143406
[MIPS] Asm: Improved diagnostics when a memory operand and unsupported CPU feature are involved Needs ReviewPublic Authored by Tazdevil971 on Feb 6 2023, 7:58 AM.
Details
Diff Detail
Unit TestsFailed Event TimelineComment Actions Don't worry, sorry to have pinged the wrong person. This is my first review here and I'm having troubles finding a reviewer. I think I'm going to ask on discourse. Thank you for your time! Comment Actions This makes sense to me, though a lot of targets leave it at its default false value still. Is there a situation where you wouldn't want this?
Comment Actions Yes and no, not all targets benefit from this the same way. Also it doesn't always work as intended, if you look at file llvm/test/MC/Mips/mips2/invalid-mips3-wrong-error.s, there is a case where it actually gives you worst diagnostics. It all depends on the target and how good the fallback parser is, in the case of MIPS it's pretty bad, as it only handles immediates and registers (thus the old "wrong operand" error, the fallback parser was incorrectly guessing the kind of operand, immediate instead of memory). As far as I understand the issue was similar with AArch64 as SVE added a lot of complexity to correctly guessing the kind of operand so they resorted to this solution. I think it's more of a case by case thing, and we should review each case individually.
Revision Contents
Diff 498686 llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/test/MC/Mips/cnmips/invalid-wrong-error.s
llvm/test/MC/Mips/cnmips/invalid.s
llvm/test/MC/Mips/eva/invalid-noeva-wrong-error.s
llvm/test/MC/Mips/eva/invalid-noeva.s
llvm/test/MC/Mips/eva/invalid_R6.s
llvm/test/MC/Mips/micromips32r6/invalid-wrong-error.s
llvm/test/MC/Mips/micromips32r6/invalid.s
llvm/test/MC/Mips/mips1/invalid-mips2-wrong-error.s
llvm/test/MC/Mips/mips1/invalid-mips2.s
llvm/test/MC/Mips/mips1/invalid-mips3-wrong-error.s
llvm/test/MC/Mips/mips1/invalid-mips3.s
llvm/test/MC/Mips/mips1/invalid-mips4-wrong-error.s
llvm/test/MC/Mips/mips1/invalid-mips4.s
llvm/test/MC/Mips/mips1/invalid-mips5.s
llvm/test/MC/Mips/mips2/invalid-mips3-wrong-error.s
llvm/test/MC/Mips/mips2/invalid-mips3.s
llvm/test/MC/Mips/mips2/invalid-mips4-wrong-error.s
llvm/test/MC/Mips/mips2/invalid-mips4.s
llvm/test/MC/Mips/mips32r6/invalid-mips1-wrong-error.s
llvm/test/MC/Mips/mips32r6/invalid-mips1.s
llvm/test/MC/Mips/mips64r6/invalid-mips1-wrong-error.s
llvm/test/MC/Mips/mips64r6/invalid-mips1.s
llvm/test/MC/Mips/mips64r6/invalid-mips3-wrong-error.s
llvm/test/MC/Mips/mips64r6/invalid-mips3.s
llvm/test/MC/Mips/target-soft-float.s
|
Please fix these