Improve handling of floating point literals for OpenCL.
If the target doesn't support cl_khr_fp64 extension, floating point literals should remain single precision.
Differential D24235
[OpenCL] Improve floating point literal handling neil.hickey on Sep 5 2016, 7:53 AM. Authored by
Details
Improve handling of floating point literals for OpenCL. If the target doesn't support cl_khr_fp64 extension, floating point literals should remain single precision.
Diff Detail Event TimelineComment Actions Could we add a CodeGen test as well to check that the constants generated are in the right precision format?
Comment Actions Modifying formating to match LLVM style. Adding new test to confirm that the vararg for printf is cast up to a double is allowable.
Comment Actions There was a bug whereby an implicitcast was being applied from float to float, this caused issues later on in builin processing which caused an assertion. This changed patch removes the duplicate, superfluous, cast.
Comment Actions Sorry for the delay. It looks like the code to handle extensions was changed since Neil Henning added the check against opencl 1.2. Perhaps the best approach is just to remove the check.
Comment Actions Fixes to tests and removal of incorrect check to stop float to float casts if types match. This was still needed as it was an lvalue to rvalue cast. Added extra code in SemaChecking to allow a float to float cast to appear and be handled. |
The comment should mention float -> float now as well.