I was trying to test clang on FReeBSD/mips and came to conclusion that some additional
keys required to set proper target for compilation. This patch adds several knobs to clang/MIPS:
- floating point ABI (-msoft-float/-mhard-float)
- target CPU (-march=)
- target ABI (-mabi=)
Also byte order is set explicitly for toolchain assembler in based on target architecture
(mips/mipsel) so we don't rely on assembler default.
Shame on me. Forgot to attach the patch
clang-mips.diff (5.65 KB)
The semantics mostly look ok to me. I'm curious about choosing soft-float as a default?
The semantics mostly look ok to me. I'm curious about choosing
soft-float as a default?
I'm not familiar with MIPS, but if their processors are similar
to ARM cores ones, then most don't have a floating point unit.
And therefore they use soft-floating point.
(For ARM, there's a another option with the Linux-kernel FPU
emulator, but soft-float is faster compared to generating FPU
opcodes, trapping them and handling them in the kernel).
Most MIPS32 target I've been working with were FPU-less. My exposure to this type of
hardware is not that wide, after all, so default value for floating point ABI is open for discussion.
Hunh. Whereas almost all of the ones I've dealt with have FPUs. I don't care enough to hold it up on that basis though
I'll test the patch and commit if everything looks good.
This has been committed as:
[yendi:llvm/tools/clang] echristo% svn ci
Transmitting file data ...
Committed revision 97544.
Thanks for the patch!