[cfe-dev] Sub-vector selection and CLang v5.0

Friedman, Eli via cfe-dev cfe-dev at lists.llvm.org
Fri Feb 16 13:36:14 PST 2018


On 2/16/2018 1:11 AM, ORiordan, Martin via cfe-dev wrote:
>
> Hi CFE-Devs,
>
> I received a bug report for a breaking change between CLang v4.0 and 
> v5.0 regarding sub-vectors that has been caused by:
>
> http://llvm.org/viewvc/llvm-project?view=revision&revision=298369
>
> The example is as follows:
>
> char16 v0, v1;
>
> ...
>
> v1.s0123456 = v0.s0123456; // Replace the 1^st 7-elements of ‘v1’ with 
> the 1^st 7-elements of ‘v0’
>
> which used to generate valid code, but which is now diagnosed with the 
> following error:
>
> error: vector component access has invalid length 7. Supported: 
> 1,2,3,4,8,16.
>
> However, I don’t see why it should not be possible to replace any 
> range of elements of a vector with a corresponding set of elements.
>

Vector swizzles are defined in the OpenCL standard, and 
https://www.khronos.org/registry/OpenCL/specs/opencl-2.2-cplusplus.html#builtin-vector-data-types 
says "vector-swizzle-selector shall have swizzle size of 1, 2, 3, 4, 8 
or 16."

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180216/be2cc8c8/attachment.html>


More information about the cfe-dev mailing list