mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
[FastISel][X86] Fix previous refactoring commit (r211077)
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
This commit is contained in:
parent
199da600f3
commit
1d5ff6bb7a
@ -1049,9 +1049,9 @@ bool X86FastISel::X86SelectCmp(const Instruction *I) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// FCMP_OEQ and FCMP_UNE cannot be checked with a single instruction.
|
// FCMP_OEQ and FCMP_UNE cannot be checked with a single instruction.
|
||||||
static unsigned SETFOpcTable[2][2] = {
|
static unsigned SETFOpcTable[2][3] = {
|
||||||
{ X86::SETEr, X86::SETNPr },
|
{ X86::SETEr, X86::SETNPr, X86::AND8rr },
|
||||||
{ X86::SETNEr, X86::SETPr }
|
{ X86::SETNEr, X86::SETPr, X86::OR8rr }
|
||||||
};
|
};
|
||||||
unsigned *SETFOpc = nullptr;
|
unsigned *SETFOpc = nullptr;
|
||||||
switch (CI->getPredicate()) {
|
switch (CI->getPredicate()) {
|
||||||
@ -1071,7 +1071,7 @@ bool X86FastISel::X86SelectCmp(const Instruction *I) {
|
|||||||
FlagReg1);
|
FlagReg1);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(SETFOpc[1]),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(SETFOpc[1]),
|
||||||
FlagReg2);
|
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);
|
ResultReg).addReg(FlagReg1).addReg(FlagReg2);
|
||||||
UpdateValueMap(I, ResultReg);
|
UpdateValueMap(I, ResultReg);
|
||||||
return true;
|
return true;
|
||||||
|
@ -155,7 +155,7 @@ define zeroext i1 @fcmp_une(float %x, float %y) {
|
|||||||
; FAST: ucomiss %xmm1, %xmm0
|
; FAST: ucomiss %xmm1, %xmm0
|
||||||
; FAST-NEXT: setne %al
|
; FAST-NEXT: setne %al
|
||||||
; FAST-NEXT: setp %cl
|
; FAST-NEXT: setp %cl
|
||||||
; FAST-NEXT: andb %al, %cl
|
; FAST-NEXT: orb %al, %cl
|
||||||
%1 = fcmp une float %x, %y
|
%1 = fcmp une float %x, %y
|
||||||
ret i1 %1
|
ret i1 %1
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user