[cfe-commits] [patch] command line options for MIPS float ABI configuration

Atanasyan, Simon satanasyan at mips.com
Wed Mar 14 12:26:27 PDT 2012


Hi,

MIPS backend supports three float point ABI: "hard", "soft" and "single". Clang driver does not support these float ABI correctly and has the following bugs:
1. The "single" float ABI is not supported at all.
2. It's impossible to turn on "hard" float ABI using command line. The driver accepts "-mhard-float" argument and pass it further but "-mhard-float" is not valid CC1 option.
3. If no one float ABI option is specified, the driver shows a warning and suggests to use "-mfloat-abi=soft" option. But this option is not supported for MIPS targets.
4. Clang does not define macros to mark selected float ABI (__mips_hard_float / __mips_soft_float / __mips_single_float).

The attached patch solves these problems by this way:
1. Clang driver accepts the following options for MIPS targets and configures the backend accordingly:
  "hard": "-mhard-float" or "-mfloat-abi=hard"
  "soft": "-msoft-float" or "-mfloat-abi=soft"
  "single": "-mfloat-abi=single"
2. Float ABI marker macros are defined.
3. If float ABI is not selected explicitly, the driver does not show any warning and uses "hard" ABI by default. I switched default float ABI to be compatible with gcc driver.

--
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-float-abi.patch
Type: application/octet-stream
Size: 7999 bytes
Desc: mips-float-abi.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120314/9dd83f22/attachment.obj>


More information about the cfe-commits mailing list