[X86][SSE] Float comparisons can sometimes be safely commuted
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 26 Jan 2015 22:29:24 +0000 (22:29 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 26 Jan 2015 22:29:24 +0000 (22:29 +0000)
commit0629ba1ad9437ef0d188cbfd03cc57775d372243
tree817f89275f498fa52423bde2449b05d78a32167c
parent9d7a15c80d77810305a56935ad6444cb89ba859e
[X86][SSE] Float comparisons can sometimes be safely commuted

For ordered, unordered, equal and not-equal tests, packed float and double comparison instructions can be safely commuted without affecting the results. This patch checks the comparison mode of the (v)cmpps + (v)cmppd instructions and commutes the result if it can.

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

llvm-svn: 227145
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/lib/Target/X86/X86InstrSSE.td
llvm/test/CodeGen/X86/commute-fcmp.ll [new file with mode: 0644]