On Mon, May 27, 2024 at 10:36:23AM +0530, Tejas Belagod wrote:
> This patch tests simd aligned clause and their interaction with SVE types.
> 
> gcc/testsuite/ChangeLog
> 
>       * gcc.target/aarch64/sve/omp/simd-aligned.c: New test.
> ---
>  .../gcc.target/aarch64/sve/omp/simd-aligned.c | 50 +++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/simd-aligned.c
> 
> diff --git a/gcc/testsuite/gcc.target/aarch64/sve/omp/simd-aligned.c 
> b/gcc/testsuite/gcc.target/aarch64/sve/omp/simd-aligned.c
> new file mode 100644
> index 00000000000..6c75bb5a714
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/aarch64/sve/omp/simd-aligned.c
> @@ -0,0 +1,50 @@
> +/* { dg-do run } */
> +/* { dg-options "-msve-vector-bits=256 -std=gnu99 -fopenmp -O2 
> -fdump-tree-ompexp" } */
> +#include <arm_sve.h>
> +
> +#define N 256
> +
> +int a[N] __attribute__((aligned (64)));
> +int b[N] __attribute__((aligned (64)));
> +
> +
> +__attribute((noipa))
> +void foo (int *p, int *q)
> +{
> +   svint32_t va, vb, vc;
> +   int i;
> +   uint64_t sz = svcntw ();
> +
> +#pragma omp simd aligned(p, q : 64) private (va, vb, vc) nontemporal (va, 
> vb, vc)

The testcase suggests the test is about aligned clause, but it tests it only
on something not related to SVE; it tests nontemporal clause on those.

Sure, testing nontemporal clause is useful, but given the test name, it
might be useful to also test aligned clause.
For C the argument must have array or pointer type, for C++ that or
reference to array or pointer type.
So, you might want to test svint32_t * in that clause, or svint32_t array
(if the latter is possible).  Of course, you'd need to arrange for the
svint32_t to be aligned corresponding to the alignment passed in.

        Jakub

Reply via email to