diff --git a/flang/runtime/complex-reduction.h b/flang/runtime/complex-reduction.h --- a/flang/runtime/complex-reduction.h +++ b/flang/runtime/complex-reduction.h @@ -16,6 +16,7 @@ #define FORTRAN_RUNTIME_COMPLEX_REDUCTION_H_ #include "entry-names.h" +#include struct CppDescriptor; /* dummy type name for Fortran::runtime::Descriptor */ diff --git a/flang/runtime/complex-reduction.c b/flang/runtime/complex-reduction.c --- a/flang/runtime/complex-reduction.c +++ b/flang/runtime/complex-reduction.c @@ -9,7 +9,6 @@ #include "complex-reduction.h" #include "flang/Common/long-double.h" -#include struct CppComplexFloat { float r, i; diff --git a/flang/runtime/reduction.h b/flang/runtime/reduction.h --- a/flang/runtime/reduction.h +++ b/flang/runtime/reduction.h @@ -51,8 +51,10 @@ int line, int dim = 0, const Descriptor *mask = nullptr); std::int64_t RTNAME(SumInteger8)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#ifdef __SIZEOF_INT128__ common::int128_t RTNAME(SumInteger16)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#endif // REAL/COMPLEX(2 & 3) return 32-bit float results for the caller to downconvert float RTNAME(SumReal2)(const Descriptor &, const char *source, int line, @@ -100,9 +102,11 @@ int line, int dim = 0, const Descriptor *mask = nullptr); std::int64_t RTNAME(ProductInteger8)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#ifdef __SIZEOF_INT128__ common::int128_t RTNAME(ProductInteger16)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#endif // REAL/COMPLEX(2 & 3) return 32-bit float results for the caller to downconvert float RTNAME(ProductReal2)(const Descriptor &, const char *source, int line, @@ -166,8 +170,10 @@ int line, int dim = 0, const Descriptor *mask = nullptr); std::int64_t RTNAME(MaxvalInteger8)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#ifdef __SIZEOF_INT128__ common::int128_t RTNAME(MaxvalInteger16)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#endif float RTNAME(MaxvalReal2)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); float RTNAME(MaxvalReal3)(const Descriptor &, const char *source, int line, @@ -191,8 +197,10 @@ int line, int dim = 0, const Descriptor *mask = nullptr); std::int64_t RTNAME(MivalInteger8)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#ifdef __SIZEOF_INT128__ common::int128_t RTNAME(MivalInteger16)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); +#endif float RTNAME(MinvalReal2)(const Descriptor &, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr); float RTNAME(MinvalReal3)(const Descriptor &, const char *source, int line, diff --git a/flang/runtime/reduction.cpp b/flang/runtime/reduction.cpp --- a/flang/runtime/reduction.cpp +++ b/flang/runtime/reduction.cpp @@ -253,11 +253,13 @@ TypeCategory::Integer, 8>( result, x, dim, mask, terminator, intrinsic); return; +#ifdef __SIZEOF_INT128__ case 16: PartialReduction>, TypeCategory::Integer, 16>( result, x, dim, mask, terminator, intrinsic); return; +#endif } break; case TypeCategory::Real: @@ -416,12 +418,14 @@ return GetTotalReduction(x, source, line, dim, mask, IntegerSumAccumulator>{x}, "SUM"); } +#ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(SumInteger16)(const Descriptor &x, const char *source, int line, int dim, const Descriptor *mask) { return GetTotalReduction(x, source, line, dim, mask, IntegerSumAccumulator>{x}, "SUM"); } +#endif // TODO: real/complex(2 & 3) CppTypeFor RTNAME(SumReal4)(const Descriptor &x, @@ -549,6 +553,7 @@ NonComplexProductAccumulator>{x}, "PRODUCT"); } +#ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(ProductInteger16)( const Descriptor &x, const char *source, int line, int dim, const Descriptor *mask) { @@ -557,6 +562,7 @@ NonComplexProductAccumulator>{x}, "PRODUCT"); } +#endif // TODO: real/complex(2 & 3) CppTypeFor RTNAME(ProductReal4)(const Descriptor &x, @@ -725,10 +731,12 @@ accumulator.GetResult( result.OffsetElement>()); break; +#ifdef __SIZEOF_INT128__ case 16: accumulator.GetResult( result.OffsetElement>()); break; +#endif default: terminator.Crash("%s: bad KIND=%d", intrinsic, kind); } @@ -786,10 +794,12 @@ DoMaxOrMinLoc( intrinsic, result, x, kind, source, line, mask, back); return; +#ifdef __SIZEOF_INT128__ case 16: DoMaxOrMinLoc( intrinsic, result, x, kind, source, line, mask, back); return; +#endif } break; case TypeCategory::Real: @@ -875,10 +885,12 @@ PartialReduction>, TypeCategory::Integer, 8>(result, x, dim, mask, terminator, intrinsic); break; +#ifdef __SIZEOF_INT128__ case 16: PartialReduction>, TypeCategory::Integer, 16>(result, x, dim, mask, terminator, intrinsic); break; +#endif default: terminator.Crash("%s: bad KIND=%d", intrinsic, kind); } @@ -925,10 +937,12 @@ DoPartialMaxOrMinLoc( intrinsic, result, x, kind, dim, mask, back, terminator); return; +#ifdef __SIZEOF_INT128__ case 16: DoPartialMaxOrMinLoc( intrinsic, result, x, kind, dim, mask, back, terminator); return; +#endif } break; case TypeCategory::Real: @@ -1101,11 +1115,13 @@ NumericExtremumAccumulator>( result, x, dim, mask, intrinsic, terminator); return; +#ifdef __SIZEOF_INT128__ case 16: DoMaxOrMin( result, x, dim, mask, intrinsic, terminator); return; +#endif } break; case TypeCategory::Real: @@ -1223,12 +1239,14 @@ return TotalNumericMaxOrMin( x, source, line, dim, mask, "MAXVAL"); } +#ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(MaxvalInteger16)( const Descriptor &x, const char *source, int line, int dim, const Descriptor *mask) { return TotalNumericMaxOrMin( x, source, line, dim, mask, "MAXVAL"); } +#endif // TODO: REAL(2 & 3) CppTypeFor RTNAME(MaxvalReal4)(const Descriptor &x, @@ -1280,12 +1298,14 @@ return TotalNumericMaxOrMin( x, source, line, dim, mask, "MINVAL"); } +#ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(MinvalInteger16)( const Descriptor &x, const char *source, int line, int dim, const Descriptor *mask) { return TotalNumericMaxOrMin( x, source, line, dim, mask, "MINVAL"); } +#endif // TODO: REAL(2 & 3) CppTypeFor RTNAME(MinvalReal4)(const Descriptor &x, @@ -1513,9 +1533,11 @@ case 8: CountDimension<8>(result, x, dim, terminator); break; +#ifdef __SIZEOF_INT128__ case 16: CountDimension<16>(result, x, dim, terminator); break; +#endif default: terminator.Crash("COUNT: bad KIND=%d", kind); }