[AArch64 NEON] Fixed fused multiply negate add/sub patterns
authorAna Pazos <apazos@codeaurora.org>
Tue, 24 Dec 2013 00:40:10 +0000 (00:40 +0000)
committerAna Pazos <apazos@codeaurora.org>
Tue, 24 Dec 2013 00:40:10 +0000 (00:40 +0000)
commitf5bfe97875de91fa9eabc23b0e8abb76965d1aa7
treeead236742802ef45e99bb4475672557fc6c0fe07
parentb8a316bfcbaa7322e254603545e9f5dcbd445a35
[AArch64 NEON] Fixed fused multiply negate add/sub patterns

The correct pattern matching should be:

- fnmadd is (-Ra) + (-Rn)*Rm  which should be matched as:

  fma (fneg node:$Rn),  node:$Rm, (fneg node:$Ra) and as

  (f32 (fsub (f32 (fneg FPR32:$Ra)), (f32 (fmul FPR32:$Rn, FPR32:$Rm))))

- fnmsub is (-Ra) + Rn*Rm which should be matched as

  fma node:$Rn,  node:$Rm, (fneg node:$Ra) and as

  (f32 (fsub (f32 (fmul FPR32:$Rn, FPR32:$Rm)), FPR32:$Ra))))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197928 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64InstrInfo.td
test/CodeGen/AArch64/fp-dp3.ll
test/CodeGen/AArch64/neon-fma.ll