diff options
author | Juergen Ributzka <juergen@apple.com> | 2014-06-16 23:58:24 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2014-06-16 23:58:24 +0000 |
commit | 408691f9673fb69b5ed45326f6ded4f3b6f19c50 (patch) | |
tree | 215ebd23bb95a3f5b16741f9da31deef80865f84 /lib/Target/X86/X86InstrInfo.h | |
parent | 4046db0cdb53b5383b2234f29d0ff478f5293b4b (diff) | |
download | llvm-408691f9673fb69b5ed45326f6ded4f3b6f19c50.tar.gz llvm-408691f9673fb69b5ed45326f6ded4f3b6f19c50.tar.bz2 llvm-408691f9673fb69b5ed45326f6ded4f3b6f19c50.tar.xz |
[FastISel][X86] Refactor the code to get the X86 condition from a helper function. NFC.
Make use of helper functions to simplify the branch and compare instruction
selection in FastISel. Also add test cases for compare and conditonal branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.h')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h index 18ee24a8e3..d76c52ce47 100644 --- a/lib/Target/X86/X86InstrInfo.h +++ b/lib/Target/X86/X86InstrInfo.h @@ -46,6 +46,7 @@ namespace X86 { COND_O = 13, COND_P = 14, COND_S = 15, + LAST_VALID_COND = COND_S, // Artificial condition codes. These are used by AnalyzeBranch // to indicate a block terminated with two conditional branches to @@ -61,12 +62,16 @@ namespace X86 { // Turn condition code into conditional branch opcode. unsigned GetCondBranchFromCond(CondCode CC); + /// \brief Return a set opcode for the given condition and whether it has + /// a memory operand. + unsigned getSETFromCond(CondCode CC, bool HasMemoryOperand = false); + // Turn CMov opcode into condition code. CondCode getCondFromCMovOpc(unsigned Opc); /// GetOppositeBranchCondition - Return the inverse of the specified cond, /// e.g. turning COND_E to COND_NE. - CondCode GetOppositeBranchCondition(X86::CondCode CC); + CondCode GetOppositeBranchCondition(CondCode CC); } // end namespace X86; |