[llvm-commits] PATCH: remove VICmp and VFCmp.

Dan Gohman gohman at apple.com
Wed Jul 8 17:04:06 PDT 2009


On Jul 8, 2009, at 3:57 PM, Chris Lattner wrote:


>
> On Jul 8, 2009, at 3:09 PM, Dan Gohman wrote:
>
>
>>>
>>>
>>> I haven't been tracking this, so can someone explain what the
>>>
>>> "vectors of
>>>
>>> i1 problem" is?  Is it a problem of how to generate code on
>>>
>>> architectures
>>>
>>> that don't have a mask concept?
>>>
>>
>>
>> Yes. One approach to the problem to require IR producers to know that
>>
>> certain targets require comparison results to be sign-extended into
>>
>> vectors of larger integer types. This is essentially the solution
>>
>> being used today.
>>
>
> I don't think this is related.  The reason that clang generates  
> compare
> +sext is that is how the comparison operators are defined at the C
> level in OpenCL.  It doesn't have anything to do with the capabilities
> of the hardware, it is the semantics of the "vec1 = vec2 < vec3"
> operation at the source level.

This just means that the OpenCL spec also happens to follow the
capabilities of current hardware. The point is that at present, LLVM
IR must be produced with vector comparison results explicitly
sign-extended in order to be translated into efficient code on
current hardware.

Dan




More information about the llvm-commits mailing list