Skip to content

Commit

Permalink
X86: fcmov doesn't handle all possible EFLAGS, fall back to a branch …
Browse files Browse the repository at this point in the history
…for the others.

Otherwise it will try to use SSE patterns and fail horribly if sse is disabled.
Fixes PR14035.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165377 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
d0k committed Oct 7, 2012
1 parent b10c88f commit dcf2420
Show file tree
Hide file tree
Showing 2 changed files with 459 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Target/X86/X86InstrCompiler.td
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,21 @@ def CMOV_GR16 : I<0, Pseudo,
"#CMOV_GR16* PSEUDO!",
[(set GR16:$dst,
(X86cmov GR16:$src1, GR16:$src2, imm:$cond, EFLAGS))]>;
} // Predicates = [NoCMov]

// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no
// SSE1.
let Predicates = [FPStackf32] in
def CMOV_RFP32 : I<0, Pseudo,
(outs RFP32:$dst),
(ins RFP32:$src1, RFP32:$src2, i8imm:$cond),
"#CMOV_RFP32 PSEUDO!",
[(set RFP32:$dst,
(X86cmov RFP32:$src1, RFP32:$src2, imm:$cond,
EFLAGS))]>;
// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no
// SSE2.
let Predicates = [FPStackf64] in
def CMOV_RFP64 : I<0, Pseudo,
(outs RFP64:$dst),
(ins RFP64:$src1, RFP64:$src2, i8imm:$cond),
Expand All @@ -467,7 +475,6 @@ def CMOV_RFP80 : I<0, Pseudo,
[(set RFP80:$dst,
(X86cmov RFP80:$src1, RFP80:$src2, imm:$cond,
EFLAGS))]>;
} // Predicates = [NoCMov]
} // UsesCustomInserter = 1, Uses = [EFLAGS]


Expand Down
Loading

0 comments on commit dcf2420

Please sign in to comment.