This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Vector shifting patch


Ok, I can do that.

On Mon, Oct 25, 2010 at 3:47 PM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> On Mon, Oct 25, 2010 at 03:42:47PM +0100, Artem Shinkarov wrote:
>> I'm continuing to submit my vector patches. Now it is vector shifting
>> patch.
>>
>> Index: gcc/tree.c
>> ===================================================================
>> --- gcc/tree.c ? ? ? ?(revision 165913)
>> +++ gcc/tree.c ? ? ? ?(working copy)
>> @@ -1366,6 +1366,27 @@ build_vector_from_ctor (tree type, VEC(c
>> ? ?return build_vector (type, nreverse (list));
>> ?}
>>
>> +/* Build a vector of type VECTYPE where all the elements are SCs. ?*/
>> +tree
>> +build_vector_from_val (const tree sc, const tree vectype)
>> +{
>> + ?tree t = NULL_TREE;
>> + ?int i, nunits = TYPE_VECTOR_SUBPARTS (vectype);
>> +
>> + ?if (sc == error_mark_node)
>> + ? ?return sc;
>> +
>> + ?gcc_assert (TREE_TYPE (sc) == TREE_TYPE (vectype));
>> +
>> + ?for (i = 0; i < nunits; ++i)
>> + ? ?t = tree_cons (NULL_TREE, sc, t);
>> +
>> + ?if (CONSTANT_CLASS_P (sc))
>> + ? ?return build_vector (vectype, t);
>> + ?else
>> + ? ?return build_constructor_from_list (vectype, t);
>> +}
>> +
>
> Would you mind rewriting this to use build_vector_from_ctor/build_constructor?
> build_constructor_from_list is nearly eradicated from the tree and it'd
> be nice to keep it that way.
>
> -Nathan
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]