middle-end: Support complex Addition
authorTamar Christina <tamar.christina@arm.com>
Sun, 13 Dec 2020 13:54:48 +0000 (13:54 +0000)
committerTamar Christina <tamar.christina@arm.com>
Sun, 13 Dec 2020 14:09:11 +0000 (14:09 +0000)
commit3ed472af6bc9f83b7a8ac553b282f659a0bf53f7
treedd5b80e24ed5ac6b8a0faed24badd4003cf4c041
parent10bbba9145700e2c3b4709c1041c66d8ff85c7f1
middle-end: Support complex Addition

This patch adds support for

  * Complex Addition with rotation of 90 and 270.

  Addition with rotation of the second argument around the Argand plane.
    Supported rotations are 90 and 180.

    c = a + (b * I) and c = a + (b * I * I * I)

gcc/ChangeLog:

* tree-vect-slp-patterns.c: New file.
* Makefile.in: Add it.
* doc/passes.texi: Document it.
* internal-fn.def (COMPLEX_ADD_ROT90, COMPLEX_ADD_ROT270): New.
* optabs.def (cadd90_optab, cadd270_optab): New.
* doc/md.texi: Document them.
* tree-vect-loop.c (vect_analyze_loop_2): Add dissolve code.
* tree-vect-slp.c:
(vect_free_slp_instance, vect_create_new_slp_node): Export.
(vect_match_slp_patterns_2, vect_match_slp_patterns): New.
(vect_analyze_slp): Use it.
* tree-vectorizer.h (vect_free_slp_tree): Export.
(enum _complex_operation): Forward declare.
(class vect_pattern): New

gcc/testsuite/ChangeLog:

* lib/target-supports.exp
(check_effective_target_arm_v8_3a_complex_neon_ok_nocache): Fix it.
(check_effective_target_vect_complex_add_byte
,check_effective_target_vect_complex_add_int
,check_effective_target_vect_complex_add_short
,check_effective_target_vect_complex_add_long
,check_effective_target_vect_complex_add_half
,check_effective_target_vect_complex_add_float
,check_effective_target_vect_complex_add_double): New.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-byte.c: New test.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-int.c: New test.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-long.c: New test.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-short.c: New test.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-byte.c: New test.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-int.c: New test.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-long.c: New test.
* gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-short.c: New test.
* gcc.dg/vect/complex/complex-add-pattern-template.c: New test.
* gcc.dg/vect/complex/complex-add-template.c: New test.
* gcc.dg/vect/complex/complex-operations-run.c: New test.
* gcc.dg/vect/complex/complex-operations.c: New test.
* gcc.dg/vect/complex/complex.exp: New test.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c: New test.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c: New test.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-half-float.c: New test.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-double.c: New test.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c: New test.
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c: New test.
* gcc.dg/vect/complex/fast-math-complex-add-double.c: New test.
* gcc.dg/vect/complex/fast-math-complex-add-float.c: New test.
* gcc.dg/vect/complex/fast-math-complex-add-half-float.c: New test.
* gcc.dg/vect/complex/fast-math-complex-add-pattern-double.c: New test.
* gcc.dg/vect/complex/fast-math-complex-add-pattern-float.c: New test.
* gcc.dg/vect/complex/fast-math-complex-add-pattern-half-float.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-byte.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-int.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-long.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-short.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-byte.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-int.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-long.c: New test.
* gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-short.c: New test.
43 files changed:
gcc/Makefile.in
gcc/doc/md.texi
gcc/doc/passes.texi
gcc/internal-fn.def
gcc/optabs.def
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-byte.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-int.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-long.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-short.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-byte.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-int.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-long.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/bb-slp-complex-add-pattern-unsigned-short.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/complex-add-pattern-template.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/complex-add-template.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/complex-operations-run.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/complex-operations.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/complex.exp [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-half-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-double.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-complex-add-double.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-complex-add-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-complex-add-half-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-complex-add-pattern-double.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-complex-add-pattern-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/fast-math-complex-add-pattern-half-float.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-byte.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-int.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-long.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-short.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-byte.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-int.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-long.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/complex/vect-complex-add-pattern-unsigned-short.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp
gcc/tree-vect-loop.c
gcc/tree-vect-slp-patterns.c [new file with mode: 0644]
gcc/tree-vect-slp.c
gcc/tree-vectorizer.h