[X86] When pattern-matching scalar FMA3 intrinsics, don't re-arrange the first and...
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Mon, 25 May 2015 12:35:25 +0000 (12:35 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Mon, 25 May 2015 12:35:25 +0000 (12:35 +0000)
commit8ffbb68a8645ea377904f67a6ec33a2f544c02e0
treecc46cdc2a173b8206c6dfb3bfe42da0e9d41c3b5
parent17b7d6bf2581843f6f86f66bbe95244a0ad7c5a8
[X86] When pattern-matching scalar FMA3 intrinsics, don't re-arrange the first and second operands.

The semantics of the scalar FMA intrinsics are that the high vector elements are copied from the first source.
The existing pattern switches src1 and src2 around, to match the "213" order, which ends up tying the original src2 to the dest. Since the actual scalar fma3 instructions copy the high elements from the dest register, the wrong values are copied.

This modifies the pattern to leave src1 and src2 in their original order.

Differential Revision: http://reviews.llvm.org/D9908

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238131 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrFMA.td
test/CodeGen/X86/fma3-intrinsics.ll