Implement .set dspr2 directive with appropriate feature bits. This directive is a counterpart of -mattr=dspr2 command line option with the exception that it does not influence elf header flags.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/MC/Mips/set-nodsp.s | ||
---|---|---|
1 ↗ | (On Diff #117656) | -mattr=+dsp seems redundant in presence of -mattr=+dspr2 Furthermore, DSP extension requires Rev2 at least, so the test should probable have -mcpu=mips32r2 GCC has a warning like: "Warning: the `dsp' extension requires MIPS32 revision 2 or greater'" It seems that LLVM does not do that. Maybe it should? |
test/MC/Mips/set-nodsp.s | ||
---|---|---|
1 ↗ | (On Diff #117656) |
Well spotted, though the test would have to be altered to test for the differences between dsp / dspr2.
I believe we should. I think we should be stricter but binutils already accepts code that combination of options so we should at least be as compatible / informative. Some quick testing shows that gas 2.24 only warns on the first instance of a particular error in the test cases I've tried for mixing directives to change the ISA revision. I'm leaning towards giving warnings where an ASE is enabled that requires a higher ISA revision by an assembler directive at every occurrence, along with a warning for incoherent command-line options, though that may be a bit verbose. Thoughts? Adding warnings for incompatible ASE/ISA revisions should be submitted as a separate patch. |
test/MC/Mips/set-nodsp.s | ||
---|---|---|
1 ↗ | (On Diff #117656) |
I do not have a strong opinion about it, I would probably vote for mimicking what gas does. |