Commit graph

4 commits

Author SHA1 Message Date
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00
Martin
fdf74b6d6a Let LLVM parse floating-point literals instead of host C runtime 2017-03-25 22:16:16 +01:00
Johan Engelen
86965100dc Fix unused variable warnings for LLVM >= 4.0 (#2040) 2017-03-18 20:57:22 +01:00
Martin
0e71a760ae Limited support for arbitrary target reals
While parsing of floating-point literals and CTFE still operate with the
host LDC's real type, compile-time reals can in principle be emitted in
arbitrary precision via LLVM software conversion, therefore paving the way
for cross-compilation to all targets.

The representable constants are still limited by the compile-time real_t
precision. E.g., LDC on Windows with its 64-bit reals can't hold and emit
an 80-bit `real.max` when cross-compiling to a non-Windows x86(_64)
target; the compile-time value will silently overflow to infinity and
later be emitted as 80-bit infinity.

LDC on AArch64 with its 128-bit quad-precision reals on the other hand can
hold and emit reals for all targets, making it a universal cross-compiler
with quad-precision compile-time reals in hardware.

We don't use the strange 2x64-bit PPC double-double format (see
`getRealType()` in `ir/irtype.cpp`), but would more or less support it
(the type properties (max, min_normal...) still need to be determined;
LLVM isn't sure about those either...).
2017-02-11 14:24:46 +01:00