new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-skip-if "" { *-*-* } } */
+
+#define N 200
+
+__attribute__ ((noinline))
+void calc (TYPE a[N], TYPE b[N], TYPE *c)
+{
+ for (int i=0; i < N; i+=2)
+ {
+ c[i] = a[i] + b[i+1];
+ c[i+1] = a[i+1] - b[i];
+ }
+}
new file mode 100644
@@ -0,0 +1,12 @@
+/* { dg-skip-if "" { *-*-* } } */
+#define N 200
+
+__attribute__ ((noinline))
+void calc (TYPE a[N], TYPE b[N], TYPE *c)
+{
+ for (int i=0; i < N; i+=2)
+ {
+ c[i] = a[i] - b[i+1];
+ c[i+1] = a[i+1] + b[i];
+ }
+}
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE double
+#include "vcadd-arrays-autovec-90.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE a[N] = {1.0, 2.0, 3.0, 4.0};
+ TYPE b[N] = {4.0, 2.0, 1.5, 4.5};
+ TYPE c[N] = {0};
+ calc (a, b, c);
+
+ if (c[0] != -1.0 || c[1] != 6.0)
+ abort ();
+
+ if (c[2] != -1.5 || c[3] != 5.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.2d, v[0-9]+\.2d, v[0-9]+\.2d, #90} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcadd\.} { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#include "vcadd-arrays-autovec-90.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE a[N] = {1.0, 2.0, 3.0, 4.0};
+ TYPE b[N] = {4.0, 2.0, 1.5, 4.5};
+ TYPE c[N] = {0};
+ calc (a, b, c);
+
+ if (c[0] != -1.0 || c[1] != 6.0)
+ abort ();
+
+ if (c[2] != -1.5 || c[3] != 5.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.4s, #90} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f32\tq[0-9]+, q[0-9]+, q[0-9]+, #(?:0|90)} 2 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#include "vcadd-arrays-autovec-90.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE a[N] = {1.0, 2.0, 3.0, 4.0};
+ TYPE b[N] = {4.0, 2.0, 1.5, 4.5};
+ TYPE c[N] = {0};
+ calc (a, b, c);
+
+ if (c[0] != -1.0 || c[1] != 6.0)
+ abort ();
+
+ if (c[2] != -1.5 || c[3] != 5.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.8h, v[0-9]+\.8h, v[0-9]+\.8h, #90} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f16\tq[0-9]+, q[0-9]+, q[0-9]+, #90} 1 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE double
+#include "vcadd-arrays-autovec-270.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE a[N] = {1.0, 2.0, 3.0, 4.0};
+ TYPE b[N] = {4.0, 2.0, 1.5, 4.5};
+ TYPE c[N] = {0};
+ calc (a, b, c);
+
+ if (c[0] != 3.0 || c[1] != -2.0)
+ abort ();
+
+ if (c[2] != 7.5 || c[3] != 2.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.2d, v[0-9]+\.2d, v[0-9]+\.2d, #270} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcadd\.} { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#include "vcadd-arrays-autovec-270.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE a[N] = {1.0, 2.0, 3.0, 4.0};
+ TYPE b[N] = {4.0, 2.0, 1.5, 4.5};
+ TYPE c[N] = {0};
+ calc (a, b, c);
+
+ if (c[0] != 3.0 || c[1] != -2.0)
+ abort ();
+
+ if (c[2] != 7.5 || c[3] != 2.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.4s, #270} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f32\tq[0-9]+, q[0-9]+, q[0-9]+, #270} 1 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#include "vcadd-arrays-autovec-270.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE a[N] = {1.0, 2.0, 3.0, 4.0};
+ TYPE b[N] = {4.0, 2.0, 1.5, 4.5};
+ TYPE c[N] = {0};
+ calc (a, b, c);
+
+ if (c[0] != 3.0 || c[1] != -2.0)
+ abort ();
+
+ if (c[2] != 7.5 || c[3] != 2.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.8h, v[0-9]+\.8h, v[0-9]+\.8h, #270} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f16\tq[0-9]+, q[0-9]+, q[0-9]+, #270} 1 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,12 @@
+/* { dg-skip-if "" { *-*-* } } */
+
+#include <complex.h>
+
+#define N 200
+
+__attribute__ ((noinline))
+void calc (TYPE complex a[N], TYPE complex b[N], TYPE complex c[N])
+{
+ for (int i=0; i < N; i++)
+ c[i] = a[i] + b[i] ROT;
+}
new file mode 100644
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE double
+#define ROT * I
+#include "vcadd-complex-autovec.c"
+
+extern void abort(void);
+
+#include <stdio.h>
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {0};
+ calc (a, b, c);
+
+ if (creal (c[0]) != -1.0 || cimag (c[0]) != 6.0)
+ abort ();
+
+ if (creal (c[1]) != -1.5 || cimag (c[1]) != 5.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.2d, v[0-9]+\.2d, v[0-9]+\.2d, #90} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcadd\.} { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#define ROT * I
+#include "vcadd-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {0};
+ calc (a, b, c);
+
+ if (creal (c[0]) != -1.0 || cimag (c[0]) != 6.0)
+ abort ();
+
+ if (creal (c[1]) != -1.5 || cimag (c[1]) != 5.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.4s, #90} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f32\tq[0-9]+, q[0-9]+, q[0-9]+, #90} 1 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#define ROT * I
+#include "vcadd-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {0};
+ calc (a, b, c);
+
+ if (creal (c[0]) != -1.0 || cimag (c[0]) != 6.0)
+ abort ();
+
+ if (creal (c[1]) != -1.5 || cimag (c[1]) != 5.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.8h, v[0-9]+\.8h, v[0-9]+\.8h, #90} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f32\tq[0-9]+, q[0-9]+, q[0-9]+, #90} 1 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE double
+#define ROT * I * I * I
+#include "vcadd-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {0};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 3.0 || cimag (c[0]) != -2.0)
+ abort ();
+
+ if (creal (c[1]) != 7.5 || cimag (c[1]) != 2.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.2d, v[0-9]+\.2d, v[0-9]+\.2d, #270} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {fcadd\.} { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#define ROT * I * I * I
+#include "vcadd-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {0};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 3.0 || cimag (c[0]) != -2.0)
+ abort ();
+
+ if (creal (c[1]) != 7.5 || cimag (c[1]) != 2.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.4s, #270} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f32\tq[0-9]+, q[0-9]+, q[0-9]+, #270} 1 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#define ROT * I * I * I
+#include "vcadd-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {0};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 3.0 || cimag (c[0]) != -2.0)
+ abort ();
+
+ if (creal (c[1]) != 7.5 || cimag (c[1]) != 2.5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcadd\tv[0-9]+\.8h, v[0-9]+\.8h, v[0-9]+\.8h, #270} 1 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcadd\.f16\tq[0-9]+, q[0-9]+, q[0-9]+, #270} 1 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,11 @@
+/* { dg-skip-if "" { *-*-* } } */
+#include <complex.h>
+
+#define N 200
+
+__attribute__ ((noinline, noipa))
+void calc (TYPE complex a[N], TYPE complex b[N], TYPE complex c[N])
+{
+ for (int i=0; i < N; i++)
+ c[i] += a[i] * b[i] ROT;
+}
new file mode 100644
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+/* { dg-keep-saved-temps ".s" ".o" ".exe" } */
+#define TYPE double
+#define ROT
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+#include <stdio.h>
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 2.5 || cimag (c[0]) != 11.5)
+ abort ();
+
+ if (creal (c[1]) != -11.5 || cimag (c[1]) != 21.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcmla\tv[0-9]+\.2d, v[0-9]+\.2d, v[0-9]+\.2d, #(?:0|90)} 2 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE double
+#define ROT * I * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 2.5 || cimag (c[0]) != -8.5)
+ abort ();
+
+ if (creal (c[1]) != 15.5 || cimag (c[1]) != -18.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcmla\tv[0-9]+\.2d, v[0-9]+\.2d, v[0-9]+\.2d, #(?:180|270)} 2 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#define ROT * I * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 2.5 || cimag (c[0]) != -8.5)
+ abort ();
+
+ if (creal (c[1]) != 15.5 || cimag (c[1]) != -18.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcmla\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.4s, #(?:180|270)} 2 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcmla\.f32\tq[0-9]+, q[0-9]+, q[0-9]+, #(?:180|270)} 2 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#define ROT * I * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 2.5 || cimag (c[0]) != -8.5)
+ abort ();
+
+ if (creal (c[1]) != 15.5 || cimag (c[1]) != -18.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcmla\tv[0-9]+\.8h, v[0-9]+\.8h, v[0-9]+\.8h, #(?:180|270)} 2 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcmla\.f16\tq[0-9]+, q[0-9]+, q[0-9]+, #(?:180|270)} 2 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#define ROT
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 2.5 || cimag (c[0]) != 11.5)
+ abort ();
+
+ if (creal (c[1]) != -11.5 || cimag (c[1]) != 21.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcmla\tv[0-9]+\.4s, v[0-9]+\.4s, v[0-9]+\.4s, #(?:0|90)} 2 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcmla\.f32\tq[0-9]+, q[0-9]+, q[0-9]+, #(?:0|90)} 2 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE double
+#define ROT * I * I * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 12.5 || cimag (c[0]) != 1.5)
+ abort ();
+
+ if (creal (c[1]) != 21.5 || cimag (c[1]) != 15.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not {fcmla} { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#define ROT * I * I * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 12.5 || cimag (c[0]) != 1.5)
+ abort ();
+
+ if (creal (c[1]) != 21.5 || cimag (c[1]) != 15.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not {fcmla} { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#define ROT * I * I * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 12.5 || cimag (c[0]) != 1.5)
+ abort ();
+
+ if (creal (c[1]) != 21.5 || cimag (c[1]) != 15.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not {fcmla} { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */
new file mode 100644
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#define ROT
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != 2.5 || cimag (c[0]) != 11.5)
+ abort ();
+
+ if (creal (c[1]) != -11.5 || cimag (c[1]) != 21.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times {fcmla\tv[0-9]+\.8h, v[0-9]+\.8h, v[0-9]+\.8h, #(?:0|90)} 2 { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times {vcmla\.f16\tq[0-9]+, q[0-9]+, q[0-9]+, #(?:0|90)} 2 { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_df } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE double
+#define ROT * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+#include <stdio.h>
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != -7.5 || cimag (c[0]) != 1.5)
+ abort ();
+
+ if (creal (c[1]) != -17.5 || cimag (c[1]) != -12.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not {fcmla} { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */
+
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_sf } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -save-temps" } */
+
+#define TYPE float
+#define ROT * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != -7.5 || cimag (c[0]) != 1.5)
+ abort ();
+
+ if (creal (c[1]) != -17.5 || cimag (c[1]) != -12.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not {fcmla} { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */
new file mode 100644
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_v8_3a_complex_neon_ok } */
+/* { dg-require-effective-target vect_complex_rot_hf } */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
+/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-Ofast -march=armv8.3-a+fp16 -save-temps" } */
+
+#define TYPE _Float16
+#define ROT * I
+#include "vcmla-complex-autovec.c"
+
+extern void abort(void);
+
+int main()
+{
+ TYPE complex a[N] = {1.0 + 2.0 * I, 3.0 + 4.0 * I};
+ TYPE complex b[N] = {4.0 + 2.0 * I, 1.5 + 4.5 * I};
+ TYPE complex c[N] = {2.5 + 1.5 * I, 2.0 + 1.5 * I};
+ calc (a, b, c);
+
+ if (creal (c[0]) != -7.5 || cimag (c[0]) != 1.5)
+ abort ();
+
+ if (creal (c[1]) != -17.5 || cimag (c[1]) != -12.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not {fcmla} { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-not {vcmla\.} { target { arm*-*-* } } } } */