[llvm-commits] Patch: small fix to bit convert and shifts

Stefanus Du Toit stefanus.dutoit at rapidmind.com
Wed Dec 3 11:48:01 PST 2008


On 3-Dec-08, at 2:38 PM, Mon Ping Wang wrote:
>>> 2) In getNode, the code assumes that for shifts, the shift amount
>>> is always a scalar.  Since shifts can operate also on vectors, this
>>> assumption is not correct.
>>
>> The shift amount can be a vector as well? I thought operand 1 can be,
>> but not the shift amount.
>>
>
> I thought so though I am probably reading the lang ref liberally.

That was certainly our assumption/intent, in the interest of  
orthogonality (e.g. this makes the instruction far more convenient for  
an autovectorizer). Of course, machines may have vector x scalar shift  
instructions that can benefit from cases where the shift amount is a  
(replicated) scalar.

--
Stefanus Du Toit <stefanus.dutoit at rapidmind.com>
   RapidMind Inc.
   phone: +1 519 885 5455 x116 -- fax: +1 519 885 1463






More information about the llvm-commits mailing list