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 | 8557d1ac98847565d706e19a426d044504b9a1aa (patch) | |
tree | a9c51d6e9f1cb19c9c87f5991776a6dcfe4b3c0f /clang/lib/Sema/SemaOpenMP.cpp | |
parent | 5bef886cd8e541cca299a479068f36c567cbf401 (diff) | |
download | bcm5719-llvm-8557d1ac98847565d706e19a426d044504b9a1aa.tar.gz bcm5719-llvm-8557d1ac98847565d706e19a426d044504b9a1aa.zip |
[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.
llvm-svn: 363717
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index a4eafb180a1..19057eb3986 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/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) |