diff options
author | peter klausler <pklausler@nvidia.com> | 2021-04-02 08:26:39 -0700 |
---|---|---|
committer | peter klausler <pklausler@nvidia.com> | 2021-04-02 08:28:48 -0700 |
commit | dd43e13c005806be06bf09c735353a3d8707c8c8 (patch) | |
tree | b845f2afceb9f6f8a247581a739bfc87672323d4 /flang | |
parent | [GlobalISel] Allow different types for G_SBFX and G_UBFX operands (diff) | |
download | llvm-project-dd43e13c005806be06bf09c735353a3d8707c8c8.tar.gz llvm-project-dd43e13c005806be06bf09c735353a3d8707c8c8.tar.bz2 llvm-project-dd43e13c005806be06bf09c735353a3d8707c8c8.zip |
[flang] Fix MSVC build breakage
A recent patch exposed an assumption that "long double" is (at least)
an 80-bit floating-point type, which of course it is not in MSVC.
Also get it right for non-x87 floating-point.
Diffstat (limited to 'flang')
-rw-r--r-- | flang/lib/Decimal/binary-to-decimal.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/flang/lib/Decimal/binary-to-decimal.cpp b/flang/lib/Decimal/binary-to-decimal.cpp index c6e5ee80b3e4..68ee345b8935 100644 --- a/flang/lib/Decimal/binary-to-decimal.cpp +++ b/flang/lib/Decimal/binary-to-decimal.cpp @@ -350,12 +350,21 @@ ConversionToDecimalResult ConvertDoubleToDecimal(char *buffer, std::size_t size, rounding, Fortran::decimal::BinaryFloatingPointNumber<53>(x)); } +#if LONG_DOUBLE == 80 ConversionToDecimalResult ConvertLongDoubleToDecimal(char *buffer, std::size_t size, enum DecimalConversionFlags flags, int digits, enum FortranRounding rounding, long double x) { return Fortran::decimal::ConvertToDecimal(buffer, size, flags, digits, rounding, Fortran::decimal::BinaryFloatingPointNumber<64>(x)); } +#elif LONG_DOUBLE == 128 +ConversionToDecimalResult ConvertLongDoubleToDecimal(char *buffer, + std::size_t size, enum DecimalConversionFlags flags, int digits, + enum FortranRounding rounding, long double x) { + return Fortran::decimal::ConvertToDecimal(buffer, size, flags, digits, + rounding, Fortran::decimal::BinaryFloatingPointNumber<113>(x)); +} +#endif } template <int PREC, int LOG10RADIX> |