[cfe-dev] [OpenCL patch] support for __builtin_astype, __builtin_convert, __builtin_vec_step
Tanya Lattner
lattner at apple.com
Thu Feb 17 18:07:37 PST 2011
I realize there is already some patches to the mailing list regarding vecstep, astype, etc. I realize some discussion will need to be had to determine which is the right approach. I need to get caught up on the emails, but thought I would send this patch to the list first.
The attached patch adds support for builtins for astype, convert, and vec_step. I chose to group these together because they require very similar code modifications. I've included test cases for each.
Please consult the OpenCL spec for a full description but here is a brief summary of each:
__builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types.
__builtin_vec_step(): The vec_step built-in function takes a built-in scalar or vector data type argument and returns an integer value representing the number of elements in the scalar or vector.
__builtin_convert(): provides a way to perform scalar and vector conversions with rounding and saturation.
Please review.
Thanks,
Tanya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110217/7b135492/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asType.patch
Type: application/octet-stream
Size: 40047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110217/7b135492/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110217/7b135492/attachment-0001.html>
More information about the cfe-dev
mailing list