[FastISel][X86] Fix previous refactoring commit (r211077)
authorJuergen Ributzka <juergen@apple.com>
Tue, 17 Jun 2014 14:47:45 +0000 (14:47 +0000)
committerJuergen Ributzka <juergen@apple.com>
Tue, 17 Jun 2014 14:47:45 +0000 (14:47 +0000)
Overlooked that fcmp_une uses an "or" instead of an "and" for combining the
flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211104 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/fast-isel-cmp.ll

index 80cc99bb80cce1005a4204eb1815a85793a66832..6a4a467f6a9a70632a5898449c18da1e720fb2fe 100644 (file)
@@ -1049,9 +1049,9 @@ bool X86FastISel::X86SelectCmp(const Instruction *I) {
     return false;
 
   // FCMP_OEQ and FCMP_UNE cannot be checked with a single instruction.
-  static unsigned SETFOpcTable[2][2] = {
-    { X86::SETEr,  X86::SETNPr },
-    { X86::SETNEr, X86::SETPr  }
+  static unsigned SETFOpcTable[2][3] = {
+    { X86::SETEr,  X86::SETNPr, X86::AND8rr },
+    { X86::SETNEr, X86::SETPr,  X86::OR8rr  }
   };
   unsigned *SETFOpc = nullptr;
   switch (CI->getPredicate()) {
@@ -1071,7 +1071,7 @@ bool X86FastISel::X86SelectCmp(const Instruction *I) {
             FlagReg1);
     BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(SETFOpc[1]),
             FlagReg2);
-    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(X86::AND8rr),
+    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(SETFOpc[2]),
             ResultReg).addReg(FlagReg1).addReg(FlagReg2);
     UpdateValueMap(I, ResultReg);
     return true;
index edf1263a3eac3b741d13905ae45f0f0ac82c8de8..61cc67a244e4b1017252ee591f284a31d97a5d45 100644 (file)
@@ -155,7 +155,7 @@ define zeroext i1 @fcmp_une(float %x, float %y) {
 ; FAST:       ucomiss  %xmm1, %xmm0
 ; FAST-NEXT:  setne    %al
 ; FAST-NEXT:  setp     %cl
-; FAST-NEXT:  andb     %al, %cl
+; FAST-NEXT:  orb      %al, %cl
   %1 = fcmp une float %x, %y
   ret i1 %1
 }