/* { dg-do compile } */
/* { dg-require-effective-target vect_complex_add_double } */
/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-fdump-tree-vect-details" } */
#define TYPE double
#define N 16
#include "complex-mla-template.c"
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "slp1" } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "slp1" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "vect" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "vect" } } */
/* { dg-do compile } */
/* { dg-require-effective-target vect_complex_add_float } */
-/* { dg-additional-options "-fno-tree-loop-vectorize" } */
+/* { dg-additional-options "-fdump-tree-vect-details" } */
/* { dg-add-options arm_v8_3a_fp16_complex_neon } */
#define TYPE float
#define N 16
#include "complex-mla-template.c"
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "slp1" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "slp1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "vect" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "vect" } } */
/* { dg-do compile } */
/* { dg-require-effective-target vect_complex_add_double } */
/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-fdump-tree-vect-details" } */
#define TYPE double
#define N 16
#include "complex-mls-template.c"
-/* { dg-final { scan-tree-dump "Found COMPLEX_ADD_ROT270" "slp1" } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "slp1" } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "slp1" } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "slp1" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "vect" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "vect" } } */
/* { dg-do compile } */
/* { dg-require-effective-target vect_complex_add_float } */
-/* { dg-additional-options "-fno-tree-loop-vectorize" } */
+/* { dg-additional-options "-fdump-tree-vect-details" } */
/* { dg-add-options arm_v8_3a_complex_neon } */
#define TYPE float
#define N 16
#include "complex-mls-template.c"
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "slp1" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "slp1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "vect" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "vect" } } */
/* { dg-do compile } */
/* { dg-require-effective-target vect_complex_add_double } */
/* { dg-add-options arm_v8_3a_complex_neon } */
+/* { dg-additional-options "-fdump-tree-vect-details" } */
#define TYPE double
#define N 16
#include "complex-mul-template.c"
-/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "slp1" } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" slp1" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "vect" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" "vect" } } */
#define N 16
#include "complex-mul-template.c"
-/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "slp1" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" "slp1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "slp1" } } */
+/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" "slp1" } } */
proc check_effective_target_vect_complex_add_double { } {
return [check_cached_effective_target_indexed vect_complex_add_double {
expr {
- ([check_effective_target_aarch64_sve2]
- && [check_effective_target_aarch64_little_endian])
+ (([check_effective_target_arm_v8_3a_complex_neon_ok]
+ && [check_effective_target_aarch64_little_endian])
+ || ([check_effective_target_aarch64_sve2]
+ && [check_effective_target_aarch64_little_endian]))
}}]
}
if (linear_loads_p (perm_cache, left_op[index2]) == PERM_EVENODD)
return true;
}
- else if (kind == PERM_EVENODD)
+ else if (kind == PERM_EVENODD && !neg_first)
{
- if ((kind = linear_loads_p (perm_cache, left_op[index2])) == PERM_EVENODD)
+ if ((kind = linear_loads_p (perm_cache, left_op[index2])) != PERM_EVENEVEN)
return false;
return true;
}
- else if (!neg_first)
- *conj_first_operand = true;
+ else if (kind == PERM_EVENEVEN && neg_first)
+ {
+ if ((kind = linear_loads_p (perm_cache, left_op[index2])) != PERM_EVENODD)
+ return false;
+
+ *conj_first_operand = true;
+ return true;
+ }
else
return false;
bool mul0 = vect_match_expression_p (l0node[0], MULT_EXPR);
bool mul1 = vect_match_expression_p (l0node[1], MULT_EXPR);
- if (!mul0 || !mul1)
+ if (!mul0 && !mul1)
return IFN_LAST;
/* Now operand2+4 may lead to another expression. */
{
auto vals = SLP_TREE_CHILDREN (l0node[0]);
/* Check if it's a multiply, otherwise no idea what this is. */
- if (!vect_match_expression_p (vals[1], MULT_EXPR))
+ if (!(mul0 = vect_match_expression_p (vals[1], MULT_EXPR)))
return IFN_LAST;
/* Check if the ADD is linear, otherwise it's not valid complex FMA. */
if (left_op.length () != 2
|| right_op.length () != 2
+ || !mul0
+ || !mul1
|| linear_loads_p (perm_cache, left_op[1]) == PERM_ODDEVEN)
return IFN_LAST;
if (!vect_validate_multiplication (perm_cache, left_op, PERM_EVENEVEN)
|| vect_normalize_conj_loc (left_op))
return IFN_LAST;
- if (!mul0)
+ if (add0)
ifn = IFN_COMPLEX_FMA;
else
ifn = IFN_COMPLEX_MUL;
false))
return IFN_LAST;
- if(!mul0)
+ if(add0)
ifn = IFN_COMPLEX_FMA_CONJ;
else
ifn = IFN_COMPLEX_MUL_CONJ;