This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: poly_uint64 / TYPE_VECTOR_SUBPARTS question
- From: Richard Sandiford <richard dot sandiford at linaro dot org>
- To: Steve Ellcey <sellcey at cavium dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Fri, 09 Feb 2018 17:15:34 +0000
- Subject: Re: poly_uint64 / TYPE_VECTOR_SUBPARTS question
- Authentication-results: sourceware.org; auth=none
- References: <1518127722.14236.3.camel@cavium.com>
Steve Ellcey <sellcey@cavium.com> writes:
> I have a question about the poly_uint64 type and the TYPE_VECTOR_SUBPARTS
> macro. I am trying to copy some code from i386.c into my aarch64 build
> that is basically:
>
> int n;
> n = TYPE_VECTOR_SUBPARTS (type_out);
>
> And it is not compiling for me, I get:
>
> /home/sellcey/gcc-vectmath/src/gcc/gcc/config/aarch64/aarch64-builtins.c:1504:37:
> error: cannot convert ‘poly_uint64’ {aka ‘poly_int<2, long unsigned
> int>’} to ‘int’ in assignment
> n = TYPE_VECTOR_SUBPARTS (type_out);
>
> My first thought was that I was missing a header file but I put
> all the header includes that are in i386.c into aarch64-builtins.c
> and it still does not compile. It works on the i386 side. It looks
> like poly-int.h and poly-int-types.h are included by coretypes.h
> and I include that header file so I don't understand why this isn't
> compiling and what I am missing. Any help?
Code in config/aarch64 needs to work with SVE, where TYPE_VECTOR_SUBPARTS
isn't necessarily a compile-time constant.
If the code you're adding is inherently specific to Advanced SIMD
(not sure, but guessing yes based on this being aarch64-builtins.c)
then like Kugan says, using to_constant is OK.
Which code are you copying over?
Thanks,
Richard