From e8ada4131657f7dc61f53fe49daaf96a1d1c6774 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Tue, 18 Mar 2025 14:56:41 +0000 Subject: testsuite: aarch64: arm: move saturating_arithmetic_autovect tests to simd/ These tests force dg-options because they rely on -ftree-vectorize and do not make use of torture options, so move them to simd/ where they belong. gcc/testsuite/ * gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect.inc: Move to gcc.target/aarch64/simd/. * gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_1.c: Likewise. * gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_2.c: Likewise. * gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_3.c: Likewise. * gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_4.c: Likewise. --- .../saturating_arithmetic_autovect.inc | 58 ---------------- .../saturating_arithmetic_autovect_1.c | 79 ---------------------- .../saturating_arithmetic_autovect_2.c | 79 ---------------------- .../saturating_arithmetic_autovect_3.c | 75 -------------------- .../saturating_arithmetic_autovect_4.c | 77 --------------------- .../simd/saturating_arithmetic_autovect.inc | 58 ++++++++++++++++ .../simd/saturating_arithmetic_autovect_1.c | 79 ++++++++++++++++++++++ .../simd/saturating_arithmetic_autovect_2.c | 79 ++++++++++++++++++++++ .../simd/saturating_arithmetic_autovect_3.c | 75 ++++++++++++++++++++ .../simd/saturating_arithmetic_autovect_4.c | 77 +++++++++++++++++++++ 10 files changed, 368 insertions(+), 368 deletions(-) delete mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect.inc delete mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_1.c delete mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_2.c delete mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_3.c delete mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_4.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect.inc create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_4.c (limited to 'gcc') diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect.inc b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect.inc deleted file mode 100644 index 1fadfd5..0000000 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect.inc +++ /dev/null @@ -1,58 +0,0 @@ -/* Template file for vector saturating arithmetic validation. - - This file defines saturating addition and subtraction functions for a given - scalar type, testing the auto-vectorization of these two operators. This - type, along with the corresponding minimum and maximum values for that type, - must be defined by any test file which includes this template file. */ - -#ifndef SAT_ARIT_AUTOVEC_INC -#define SAT_ARIT_AUTOVEC_INC - -#include -#include - -#ifndef UT -#define UT unsigned int -#define VT uint32x4_t -#define UMAX UINT_MAX -#define UMIN 0 -#endif - - -UT uadd_lane (UT a, VT b) -{ - UT sum = a + b[0]; - return sum < a ? UMAX : sum; -} - -void uaddq (UT *out, UT *a, UT *b, int n) -{ - for (int i = 0; i < n; i++) - { - UT sum = a[i] + b[i]; - out[i] = sum < a[i] ? UMAX : sum; - } -} - -void uaddq2 (UT *out, UT *a, UT *b, int n) -{ - for (int i = 0; i < n; i++) - { - UT sum; - if (!__builtin_add_overflow(a[i], b[i], &sum)) - out[i] = sum; - else - out[i] = UMAX; - } -} - -void usubq (UT *out, UT *a, UT *b, int n) -{ - for (int i = 0; i < n; i++) - { - UT sum = a[i] - b[i]; - out[i] = sum > a[i] ? UMIN : sum; - } -} - -#endif \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_1.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_1.c deleted file mode 100644 index 2b72be7..0000000 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_1.c +++ /dev/null @@ -1,79 +0,0 @@ -/* { dg-do assemble { target { aarch64*-*-* } } } */ -/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ -/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ - -/* -** uadd_lane: { xfail *-*-* } -** dup\tv([0-9]+).8b, w0 -** uqadd\tb([0-9]+), (?:b\1, b0|b0, b\1) -** umov\tw0, v\2.b\[0\] -** ret -*/ -/* -** uaddq: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.16b, (?:v\1.16b, v\2.16b|v\2.16b, v\1.16b) -** ... -** ldr\td([0-9]+), .* -** ldr\td([0-9]+), .* -** uqadd\tv[0-9]+.8b, (?:v\3.8b, v\4.8b|v\4.8b, v\3.8b) -** ... -** ldr\tb([0-9]+), .* -** ldr\tb([0-9]+), .* -** uqadd\tb[0-9]+, (?:b\5, b\6|b\6, b\5) -** ... -** ldr\tb([0-9]+), .* -** ldr\tb([0-9]+), .* -** uqadd\tb[0-9]+, (?:b\7, b\8|b\8, b\7) -** ... -*/ -/* -** uaddq2: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.16b, (?:v\1.16b, v\2.16b|v\2.16b, v\1.16b) -** ... -** ldr\td([0-9]+), .* -** ldr\td([0-9]+), .* -** uqadd\tv[0-9]+.8b, (?:v\3.8b, v\4.8b|v\4.8b, v\3.8b) -** ... -** ldr\tb([0-9]+), .* -** ldr\tb([0-9]+), .* -** uqadd\tb[0-9]+, (?:b\5, b\6|b\6, b\5) -** ... -** uqadd\tb([0-9]+), (?:b[0-9]+, b\7|b\7, b[0-9]+) -** ... -*/ -/* -** usubq: { xfail *-*-* } -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqsub\tv[0-9]+.16b, v\1.16b, v\2.16b -** ... -** ldr\td([0-9]+), .* -** ldr\td([0-9]+), .* -** uqsub\tv[0-9]+.8b, v\3.8b, v\4.8b -** ... -** ldr\tb([0-9]+), .* -** ldr\tb([0-9]+), .* -** uqsub\tb[0-9]+, b\5, b\6 -** ... -** ldr\tb([0-9]+), .* -** ldr\tb([0-9]+), .* -** uqsub\tb[0-9]+, b\7, b\8 -** ... -*/ - -#include -#include - -#define UT unsigned char -#define VT uint8x8_t -#define UMAX UCHAR_MAX -#define UMIN 0 - -#include "saturating_arithmetic_autovect.inc" \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_2.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_2.c deleted file mode 100644 index 0640361..0000000 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_2.c +++ /dev/null @@ -1,79 +0,0 @@ -/* { dg-do assemble { target { aarch64*-*-* } } } */ -/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ -/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ - -/* -** uadd_lane: { xfail *-*-* } -** dup\tv([0-9]+).4h, w0 -** uqadd\th([0-9]+), (?:h\1, h0|h0, h\1) -** umov\tw0, v\2.h\[0\] -** ret -*/ -/* -** uaddq: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.8h, (?:v\1.8h, v\2.8h|v\2.8h, v\1.8h) -** ... -** ldr\td([0-9]+), .* -** ldr\td([0-9]+), .* -** uqadd\tv[0-9]+.4h, (?:v\3.4h, v\4.4h|v\4.4h, v\3.4h) -** ... -** ldr\th([0-9]+), .* -** ldr\th([0-9]+), .* -** uqadd\th[0-9]+, (?:h\5, h\6|h\6, h\5) -** ... -** ldr\th([0-9]+), .* -** ldr\th([0-9]+), .* -** uqadd\th[0-9]+, (?:h\7, h\8|h\8, h\7) -** ... -*/ -/* -** uaddq2: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.8h, (?:v\1.8h, v\2.8h|v\2.8h, v\1.8h) -** ... -** ldr\td([0-9]+), .* -** ldr\td([0-9]+), .* -** uqadd\tv[0-9]+.4h, (?:v\3.4h, v\4.4h|v\4.4h, v\3.4h) -** ... -** ldr\th([0-9]+), .* -** ldr\th([0-9]+), .* -** uqadd\th[0-9]+, (?:h\5, h\6|h\6, h\5) -** ... -** uqadd\th([0-9]+), (?:h[0-9]+, h\7|h\7, h[0-9]+) -** ... -*/ -/* -** usubq: { xfail *-*-* } -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqsub\tv[0-9]+.8h, v\1.8h, v\2.8h -** ... -** ldr\td([0-9]+), .* -** ldr\td([0-9]+), .* -** uqsub\tv[0-9]+.4h, v\3.4h, v\4.4h -** ... -** ldr\th([0-9]+), .* -** ldr\th([0-9]+), .* -** uqsub\th[0-9]+, h\5, h\6 -** ... -** ldr\th([0-9]+), .* -** ldr\th([0-9]+), .* -** uqsub\th[0-9]+, h\7, h\8 -** ... -*/ - -#include -#include - -#define UT unsigned short -#define VT uint16x4_t -#define UMAX USHRT_MAX -#define UMIN 0 - -#include "saturating_arithmetic_autovect.inc" \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_3.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_3.c deleted file mode 100644 index ea6e0c7..0000000 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_3.c +++ /dev/null @@ -1,75 +0,0 @@ -/* { dg-do assemble { target { aarch64*-*-* } } } */ -/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ -/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ - -/* -** uadd_lane: -** fmov\tw([0-9]+), s0 -** adds\tw([0-9]+), (?:w\1, w0|w0, w\1) -** csinv\tw\2, w\2, wzr, cc -** ret -*/ -/* -** uaddq: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.4s, (?:v\1.4s, v\2.4s|v\2.4s, v\1.4s) -** ... -** ldr\tw([0-9]+), .* -** ldr\tw([0-9]+), .* -** adds\tw([0-9]+), (?:w\3, w\4|w\4, w\3) -** csinv\tw\5, w\5, wzr, cc -** ... -** ldr\tw([0-9]+), .* -** ldr\tw([0-9]+), .* -** adds\tw([0-9]+), (?:w\6, w\7|w\7, w\6) -** csinv\tw\8, w\8, wzr, cc -** ... -*/ -/* -** uaddq2: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.4s, (?:v\1.4s, v\2.4s|v\2.4s, v\1.4s) -** ... -** ldr\tw([0-9]+), .* -** ldr\tw([0-9]+), .* -** adds\tw([0-9]+), (?:w\3, w\4|w\4, w\3) -** csinv\tw\5, w\5, wzr, cc -** ... -** ldr\tw([0-9]+), .* -** ldr\tw([0-9]+), .* -** adds\tw([0-9]+), (?:w\6, w\7|w\7, w\6) -** csinv\tw\8, w\8, wzr, cc -** ... -*/ -/* -** usubq: { xfail *-*-* } -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqsub\tv[0-9]+.4s, v\1.4s, v\2.4s -** ... -** ldr\tw([0-9]+), .* -** ldr\tw([0-9]+), .* -** subs\tw([0-9]+), w\3, w\4 -** csel\tw\5, w\5, wzr, cs -** ... -** ldr\tw([0-9]+), .* -** ldr\tw([0-9]+), .* -** subs\tw([0-9]+), w\6, w\7 -** csel\tw\8, w\8, wzr, cs -** ... -*/ - -#include -#include - -#define UT unsigned int -#define VT uint32x2_t -#define UMAX UINT_MAX -#define UMIN 0 - -#include "saturating_arithmetic_autovect.inc" \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_4.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_4.c deleted file mode 100644 index 0139063..0000000 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/saturating_arithmetic_autovect_4.c +++ /dev/null @@ -1,77 +0,0 @@ -/* { dg-do assemble { target { aarch64*-*-* } } } */ -/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ -/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ - -/* -** uadd_lane: -** ... -** (?:fmov|ldr)\tx([0-9]+), .* -** ... -** adds\tx([0-9]+), (?:x\1, x0|x0, x\1) -** csinv\tx\2, x\2, xzr, cc -** ret -*/ -/* -** uaddq: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.2d, (?:v\1.2d, v\2.2d|v\2.2d, v\1.2d) -** ... -** ldr\tx([0-9]+), .* -** ldr\tx([0-9]+), .* -** adds\tx([0-9]+), (?:x\3, x\4|x\4, x\3) -** csinv\tx\5, x\5, xzr, cc -** ... -** ldr\tx([0-9]+), .* -** ldr\tx([0-9]+), .* -** adds\tx([0-9]+), (?:x\6, x\7|x\7, x\6) -** csinv\tx\8, x\8, xzr, cc -** ... -*/ -/* -** uaddq2: -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqadd\tv[0-9]+.2d, (?:v\1.2d, v\2.2d|v\2.2d, v\1.2d) -** ... -** ldr\tx([0-9]+), .* -** ldr\tx([0-9]+), .* -** adds\tx([0-9]+), (?:x\3, x\4|x\4, x\3) -** csinv\tx\5, x\5, xzr, cc -** ... -** ldr\tx([0-9]+), .* -** ldr\tx([0-9]+), .* -** adds\tx([0-9]+), (?:x\6, x\7|x\7, x\6) -** csinv\tx\8, x\8, xzr, cc -** ... -*/ -/* -** usubq: { xfail *-*-* } -** ... -** ldr\tq([0-9]+), .* -** ldr\tq([0-9]+), .* -** uqsub\tv[0-9]+.2d, v\1.2d, v\2.2d -** ... -** ldr\tx([0-9]+), .* -** ldr\tx([0-9]+), .* -** subs\tx([0-9]+), x\3, x\4 -** csel\tx\5, x\5, xzr, cs -** ... -** ldr\tx([0-9]+), .* -** ldr\tx([0-9]+), .* -** subs\tx([0-9]+), x\6, x\7 -** csel\tx\8, x\8, xzr, cs -** ... -*/ - -#include -#include - -#define UT unsigned long -#define VT uint64x2_t -#define UMAX ULONG_MAX -#define UMIN 0 - -#include "saturating_arithmetic_autovect.inc" \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect.inc b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect.inc new file mode 100644 index 0000000..1fadfd5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect.inc @@ -0,0 +1,58 @@ +/* Template file for vector saturating arithmetic validation. + + This file defines saturating addition and subtraction functions for a given + scalar type, testing the auto-vectorization of these two operators. This + type, along with the corresponding minimum and maximum values for that type, + must be defined by any test file which includes this template file. */ + +#ifndef SAT_ARIT_AUTOVEC_INC +#define SAT_ARIT_AUTOVEC_INC + +#include +#include + +#ifndef UT +#define UT unsigned int +#define VT uint32x4_t +#define UMAX UINT_MAX +#define UMIN 0 +#endif + + +UT uadd_lane (UT a, VT b) +{ + UT sum = a + b[0]; + return sum < a ? UMAX : sum; +} + +void uaddq (UT *out, UT *a, UT *b, int n) +{ + for (int i = 0; i < n; i++) + { + UT sum = a[i] + b[i]; + out[i] = sum < a[i] ? UMAX : sum; + } +} + +void uaddq2 (UT *out, UT *a, UT *b, int n) +{ + for (int i = 0; i < n; i++) + { + UT sum; + if (!__builtin_add_overflow(a[i], b[i], &sum)) + out[i] = sum; + else + out[i] = UMAX; + } +} + +void usubq (UT *out, UT *a, UT *b, int n) +{ + for (int i = 0; i < n; i++) + { + UT sum = a[i] - b[i]; + out[i] = sum > a[i] ? UMIN : sum; + } +} + +#endif \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_1.c b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_1.c new file mode 100644 index 0000000..2b72be7 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_1.c @@ -0,0 +1,79 @@ +/* { dg-do assemble { target { aarch64*-*-* } } } */ +/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ +/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ + +/* +** uadd_lane: { xfail *-*-* } +** dup\tv([0-9]+).8b, w0 +** uqadd\tb([0-9]+), (?:b\1, b0|b0, b\1) +** umov\tw0, v\2.b\[0\] +** ret +*/ +/* +** uaddq: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.16b, (?:v\1.16b, v\2.16b|v\2.16b, v\1.16b) +** ... +** ldr\td([0-9]+), .* +** ldr\td([0-9]+), .* +** uqadd\tv[0-9]+.8b, (?:v\3.8b, v\4.8b|v\4.8b, v\3.8b) +** ... +** ldr\tb([0-9]+), .* +** ldr\tb([0-9]+), .* +** uqadd\tb[0-9]+, (?:b\5, b\6|b\6, b\5) +** ... +** ldr\tb([0-9]+), .* +** ldr\tb([0-9]+), .* +** uqadd\tb[0-9]+, (?:b\7, b\8|b\8, b\7) +** ... +*/ +/* +** uaddq2: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.16b, (?:v\1.16b, v\2.16b|v\2.16b, v\1.16b) +** ... +** ldr\td([0-9]+), .* +** ldr\td([0-9]+), .* +** uqadd\tv[0-9]+.8b, (?:v\3.8b, v\4.8b|v\4.8b, v\3.8b) +** ... +** ldr\tb([0-9]+), .* +** ldr\tb([0-9]+), .* +** uqadd\tb[0-9]+, (?:b\5, b\6|b\6, b\5) +** ... +** uqadd\tb([0-9]+), (?:b[0-9]+, b\7|b\7, b[0-9]+) +** ... +*/ +/* +** usubq: { xfail *-*-* } +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqsub\tv[0-9]+.16b, v\1.16b, v\2.16b +** ... +** ldr\td([0-9]+), .* +** ldr\td([0-9]+), .* +** uqsub\tv[0-9]+.8b, v\3.8b, v\4.8b +** ... +** ldr\tb([0-9]+), .* +** ldr\tb([0-9]+), .* +** uqsub\tb[0-9]+, b\5, b\6 +** ... +** ldr\tb([0-9]+), .* +** ldr\tb([0-9]+), .* +** uqsub\tb[0-9]+, b\7, b\8 +** ... +*/ + +#include +#include + +#define UT unsigned char +#define VT uint8x8_t +#define UMAX UCHAR_MAX +#define UMIN 0 + +#include "saturating_arithmetic_autovect.inc" \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_2.c b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_2.c new file mode 100644 index 0000000..0640361 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_2.c @@ -0,0 +1,79 @@ +/* { dg-do assemble { target { aarch64*-*-* } } } */ +/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ +/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ + +/* +** uadd_lane: { xfail *-*-* } +** dup\tv([0-9]+).4h, w0 +** uqadd\th([0-9]+), (?:h\1, h0|h0, h\1) +** umov\tw0, v\2.h\[0\] +** ret +*/ +/* +** uaddq: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.8h, (?:v\1.8h, v\2.8h|v\2.8h, v\1.8h) +** ... +** ldr\td([0-9]+), .* +** ldr\td([0-9]+), .* +** uqadd\tv[0-9]+.4h, (?:v\3.4h, v\4.4h|v\4.4h, v\3.4h) +** ... +** ldr\th([0-9]+), .* +** ldr\th([0-9]+), .* +** uqadd\th[0-9]+, (?:h\5, h\6|h\6, h\5) +** ... +** ldr\th([0-9]+), .* +** ldr\th([0-9]+), .* +** uqadd\th[0-9]+, (?:h\7, h\8|h\8, h\7) +** ... +*/ +/* +** uaddq2: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.8h, (?:v\1.8h, v\2.8h|v\2.8h, v\1.8h) +** ... +** ldr\td([0-9]+), .* +** ldr\td([0-9]+), .* +** uqadd\tv[0-9]+.4h, (?:v\3.4h, v\4.4h|v\4.4h, v\3.4h) +** ... +** ldr\th([0-9]+), .* +** ldr\th([0-9]+), .* +** uqadd\th[0-9]+, (?:h\5, h\6|h\6, h\5) +** ... +** uqadd\th([0-9]+), (?:h[0-9]+, h\7|h\7, h[0-9]+) +** ... +*/ +/* +** usubq: { xfail *-*-* } +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqsub\tv[0-9]+.8h, v\1.8h, v\2.8h +** ... +** ldr\td([0-9]+), .* +** ldr\td([0-9]+), .* +** uqsub\tv[0-9]+.4h, v\3.4h, v\4.4h +** ... +** ldr\th([0-9]+), .* +** ldr\th([0-9]+), .* +** uqsub\th[0-9]+, h\5, h\6 +** ... +** ldr\th([0-9]+), .* +** ldr\th([0-9]+), .* +** uqsub\th[0-9]+, h\7, h\8 +** ... +*/ + +#include +#include + +#define UT unsigned short +#define VT uint16x4_t +#define UMAX USHRT_MAX +#define UMIN 0 + +#include "saturating_arithmetic_autovect.inc" \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_3.c b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_3.c new file mode 100644 index 0000000..ea6e0c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_3.c @@ -0,0 +1,75 @@ +/* { dg-do assemble { target { aarch64*-*-* } } } */ +/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ +/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ + +/* +** uadd_lane: +** fmov\tw([0-9]+), s0 +** adds\tw([0-9]+), (?:w\1, w0|w0, w\1) +** csinv\tw\2, w\2, wzr, cc +** ret +*/ +/* +** uaddq: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.4s, (?:v\1.4s, v\2.4s|v\2.4s, v\1.4s) +** ... +** ldr\tw([0-9]+), .* +** ldr\tw([0-9]+), .* +** adds\tw([0-9]+), (?:w\3, w\4|w\4, w\3) +** csinv\tw\5, w\5, wzr, cc +** ... +** ldr\tw([0-9]+), .* +** ldr\tw([0-9]+), .* +** adds\tw([0-9]+), (?:w\6, w\7|w\7, w\6) +** csinv\tw\8, w\8, wzr, cc +** ... +*/ +/* +** uaddq2: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.4s, (?:v\1.4s, v\2.4s|v\2.4s, v\1.4s) +** ... +** ldr\tw([0-9]+), .* +** ldr\tw([0-9]+), .* +** adds\tw([0-9]+), (?:w\3, w\4|w\4, w\3) +** csinv\tw\5, w\5, wzr, cc +** ... +** ldr\tw([0-9]+), .* +** ldr\tw([0-9]+), .* +** adds\tw([0-9]+), (?:w\6, w\7|w\7, w\6) +** csinv\tw\8, w\8, wzr, cc +** ... +*/ +/* +** usubq: { xfail *-*-* } +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqsub\tv[0-9]+.4s, v\1.4s, v\2.4s +** ... +** ldr\tw([0-9]+), .* +** ldr\tw([0-9]+), .* +** subs\tw([0-9]+), w\3, w\4 +** csel\tw\5, w\5, wzr, cs +** ... +** ldr\tw([0-9]+), .* +** ldr\tw([0-9]+), .* +** subs\tw([0-9]+), w\6, w\7 +** csel\tw\8, w\8, wzr, cs +** ... +*/ + +#include +#include + +#define UT unsigned int +#define VT uint32x2_t +#define UMAX UINT_MAX +#define UMIN 0 + +#include "saturating_arithmetic_autovect.inc" \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_4.c b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_4.c new file mode 100644 index 0000000..0139063 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/saturating_arithmetic_autovect_4.c @@ -0,0 +1,77 @@ +/* { dg-do assemble { target { aarch64*-*-* } } } */ +/* { dg-options "-O2 --save-temps -ftree-vectorize" } */ +/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ + +/* +** uadd_lane: +** ... +** (?:fmov|ldr)\tx([0-9]+), .* +** ... +** adds\tx([0-9]+), (?:x\1, x0|x0, x\1) +** csinv\tx\2, x\2, xzr, cc +** ret +*/ +/* +** uaddq: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.2d, (?:v\1.2d, v\2.2d|v\2.2d, v\1.2d) +** ... +** ldr\tx([0-9]+), .* +** ldr\tx([0-9]+), .* +** adds\tx([0-9]+), (?:x\3, x\4|x\4, x\3) +** csinv\tx\5, x\5, xzr, cc +** ... +** ldr\tx([0-9]+), .* +** ldr\tx([0-9]+), .* +** adds\tx([0-9]+), (?:x\6, x\7|x\7, x\6) +** csinv\tx\8, x\8, xzr, cc +** ... +*/ +/* +** uaddq2: +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqadd\tv[0-9]+.2d, (?:v\1.2d, v\2.2d|v\2.2d, v\1.2d) +** ... +** ldr\tx([0-9]+), .* +** ldr\tx([0-9]+), .* +** adds\tx([0-9]+), (?:x\3, x\4|x\4, x\3) +** csinv\tx\5, x\5, xzr, cc +** ... +** ldr\tx([0-9]+), .* +** ldr\tx([0-9]+), .* +** adds\tx([0-9]+), (?:x\6, x\7|x\7, x\6) +** csinv\tx\8, x\8, xzr, cc +** ... +*/ +/* +** usubq: { xfail *-*-* } +** ... +** ldr\tq([0-9]+), .* +** ldr\tq([0-9]+), .* +** uqsub\tv[0-9]+.2d, v\1.2d, v\2.2d +** ... +** ldr\tx([0-9]+), .* +** ldr\tx([0-9]+), .* +** subs\tx([0-9]+), x\3, x\4 +** csel\tx\5, x\5, xzr, cs +** ... +** ldr\tx([0-9]+), .* +** ldr\tx([0-9]+), .* +** subs\tx([0-9]+), x\6, x\7 +** csel\tx\8, x\8, xzr, cs +** ... +*/ + +#include +#include + +#define UT unsigned long +#define VT uint64x2_t +#define UMAX ULONG_MAX +#define UMIN 0 + +#include "saturating_arithmetic_autovect.inc" \ No newline at end of file -- cgit v1.1