[llvm] r211104 - [FastISel][X86] Fix previous refactoring commit (r211077)
Juergen Ributzka
juergen at apple.com
Tue Jun 17 07:47:45 PDT 2014
Author: ributzka
Date: Tue Jun 17 09:47:45 2014
New Revision: 211104
URL: http://llvm.org/viewvc/llvm-project?rev=211104&view=rev
Log:
[FastISel][X86] Fix previous refactoring commit (r211077)
Overlooked that fcmp_une uses an "or" instead of an "and" for combining the
flags.
Modified:
llvm/trunk/lib/Target/X86/X86FastISel.cpp
llvm/trunk/test/CodeGen/X86/fast-isel-cmp.ll
Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=211104&r1=211103&r2=211104&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Jun 17 09:47:45 2014
@@ -1049,9 +1049,9 @@ bool X86FastISel::X86SelectCmp(const Ins
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 Ins
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;
Modified: llvm/trunk/test/CodeGen/X86/fast-isel-cmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-cmp.ll?rev=211104&r1=211103&r2=211104&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fast-isel-cmp.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fast-isel-cmp.ll Tue Jun 17 09:47:45 2014
@@ -155,7 +155,7 @@ define zeroext i1 @fcmp_une(float %x, fl
; 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
}
More information about the llvm-commits
mailing list