[PATCH] D76181: [AVR] Add support for the -mdouble=x flag

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 14 11:48:01 PDT 2020


aykevl created this revision.
aykevl added reviewers: dylanmckay, MaskRay, hfinkel, rnk, rsmith.
Herald added subscribers: cfe-commits, Jim.
Herald added a project: clang.

This flag is used by avr-gcc (starting with v10) to set the width of the double type. The double type is by default interpreted as a 32-bit floating point number in avr-gcc instead of a 64-bit floating point number as is common on other architectures. Starting with GCC 10, a new option has been added to control this behavior:
https://gcc.gnu.org/wiki/avr-gcc#Deviations_from_the_Standard

This commit keeps the default double at 32 bits but adds support for the `-mdouble` flag (`-mdouble=32` and `-mdouble=64`) to control this behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76181

Files:
  clang/include/clang/Basic/LangOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/TargetInfo.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/mdouble.c
  clang/test/Driver/mdouble.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76181.250370.patch
Type: text/x-patch
Size: 4910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200314/01add95c/attachment.bin>


More information about the llvm-commits mailing list