[PATCH] D37231: Add half load and store builtins
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 29 04:36:25 PDT 2017
Anastasia added inline comments.
================
Comment at: include/clang/Basic/Builtins.def:1427
+// OpenCL half load/store builtin
+BUILTIN(__builtin_store_half, "vdh*", "n")
+BUILTIN(__builtin_store_halff, "vfh*", "n")
----------------
I think this should be a language builtin (see above) but perhaps we might need to extend the language version here. Because I believe we only have OpenCL v2.0 currently.
Also this should only be available if `cl_khr_fp16` is supported and enabled? I think we are doing similar with some subgroups functions (e.g. `get_kernel_sub_group_count_for_ndrange`) that are only supported by `cl_khr_subgroup` but those have custom diagnostic though. May be we could leave this check out since `half` is not available if `cl_khr_fp16` is not enabled anyways.
================
Comment at: test/CodeGenOpenCL/no-half.cl:3
+
+#pragma OPENCL EXTENSION cl_khr_fp64:enable
+
----------------
It seems strange that `cl_khr_fp16` is not enabled too.
Repository:
rL LLVM
https://reviews.llvm.org/D37231
More information about the cfe-commits
mailing list