1226584Sdim//===-- PPCPredicates.h - PPC Branch Predicate Information ------*- C++ -*-===//
2226584Sdim//
3226584Sdim//                     The LLVM Compiler Infrastructure
4226584Sdim//
5226584Sdim// This file is distributed under the University of Illinois Open Source
6226584Sdim// License. See LICENSE.TXT for details.
7226584Sdim//
8226584Sdim//===----------------------------------------------------------------------===//
9226584Sdim//
10226584Sdim// This file describes the PowerPC branch predicates.
11226584Sdim//
12226584Sdim//===----------------------------------------------------------------------===//
13226584Sdim
14226584Sdim#ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H
15226584Sdim#define LLVM_TARGET_POWERPC_PPCPREDICATES_H
16226584Sdim
17249423Sdim// GCC #defines PPC on Linux but we use it as our namespace name
18249423Sdim#undef PPC
19249423Sdim
20249423Sdim// Generated files will use "namespace PPC". To avoid symbol clash,
21249423Sdim// undefine PPC here. PPC may be predefined on some hosts.
22249423Sdim#undef PPC
23249423Sdim
24226584Sdimnamespace llvm {
25226584Sdimnamespace PPC {
26226584Sdim  /// Predicate - These are "(BI << 5) | BO"  for various predicates.
27226584Sdim  enum Predicate {
28226584Sdim    PRED_LT     = (0 << 5) | 12,
29226584Sdim    PRED_LE     = (1 << 5) |  4,
30226584Sdim    PRED_EQ     = (2 << 5) | 12,
31226584Sdim    PRED_GE     = (0 << 5) |  4,
32226584Sdim    PRED_GT     = (1 << 5) | 12,
33226584Sdim    PRED_NE     = (2 << 5) |  4,
34226584Sdim    PRED_UN     = (3 << 5) | 12,
35226584Sdim    PRED_NU     = (3 << 5) |  4
36226584Sdim  };
37226584Sdim
38226584Sdim  /// Invert the specified predicate.  != -> ==, < -> >=.
39226584Sdim  Predicate InvertPredicate(Predicate Opcode);
40251662Sdim
41251662Sdim  /// Assume the condition register is set by MI(a,b), return the predicate if
42251662Sdim  /// we modify the instructions such that condition register is set by MI(b,a).
43251662Sdim  Predicate getSwappedPredicate(Predicate Opcode);
44226584Sdim}
45226584Sdim}
46226584Sdim
47226584Sdim#endif
48