From: Richard Sandiford Date: Thu, 9 Jan 2020 15:21:47 +0000 (+0000) Subject: [AArch64] Rename SVE shape "unary_count" to "unary_to_uint" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b052959dcd2e9c390c7de34f806c4b22a66d8f7;p=gcc.git [AArch64] Rename SVE shape "unary_count" to "unary_to_uint" The SVE ACLE shape names use "_int" and "_uint" for arguments that are signed-integer or unsigned-integer variants of the main vector type. With SVE2 this variation also becomes common for return values, which the main SVE2 patch handles using "_to_int" and "_to_uint". This patch renames the existing unary_count shape to match the new scheme. 2020-01-09 Richard Sandiford gcc/ * config/aarch64/aarch64-sve-builtins-shapes.h (unary_count): Delete. (unary_to_uint): Define. * config/aarch64/aarch64-sve-builtins-shapes.cc (unary_count_def) (unary_count): Rename to... (unary_to_uint_def, unary_to_uint): ...this. * config/aarch64/aarch64-sve-builtins-base.def: Update accordingly. gcc/testsuite/ * gcc.target/aarch64/sve/acle/general-c/unary_count_1.c: Rename to... * gcc.target/aarch64/sve/acle/general-c/unary_to_uint_1.c: ...this. * gcc.target/aarch64/sve/acle/general-c/unary_count_2.c: Rename to... * gcc.target/aarch64/sve/acle/general-c/unary_to_uint_2.c: ...this. * gcc.target/aarch64/sve/acle/general-c/unary_count_3.c: Rename to... * gcc.target/aarch64/sve/acle/general-c/unary_to_uint_3.c: ...this. From-SVN: r280052 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c2a4a92d69..ad7f519521c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2020-01-09 Richard Sandiford + + * config/aarch64/aarch64-sve-builtins-shapes.h (unary_count): Delete. + (unary_to_uint): Define. + * config/aarch64/aarch64-sve-builtins-shapes.cc (unary_count_def) + (unary_count): Rename to... + (unary_to_uint_def, unary_to_uint): ...this. + * config/aarch64/aarch64-sve-builtins-base.def: Update accordingly. + 2020-01-09 Richard Sandiford * config/aarch64/aarch64-sve-builtins-functions.h diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.def b/gcc/config/aarch64/aarch64-sve-builtins-base.def index 4cb7da70977..cd0a9bef08f 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-base.def +++ b/gcc/config/aarch64/aarch64-sve-builtins-base.def @@ -47,8 +47,8 @@ DEF_SVE_FUNCTION (svbrkpb, binary, b, z) DEF_SVE_FUNCTION (svcadd, binary_rotate, all_float, mxz) DEF_SVE_FUNCTION (svclasta, clast, all_data, implicit) DEF_SVE_FUNCTION (svclastb, clast, all_data, implicit) -DEF_SVE_FUNCTION (svcls, unary_count, all_signed, mxz) -DEF_SVE_FUNCTION (svclz, unary_count, all_integer, mxz) +DEF_SVE_FUNCTION (svcls, unary_to_uint, all_signed, mxz) +DEF_SVE_FUNCTION (svclz, unary_to_uint, all_integer, mxz) DEF_SVE_FUNCTION (svcmla, ternary_rotate, all_float, mxz) DEF_SVE_FUNCTION (svcmla_lane, ternary_lane_rotate, hs_float, none) DEF_SVE_FUNCTION (svcmpeq, compare_opt_n, all_data, implicit) @@ -65,7 +65,7 @@ DEF_SVE_FUNCTION (svcmpne, compare_opt_n, all_data, implicit) DEF_SVE_FUNCTION (svcmpne_wide, compare_wide_opt_n, bhs_signed, implicit) DEF_SVE_FUNCTION (svcmpuo, compare_opt_n, all_float, implicit) DEF_SVE_FUNCTION (svcnot, unary, all_integer, mxz) -DEF_SVE_FUNCTION (svcnt, unary_count, all_data, mxz) +DEF_SVE_FUNCTION (svcnt, unary_to_uint, all_data, mxz) DEF_SVE_FUNCTION (svcntb, count_inherent, none, none) DEF_SVE_FUNCTION (svcntb_pat, count_pat, none, none) DEF_SVE_FUNCTION (svcntd, count_inherent, none, none) diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc index 6da093c81ba..69a062124f3 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc @@ -2104,27 +2104,6 @@ struct unary_convert_def : public overloaded_base<1> }; SHAPE (unary_convert) -/* sv_t svfoo[_t0](sv_t) - - i.e. a version of "unary" in which the returned vector contains - unsigned integers. */ -struct unary_count_def : public overloaded_base<0> -{ - void - build (function_builder &b, const function_group_info &group) const OVERRIDE - { - b.add_overloaded_functions (group, MODE_none); - build_all (b, "vu0,v0", group, MODE_none); - } - - tree - resolve (function_resolver &r) const OVERRIDE - { - return r.resolve_unary (TYPE_unsigned); - } -}; -SHAPE (unary_count) - /* sv_t svfoo[_n]_t0(_t). */ struct unary_n_def : public overloaded_base<1> { @@ -2156,6 +2135,27 @@ struct unary_pred_def : public nonoverloaded_base }; SHAPE (unary_pred) +/* sv_t svfoo[_t0](sv_t) + + i.e. a version of "unary" in which the returned vector contains + unsigned integers. */ +struct unary_to_uint_def : public overloaded_base<0> +{ + void + build (function_builder &b, const function_group_info &group) const OVERRIDE + { + b.add_overloaded_functions (group, MODE_none); + build_all (b, "vu0,v0", group, MODE_none); + } + + tree + resolve (function_resolver &r) const OVERRIDE + { + return r.resolve_unary (TYPE_unsigned); + } +}; +SHAPE (unary_to_uint) + /* sv_t svfoo[_t0](sv_t) where always belongs a certain type class, and where diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.h b/gcc/config/aarch64/aarch64-sve-builtins-shapes.h index e9a429bb3f9..151371289e2 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.h +++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.h @@ -135,9 +135,9 @@ namespace aarch64_sve extern const function_shape *const tmad; extern const function_shape *const unary; extern const function_shape *const unary_convert; - extern const function_shape *const unary_count; extern const function_shape *const unary_n; extern const function_shape *const unary_pred; + extern const function_shape *const unary_to_uint; extern const function_shape *const unary_uint; extern const function_shape *const unary_widen; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cdb8e0df72a..943b632adc7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2020-01-09 Richard Sandiford + + * gcc.target/aarch64/sve/acle/general-c/unary_count_1.c: Rename to... + * gcc.target/aarch64/sve/acle/general-c/unary_to_uint_1.c: ...this. + * gcc.target/aarch64/sve/acle/general-c/unary_count_2.c: Rename to... + * gcc.target/aarch64/sve/acle/general-c/unary_to_uint_2.c: ...this. + * gcc.target/aarch64/sve/acle/general-c/unary_count_3.c: Rename to... + * gcc.target/aarch64/sve/acle/general-c/unary_to_uint_3.c: ...this. + 2020-01-09 Richard Sandiford * gcc.target/aarch64/sve/acle/general/nrv_1.c: New test. diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_1.c deleted file mode 100644 index 888b52513ef..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* { dg-do compile } */ - -#include - -void -f1 (svbool_t pg, svint32_t s32, svuint32_t u32, svfloat32_t f32, - svint64_t s64, svuint64_t u64) -{ - svclz_m (u32, pg); /* { dg-error {too few arguments to function 'svclz_m'} } */ - svclz_m (u32, pg, s32, s32); /* { dg-error {too many arguments to function 'svclz_m'} } */ - svclz_m (0, pg, f32); /* { dg-error {passing 'int' to argument 1 of 'svclz_m', which expects an SVE vector type} } */ - svclz_m (u32, u32, f32); /* { dg-error {passing 'svuint32_t' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ - svclz_m (u32, 0, f32); /* { dg-error {passing 'int' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ - svclz_m (u32, pg, s32); - svclz_m (u32, pg, u32); - svclz_m (u32, pg, f32); /* { dg-error {'svclz_m' has no form that takes 'svfloat32_t' arguments} } */ - svclz_m (u32, pg, pg); /* { dg-error {'svclz_m' has no form that takes 'svbool_t' arguments} } */ - - svclz_m (pg, pg, s32); /* { dg-error {passing 'svbool_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (s32, pg, s32); /* { dg-error {passing 'svint32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (f32, pg, s32); /* { dg-error {passing 'svfloat32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (s64, pg, s32); /* { dg-error {passing 'svint64_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (u64, pg, s32); /* { dg-error {arguments 1 and 3 of 'svclz_m' must have the same element size, but the values passed here have type 'svuint64_t' and 'svint32_t' respectively} } */ -} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_2.c deleted file mode 100644 index 233e847e903..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_2.c +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-flax-vector-conversions" } */ - -#include - -void -f1 (svbool_t pg, svint32_t s32, svuint32_t u32, svfloat32_t f32, - svint64_t s64, svuint64_t u64) -{ - svclz_m (u32, pg); /* { dg-error {too few arguments to function 'svclz_m'} } */ - svclz_m (u32, pg, s32, s32); /* { dg-error {too many arguments to function 'svclz_m'} } */ - svclz_m (0, pg, f32); /* { dg-error {passing 'int' to argument 1 of 'svclz_m', which expects an SVE vector type} } */ - svclz_m (u32, u32, f32); /* { dg-error {passing 'svuint32_t' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ - svclz_m (u32, 0, f32); /* { dg-error {passing 'int' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ - svclz_m (u32, pg, s32); - svclz_m (u32, pg, u32); - svclz_m (u32, pg, f32); /* { dg-error {'svclz_m' has no form that takes 'svfloat32_t' arguments} } */ - svclz_m (u32, pg, pg); /* { dg-error {'svclz_m' has no form that takes 'svbool_t' arguments} } */ - - svclz_m (pg, pg, s32); /* { dg-error {passing 'svbool_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (s32, pg, s32); /* { dg-error {passing 'svint32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (f32, pg, s32); /* { dg-error {passing 'svfloat32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (s64, pg, s32); /* { dg-error {passing 'svint64_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ - svclz_m (u64, pg, s32); /* { dg-error {arguments 1 and 3 of 'svclz_m' must have the same element size, but the values passed here have type 'svuint64_t' and 'svint32_t' respectively} } */ -} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_3.c deleted file mode 100644 index da57b07ea84..00000000000 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_count_3.c +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do compile } */ - -#include - -void -f1 (svbool_t pg, svuint8_t u8) -{ - svcnt_x (pg); /* { dg-error {too few arguments to function 'svcnt_x'} } */ - svcnt_x (pg, u8, u8); /* { dg-error {too many arguments to function 'svcnt_x'} } */ - svcnt_x (u8, u8); /* { dg-error {passing 'svuint8_t' to argument 1 of 'svcnt_x', which expects 'svbool_t'} } */ - svcnt_x (pg, pg); /* { dg-error {'svcnt_x' has no form that takes 'svbool_t' arguments} } */ - svcnt_x (pg, 1); /* { dg-error {passing 'int' to argument 2 of 'svcnt_x', which expects an SVE vector type} } */ - svcnt_x (pg, u8); -} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_1.c new file mode 100644 index 00000000000..888b52513ef --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_1.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ + +#include + +void +f1 (svbool_t pg, svint32_t s32, svuint32_t u32, svfloat32_t f32, + svint64_t s64, svuint64_t u64) +{ + svclz_m (u32, pg); /* { dg-error {too few arguments to function 'svclz_m'} } */ + svclz_m (u32, pg, s32, s32); /* { dg-error {too many arguments to function 'svclz_m'} } */ + svclz_m (0, pg, f32); /* { dg-error {passing 'int' to argument 1 of 'svclz_m', which expects an SVE vector type} } */ + svclz_m (u32, u32, f32); /* { dg-error {passing 'svuint32_t' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ + svclz_m (u32, 0, f32); /* { dg-error {passing 'int' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ + svclz_m (u32, pg, s32); + svclz_m (u32, pg, u32); + svclz_m (u32, pg, f32); /* { dg-error {'svclz_m' has no form that takes 'svfloat32_t' arguments} } */ + svclz_m (u32, pg, pg); /* { dg-error {'svclz_m' has no form that takes 'svbool_t' arguments} } */ + + svclz_m (pg, pg, s32); /* { dg-error {passing 'svbool_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (s32, pg, s32); /* { dg-error {passing 'svint32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (f32, pg, s32); /* { dg-error {passing 'svfloat32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (s64, pg, s32); /* { dg-error {passing 'svint64_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (u64, pg, s32); /* { dg-error {arguments 1 and 3 of 'svclz_m' must have the same element size, but the values passed here have type 'svuint64_t' and 'svint32_t' respectively} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_2.c new file mode 100644 index 00000000000..233e847e903 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_2.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-flax-vector-conversions" } */ + +#include + +void +f1 (svbool_t pg, svint32_t s32, svuint32_t u32, svfloat32_t f32, + svint64_t s64, svuint64_t u64) +{ + svclz_m (u32, pg); /* { dg-error {too few arguments to function 'svclz_m'} } */ + svclz_m (u32, pg, s32, s32); /* { dg-error {too many arguments to function 'svclz_m'} } */ + svclz_m (0, pg, f32); /* { dg-error {passing 'int' to argument 1 of 'svclz_m', which expects an SVE vector type} } */ + svclz_m (u32, u32, f32); /* { dg-error {passing 'svuint32_t' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ + svclz_m (u32, 0, f32); /* { dg-error {passing 'int' to argument 2 of 'svclz_m', which expects 'svbool_t'} } */ + svclz_m (u32, pg, s32); + svclz_m (u32, pg, u32); + svclz_m (u32, pg, f32); /* { dg-error {'svclz_m' has no form that takes 'svfloat32_t' arguments} } */ + svclz_m (u32, pg, pg); /* { dg-error {'svclz_m' has no form that takes 'svbool_t' arguments} } */ + + svclz_m (pg, pg, s32); /* { dg-error {passing 'svbool_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (s32, pg, s32); /* { dg-error {passing 'svint32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (f32, pg, s32); /* { dg-error {passing 'svfloat32_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (s64, pg, s32); /* { dg-error {passing 'svint64_t' to argument 1 of 'svclz_m', which expects a vector of unsigned integers} } */ + svclz_m (u64, pg, s32); /* { dg-error {arguments 1 and 3 of 'svclz_m' must have the same element size, but the values passed here have type 'svuint64_t' and 'svint32_t' respectively} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_3.c new file mode 100644 index 00000000000..da57b07ea84 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_to_uint_3.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +#include + +void +f1 (svbool_t pg, svuint8_t u8) +{ + svcnt_x (pg); /* { dg-error {too few arguments to function 'svcnt_x'} } */ + svcnt_x (pg, u8, u8); /* { dg-error {too many arguments to function 'svcnt_x'} } */ + svcnt_x (u8, u8); /* { dg-error {passing 'svuint8_t' to argument 1 of 'svcnt_x', which expects 'svbool_t'} } */ + svcnt_x (pg, pg); /* { dg-error {'svcnt_x' has no form that takes 'svbool_t' arguments} } */ + svcnt_x (pg, 1); /* { dg-error {passing 'int' to argument 2 of 'svcnt_x', which expects an SVE vector type} } */ + svcnt_x (pg, u8); +}