Improve handling of floating point literals in OpenCL to only use double precision...
authorNeil Hickey <neil.hickey@arm.com>
Mon, 14 Nov 2016 11:15:51 +0000 (11:15 +0000)
committerNeil Hickey <neil.hickey@arm.com>
Mon, 14 Nov 2016 11:15:51 +0000 (11:15 +0000)
commitf603672b5c98b958cc4114f0eeefde3a47168b63
treee5d0de74ec6caaed4347106333db50e3cf0bfe2a
parent6df8f27c95a514b19476a0e6f66107575281f158
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64.

This change makes sure single-precision floating point types are used if the
cl_fp64 extension is not supported by the target.

Also removed the check to see whether the OpenCL version is >= 1.2, as this has
been incorporated into the extension setting code.

Differential Revision: https://reviews.llvm.org/D24235

llvm-svn: 286815
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaType.cpp
clang/test/CodeGenOpenCL/fpmath.cl
clang/test/SemaOpenCL/extensions.cl