[cfe-dev] [OpenCL patch] asType, Convert
Tanya Lattner
lattner at apple.com
Wed May 25 15:32:25 PDT 2011
On May 25, 2011, at 3:18 PM, Eli Friedman wrote:
> On Wed, May 25, 2011 at 3:08 PM, Tanya Lattner <lattner at apple.com> wrote:
>> 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.
>> __builtin_astype(): Used to reinterpreted as another data type of the same
>> size using for both scalar and vector data types.
>> __builtin_convert(): provides a way to perform scalar and vector conversions
>> with rounding and saturation.
>> I have fixed the concerns with asType and other areas as mentioned by Guy
>> Benyei in his review.
>> If there is no further objection and because this patch has had extensive
>> review and has been out there for a long time, I feel this is ready to be
>> committed and plan to do so shortly.
>
> Nits:
>
> + Args.push_back(llvm::ConstantInt::get(
> +
> llvm::Type::getInt32Ty(CGF.getLLVMContext()), 0));
> + Args.push_back(llvm::ConstantInt::get(
> +
> llvm::Type::getInt32Ty(CGF.getLLVMContext()), 1));
> + Args.push_back(llvm::ConstantInt::get(
> +
> llvm::Type::getInt32Ty(CGF.getLLVMContext()), 2));
>
> Builder.getInt32
>
>
> + llvm::ConstantInt::get(llvm::Type::getInt32Ty(CGF.getLLVMContext()),
> + + E->getRoundingMode());
> + Value *Sat =
> + llvm::ConstantInt::get(llvm::Type::getInt32Ty(CGF.getLLVMContext()),
> + + E->getSat());
>
> Builder.getInt32
>
>
Thanks. Updating patch and resending.
> Index: docs/doxygen.cfg
> ===================================================================
> --- docs/doxygen.cfg (revision 129616)
> +++ docs/doxygen.cfg (working copy)
> @@ -23,14 +23,14 @@
>
> I assume you didn't mean to include this diff?
haha.. no. Thanks!
-Tanya
>
> -Eli
More information about the cfe-dev
mailing list