[LLVMdev] [PATCH] OpenCL half support

Anton Lokhmotov Anton.Lokhmotov at arm.com
Wed Feb 23 10:01:57 PST 2011


Please find attached Clang/LLVM patches for supporting 'half' - the
half-precision floating-point type, which in particular is used in OpenCL C.
Please review.

Background and motivation.  Whilst the half type is defined by IEEE 754-2008
as storage only (i.e. no arithmetic is supposed to be performed on values of
this type), it's growing in importance in embedded systems.  The cl_khr_fp16
extension of OpenCL lifts restrictions for declaring half variables and
arrays, dereferencing half pointers, performing arithmetic and conversions,
etc.  The latest version of the C++ ABI supports half as well.  Therefore,
we believe half should become a fundamental type in LLVM. (After all, LLVM
already supports x86_fp80, fp128 and ppc_fp128.)

Anton.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 00003-half-llvm.patch
Type: application/octet-stream
Size: 12007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110223/d954665d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 00003-half-clang.patch
Type: application/octet-stream
Size: 23695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110223/d954665d/attachment-0001.obj>


More information about the llvm-dev mailing list