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)
commit63492372c4709b48dd918e86640fd675856595a4
tree99660c8d1c0f2753c1f42b19340247a348523986
parentfb15e2bab5267213b8706fa6a29eeef94f62a524
aarch64: Use stdint types for SVE ACLE elements

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