[llvm-commits] [PATCH] Add support for lowering FNEG with AVX

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Wed Dec 14 16:53:03 PST 2011


On Wed, Dec 14, 2011 at 10:39 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
>
> On Dec 14, 2011, at 4:37 PM, Chad Rosier wrote:
>
>>
>> On Dec 14, 2011, at 4:27 PM, Bruno Cardoso Lopes wrote:
>>>
>>> +    if (NumBits == 256) {
>>> +      CV.push_back(C);
>>> +      CV.push_back(C);
>>> +    }
>>>  } else {
>>>    Constant *C = ConstantFP::get(*Context, APFloat(APInt(32, 1U << 31)));
>>>    CV.push_back(C);
>>>    CV.push_back(C);
>>>    CV.push_back(C);
>>>    CV.push_back(C);
>>> +    if (NumBits == 256) {
>>> +      CV.push_back(C);
>>> +      CV.push_back(C);
>>> +      CV.push_back(C);
>>> +      CV.push_back(C);
>>> +    }
>>>
>>> If you iterate over the number of elements to push_back the constants,
>>> you can make it more general and don't need to get the size here.
>>
>> Sure, easy fix.
>
> Note that SmallVector has these methods:
>
>  void append(size_type NumInputs, const T &Elt);
>  void assign(unsigned NumElts, const T &Elt);

Better yet! :)


-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc




More information about the llvm-commits mailing list