diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-06-18 18:39:26 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-06-18 18:39:26 +0000 |
commit | ce13ae9b840355676c4a6df7d9013e4383a0f848 (patch) | |
tree | b298ad3a9ce2336f7c714aa8da8daca8557dda8d /lib/Sema | |
parent | c9b89cae0d29733c63e8f6d9c4d273b996d58f3c (diff) | |
download | clang-ce13ae9b840355676c4a6df7d9013e4383a0f848.tar.gz |
[OPENMP]Use host's long double when compiling the code for device.
The device code must use the same long double type as the host.
Otherwise the code cannot be linked and executed properly. Patch adds
only basic support and checks for supporting of the host long double
double on the device.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaOpenMP.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index a4eafb180a..19057eb398 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -1576,7 +1576,9 @@ void Sema::checkOpenMPDeviceExpr(const Expr *E) { "OpenMP device compilation mode is expected."); QualType Ty = E->getType(); if ((Ty->isFloat16Type() && !Context.getTargetInfo().hasFloat16Type()) || - (Ty->isFloat128Type() && !Context.getTargetInfo().hasFloat128Type()) || + ((Ty->isFloat128Type() || + (Ty->isRealFloatingType() && Context.getTypeSize(Ty) == 128)) && + !Context.getTargetInfo().hasFloat128Type()) || (Ty->isIntegerType() && Context.getTypeSize(Ty) == 128 && !Context.getTargetInfo().hasInt128Type())) targetDiag(E->getExprLoc(), diag::err_type_unsupported) |