]> git.ipfire.org Git - thirdparty/gcc.git/commit
Combine the FADD(A, FMA(B, C, 0)) to FMA(B, C, A) and combine FADD(A, FMUL(B, C)...
authorkonglin1 <lingling.kong@intel.com>
Tue, 19 Oct 2021 01:35:30 +0000 (09:35 +0800)
committerliuhongt <hongtao.liu@intel.com>
Mon, 25 Oct 2021 08:01:14 +0000 (16:01 +0800)
commit7c20a9b738a2257bed4e2b0593275336d1e2047a
tree13410731f65a613f153592262c34da0b14053640
parent37935c01841ce47e989bbdeb567277b206d4ac76
Combine the FADD(A, FMA(B, C, 0)) to FMA(B, C, A) and combine FADD(A, FMUL(B, C)) to FMA(B, C, A).

This patch is to support transform in fast-math something like
_mm512_add_ph(x1, _mm512_fmadd_pch(a, b, _mm512_setzero_ph())) to
 _mm512_fmadd_pch(a, b, x1).

And support transform _mm512_add_ph(x1, _mm512_fmul_pch(a, b))
to _mm512_fmadd_pch(a, b, x1).

gcc/ChangeLog:

* config/i386/sse.md (fma_<mode>_fadd_fmul): Add new
define_insn_and_split.
(fma_<mode>_fadd_fcmul):Likewise
(fma_<complexopname>_<mode>_fma_zero):Likewise

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512fp16-complex-fma.c: New test.
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/avx512fp16-complex-fma.c [new file with mode: 0644]