Details
- Reviewers
atanasyan
Diff Detail
Event Timeline
What's a goal of this change? Do you want to suppress an error message when the option provided to Clang? If so, is it a real-life case?
The goal of this patch is that if you have some C code with inline MIPS assembly language that uses MIPS3D instructions, you can get it to compile by passing -mmips3d on the command line. (Without this command line option, there's an awkward workaround that involves putting .set mips3d in your inline assembly language).
I will admit that not many MIPS cores support MIPS3D. The CHERI MIPS FPGA soft core, which may be one of the few remaining MIPS cores that anyone still cares about, currently supports the MIPS V paired single instructions but not (at present) MIPS3D, though instructions can easily be added.
The high-level view of the use case is digital signal processing code that can benefit from using MIPS3D in a few critical loops, running on a MIPS soft core that can be configured to support the desired instructions.
My bad, I missed that you implemented passing the option to backend.
Could you add some improvements to the patch?
- As far as I know GCC does not accept -mmips3d option. It uses -mips3d. We need do the same.
- Add test cases. For the reference you might take a look at the -mdspr2 option in the following tests:
test/Driver/mips-as.c test/Driver/mips-features.c test/Driver/mips-integrated-as.c
- GCC defines #define __mips3d 1 macro when the -mips3d option is provided. Take a look at the MipsTargetInfo::getTargetDefines() as a point for implementation.
- As far as I remember MIPS 3D requires 64-bit floating-point registers. We need to check that 64-bit is enabled and show an error otherwise like GCC does.
3 and 4 need test cases.