]> gcc.gnu.org Git - gcc.git/commitdiff
aarch64: Use stdint types for SVE ACLE elements
authorRichard Sandiford <richard.sandiford@arm.com>
Sun, 10 Nov 2019 22:38:42 +0000 (22:38 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Jan 2020 16:22:13 +0000 (16:22 +0000)
I'd used mode-based element types in the SVE ACLE implementation, but
it turns out that they don't correspond to the <stdint.h> types used by
ILP32 newlib.  GCC already knows what the correct <stdint.h> types are,
I just wasn't using the right interface to find them.

A consequence of this is that ILP32 newlib code needs to cast "int *"
pointers to "int32_t *" before passing them to s32 loads and stores,
since int32_t is defined as "long int" rather than "int".  That matches
the normal C++ overloading behaviour for this target, where passing
"int *" to:

    void f(int32_t *);
    void f(int64_t *);

would be ambiguous.  It also matches the corresponding <arm_neon.h>
behaviour.

2020-01-21  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/aarch64-sve-builtins.def: Use get_typenode_from_name
to get the integer element types.

gcc/testsuite/
* gcc.target/aarch64/sve/acle/general-c/load_1.c (f1): Cast to
int32_t * rather than int *.
* gcc.target/aarch64/sve/acle/general-c/load_2.c (f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/load_gather_sv_1.c
(f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/load_gather_sv_2.c
(f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/load_gather_sv_restricted_1.c
(f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/load_replicate_1.c
(f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/store_1.c (f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/store_2.c (f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c
(f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c
(f1): Likewise.
* gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c
(f1): Likewise.

14 files changed:
gcc/ChangeLog
gcc/config/aarch64/aarch64-sve-builtins.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_2.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_gather_sv_1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_gather_sv_2.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_gather_sv_restricted_1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_replicate_1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_2.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c

index 63ff0bf0d83b716daa708127b4258349a586929f..e2f3d0db2cda9163b3db508b71b05bb5ccb0fc84 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-21  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/aarch64/aarch64-sve-builtins.def: Use get_typenode_from_name
+       to get the integer element types.
+
 2020-01-21  Richard Sandiford  <richard.sandiford@arm.com>
 
        * config/aarch64/aarch64-sve-builtins.h
index 040f1d8cb8f0781e085c7b3a3dbd0cd27e002ee6..a5a5aca58dd41f78b777ef9489da25eb687141ef 100644 (file)
@@ -64,14 +64,17 @@ DEF_SVE_TYPE (svbool_t, 10, __SVBool_t, boolean_type_node)
 DEF_SVE_TYPE (svfloat16_t, 13, __SVFloat16_t, aarch64_fp16_type_node)
 DEF_SVE_TYPE (svfloat32_t, 13, __SVFloat32_t, float_type_node)
 DEF_SVE_TYPE (svfloat64_t, 13, __SVFloat64_t, double_type_node)
-DEF_SVE_TYPE (svint8_t, 10, __SVInt8_t, intQI_type_node)
-DEF_SVE_TYPE (svint16_t, 11, __SVInt16_t, intHI_type_node)
-DEF_SVE_TYPE (svint32_t, 11, __SVInt32_t, intSI_type_node)
-DEF_SVE_TYPE (svint64_t, 11, __SVInt64_t, intDI_type_node)
-DEF_SVE_TYPE (svuint8_t, 11, __SVUint8_t, unsigned_intQI_type_node)
-DEF_SVE_TYPE (svuint16_t, 12, __SVUint16_t, unsigned_intHI_type_node)
-DEF_SVE_TYPE (svuint32_t, 12, __SVUint32_t, unsigned_intSI_type_node)
-DEF_SVE_TYPE (svuint64_t, 12, __SVUint64_t, unsigned_intDI_type_node)
+DEF_SVE_TYPE (svint8_t, 10, __SVInt8_t, get_typenode_from_name (INT8_TYPE))
+DEF_SVE_TYPE (svint16_t, 11, __SVInt16_t, get_typenode_from_name (INT16_TYPE))
+DEF_SVE_TYPE (svint32_t, 11, __SVInt32_t, get_typenode_from_name (INT32_TYPE))
+DEF_SVE_TYPE (svint64_t, 11, __SVInt64_t, get_typenode_from_name (INT64_TYPE))
+DEF_SVE_TYPE (svuint8_t, 11, __SVUint8_t, get_typenode_from_name (UINT8_TYPE))
+DEF_SVE_TYPE (svuint16_t, 12, __SVUint16_t,
+             get_typenode_from_name (UINT16_TYPE))
+DEF_SVE_TYPE (svuint32_t, 12, __SVUint32_t,
+             get_typenode_from_name (UINT32_TYPE))
+DEF_SVE_TYPE (svuint64_t, 12, __SVUint64_t,
+             get_typenode_from_name (UINT64_TYPE))
 
 DEF_SVE_TYPE_SUFFIX (b, svbool_t, bool, 8, VNx16BImode)
 DEF_SVE_TYPE_SUFFIX (b8, svbool_t, bool, 8, VNx16BImode)
index 2bb1d525d17ee0f23b62a0ad4d4f8fdfeb972860..4bea57e3968b931f961bc2b75c81ab4b09011825 100644 (file)
@@ -1,3 +1,25 @@
+2020-01-21  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * gcc.target/aarch64/sve/acle/general-c/load_1.c (f1): Cast to
+       int32_t * rather than int *.
+       * gcc.target/aarch64/sve/acle/general-c/load_2.c (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/load_gather_sv_1.c
+       (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/load_gather_sv_2.c
+       (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/load_gather_sv_restricted_1.c
+       (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/load_replicate_1.c
+       (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/store_1.c (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/store_2.c (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c
+       (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c
+       (f1): Likewise.
+       * gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c
+       (f1): Likewise.
+
 2020-01-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        PR target/92424
index 34f989bf8bb93200e87021808b105f2314403f3f..784fdc317e6a3014276eb26740a0672da09defc9 100644 (file)
@@ -13,7 +13,7 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr,
   svld1 (pg, s8_ptr, 0); /* { dg-error {too many arguments to function 'svld1'} } */
   svld1 (0, s8_ptr); /* { dg-error {passing 'int' to argument 1 of 'svld1', which expects 'svbool_t'} } */
   svld1 (pg, 0); /* { dg-error {passing 'int' to argument 2 of 'svld1', which expects a pointer type} } */
-  svld1 (pg, (int *) 0);
+  svld1 (pg, (int32_t *) 0);
   svld1 (pg, void_ptr); /* { dg-error {passing 'void \*' to argument 2 of 'svld1', but 'void' is not a valid SVE element type} } */
   svld1 (pg, s_ptr); /* { dg-error {passing 'struct s \*' to argument 2 of 'svld1', but 'struct s' is not a valid SVE element type} } */
   svld1 (pg, f32_ptr);
index beb07f138d78bc2631564bdc866d129aef89ed7e..a82887626955c7ce748fe9c9e77a82e518ece6fe 100644 (file)
@@ -13,7 +13,7 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr,
   svld1_s8 (pg, s8_ptr, 0); /* { dg-error {too many arguments to function 'svld1_s8'} } */
   svld1_s8 (0, 0); /* { dg-error {incompatible type for argument 1 of 'svld1_s8'} } */
   svld1_s8 (pg, 0);
-  svld1_s32 (pg, (int *) 0);
+  svld1_s32 (pg, (int32_t *) 0);
   svld1_s8 (pg, void_ptr);
   svld1_s8 (pg, s_ptr); /* { dg-warning {passing argument 2 of 'svld1_s8' from incompatible pointer type} } */
   svld1_f32 (pg, f32_ptr);
index 21566a9d96d2aa168cc686bf02cb2815a6d8bdab..4daede78dcb758c3e6f2c4387a6bf2fed976900d 100644 (file)
@@ -18,7 +18,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr,
   svld1_gather_offset (pg, s32_ptr, s32, 0); /* { dg-error {too many arguments to function 'svld1_gather_offset'} } */
   svld1_gather_offset (0, s32_ptr, s32); /* { dg-error {passing 'int' to argument 1 of 'svld1_gather_offset', which expects 'svbool_t'} } */
   svld1_gather_offset (pg, 0, s32); /* { dg-error {passing 'int' to argument 2 of 'svld1_gather_offset', which expects a pointer type} } */
-  svld1_gather_offset (pg, (int *) 0, s32);
+  svld1_gather_offset (pg, (int32_t *) 0, s32);
   svld1_gather_offset (pg, void_ptr, s32); /* { dg-error {passing 'void \*' to argument 2 of 'svld1_gather_offset', but 'void' is not a valid SVE element type} } */
   svld1_gather_offset (pg, s_ptr, s32); /* { dg-error {passing 'struct s \*' to argument 2 of 'svld1_gather_offset', but 'struct s' is not a valid SVE element type} } */
   svld1_gather_offset (pg, f32_ptr, s32);
index 4c15fc40c1095b1b914ede4c1cc40be9f60cfec1..65510cbe3f6289f13dceec819d0adb392f326fff 100644 (file)
@@ -18,7 +18,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr,
   svld1_gather_index (pg, s32_ptr, s32, 0); /* { dg-error {too many arguments to function 'svld1_gather_index'} } */
   svld1_gather_index (0, s32_ptr, s32); /* { dg-error {passing 'int' to argument 1 of 'svld1_gather_index', which expects 'svbool_t'} } */
   svld1_gather_index (pg, 0, s32); /* { dg-error {passing 'int' to argument 2 of 'svld1_gather_index', which expects a pointer type} } */
-  svld1_gather_index (pg, (int *) 0, s32);
+  svld1_gather_index (pg, (int32_t *) 0, s32);
   svld1_gather_index (pg, void_ptr, s32); /* { dg-error {passing 'void \*' to argument 2 of 'svld1_gather_index', but 'void' is not a valid SVE element type} } */
   svld1_gather_index (pg, s_ptr, s32); /* { dg-error {passing 'struct s \*' to argument 2 of 'svld1_gather_index', but 'struct s' is not a valid SVE element type} } */
   svld1_gather_index (pg, f32_ptr, s32);
index b12faadda559fb7bf07cc27f354375b787a6d865..51e11fca88a995420d01069bfb39f3c8f4d88c76 100644 (file)
@@ -20,7 +20,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr,
   svldnt1_gather_offset (pg, s32_ptr, s32, 0); /* { dg-error {too many arguments to function 'svldnt1_gather_offset'} } */
   svldnt1_gather_offset (0, s32_ptr, u32); /* { dg-error {passing 'int' to argument 1 of 'svldnt1_gather_offset', which expects 'svbool_t'} } */
   svldnt1_gather_offset (pg, 0, s32); /* { dg-error {passing 'int' to argument 2 of 'svldnt1_gather_offset', which expects a pointer type} } */
-  svldnt1_gather_offset (pg, (int *) 0, u32);
+  svldnt1_gather_offset (pg, (int32_t *) 0, u32);
   svldnt1_gather_offset (pg, void_ptr, u32); /* { dg-error {passing 'void \*' to argument 2 of 'svldnt1_gather_offset', but 'void' is not a valid SVE element type} } */
   svldnt1_gather_offset (pg, s_ptr, u32); /* { dg-error {passing 'struct s \*' to argument 2 of 'svldnt1_gather_offset', but 'struct s' is not a valid SVE element type} } */
   svldnt1_gather_offset (pg, f32_ptr, u32);
index d4ff76ea87175ee1bba64c81e2580286ca5b6568..ebcb0e85b1a9a0e26989edc4b4c7d9e5b515fd89 100644 (file)
@@ -13,7 +13,7 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr,
   svld1rq (pg, s8_ptr, 0); /* { dg-error {too many arguments to function 'svld1rq'} } */
   svld1rq (0, s8_ptr); /* { dg-error {passing 'int' to argument 1 of 'svld1rq', which expects 'svbool_t'} } */
   svld1rq (pg, 0); /* { dg-error {passing 'int' to argument 2 of 'svld1rq', which expects a pointer type} } */
-  svld1rq (pg, (int *) 0);
+  svld1rq (pg, (int32_t *) 0);
   svld1rq (pg, void_ptr); /* { dg-error {passing 'void \*' to argument 2 of 'svld1rq', but 'void' is not a valid SVE element type} } */
   svld1rq (pg, s_ptr); /* { dg-error {passing 'struct s \*' to argument 2 of 'svld1rq', but 'struct s' is not a valid SVE element type} } */
   svld1rq (pg, f32_ptr);
index 267db83f70fa7baab1d966a8a5c33cd50e82a4f3..625f059af448b8a8eb2ca569df76f63572c4eaa7 100644 (file)
@@ -16,7 +16,7 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr,
   svst1 (pg, void_ptr, 0); /* { dg-error {passing 'int' to argument 3 of 'svst1', which expects an SVE vector type} } */
   svst1 (pg, void_ptr, pg); /* { dg-error {'svst1' has no form that takes 'svbool_t' arguments} } */
   svst1 (pg, 0, s8);
-  svst1 (pg, (int *) 0, s8); /* { dg-warning "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */
+  svst1 (pg, (int32_t *) 0, s8); /* { dg-warning "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */
   svst1 (pg, void_ptr, s8);
   svst1 (pg, s_ptr, s8); /* { dg-warning "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */
   svst1 (pg, f32_ptr, s8); /* { dg-warning "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */
index 4e4fb3c6d66b957baf2850c777e11a57d9fbe336..c718b3ee04eebb9c32fbc9f8865ab48ee56abcfe 100644 (file)
@@ -18,7 +18,7 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr,
   svst1_vnum (pg, void_ptr, 0, 0); /* { dg-error {passing 'int' to argument 4 of 'svst1_vnum', which expects an SVE vector type} } */
   svst1_vnum (pg, void_ptr, 0, pg); /* { dg-error {'svst1_vnum' has no form that takes 'svbool_t' arguments} } */
   svst1_vnum (pg, 0, 0, s8);
-  svst1_vnum (pg, (int *) 0, 0, s8); /* { dg-warning "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */
+  svst1_vnum (pg, (int32_t *) 0, 0, s8); /* { dg-warning "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */
   svst1_vnum (pg, void_ptr, 0, s8);
   svst1_vnum (pg, s_ptr, 0, s8); /* { dg-warning "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */
   svst1_vnum (pg, f32_ptr, 0, s8); /* { dg-warning "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */
index 3209149b619a8bd495fb8aa71c7b2a4ae6de1f22..895282375227c53d80209ec5f56779a8ebab6dd2 100644 (file)
@@ -18,7 +18,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr,
   svst1_scatter_index (pg, s32_ptr, s32, s32, 0); /* { dg-error {too many arguments to function 'svst1_scatter_index'} } */
   svst1_scatter_index (0, s32_ptr, s32, s32); /* { dg-error {passing 'int' to argument 1 of 'svst1_scatter_index', which expects 'svbool_t'} } */
   svst1_scatter_index (pg, 0, s32, s32);
-  svst1_scatter_index (pg, (int *) 0, s32, s32);
+  svst1_scatter_index (pg, (int32_t *) 0, s32, s32);
   svst1_scatter_index (pg, void_ptr, s32, s32);
   svst1_scatter_index (pg, s_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32index_s32' from incompatible pointer type" } */
   svst1_scatter_index (pg, f32_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32index_s32' from incompatible pointer type" } */
index 8ee8129fa103e7672738cb05da72682fca0a3376..4854818cae6a6e82b121876e91058788890128cf 100644 (file)
@@ -18,7 +18,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr,
   svst1_scatter_offset (pg, s32_ptr, s32, s32, 0); /* { dg-error {too many arguments to function 'svst1_scatter_offset'} } */
   svst1_scatter_offset (0, s32_ptr, s32, s32); /* { dg-error {passing 'int' to argument 1 of 'svst1_scatter_offset', which expects 'svbool_t'} } */
   svst1_scatter_offset (pg, 0, s32, s32);
-  svst1_scatter_offset (pg, (int *) 0, s32, s32);
+  svst1_scatter_offset (pg, (int32_t *) 0, s32, s32);
   svst1_scatter_offset (pg, void_ptr, s32, s32);
   svst1_scatter_offset (pg, s_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32offset_s32' from incompatible pointer type" } */
   svst1_scatter_offset (pg, f32_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32offset_s32' from incompatible pointer type" } */
index aef152acf5b29437cb84dd70efde768b78882871..100624b7b0316002e6ead2b9b461df183e158152 100644 (file)
@@ -20,7 +20,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr,
   svstnt1_scatter_offset (pg, s32_ptr, u32, s32, 0); /* { dg-error {too many arguments to function 'svstnt1_scatter_offset'} } */
   svstnt1_scatter_offset (0, s32_ptr, u32, s32); /* { dg-error {passing 'int' to argument 1 of 'svstnt1_scatter_offset', which expects 'svbool_t'} } */
   svstnt1_scatter_offset (pg, 0, u32, s32);
-  svstnt1_scatter_offset (pg, (int *) 0, u32, s32);
+  svstnt1_scatter_offset (pg, (int32_t *) 0, u32, s32);
   svstnt1_scatter_offset (pg, void_ptr, u32, s32);
   svstnt1_scatter_offset (pg, s_ptr, u32, s32); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_u32offset_s32' from incompatible pointer type" } */
   svstnt1_scatter_offset (pg, f32_ptr, u32, s32); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_u32offset_s32' from incompatible pointer type" } */
This page took 0.079115 seconds and 5 git commands to generate.