blob: 972e13852ed41fad72a2fe221f1cec9cc56ba27d [file] [log] [blame]
Chris Lattner8c6a41e2006-11-17 22:10:59 +00001//===-- PPCPredicates.h - PPC Branch Predicate Information ------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner8c6a41e2006-11-17 22:10:59 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file describes the PowerPC branch predicates.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H
15#define LLVM_TARGET_POWERPC_PPCPREDICATES_H
16
Rafael Espindolafb8ac2d2012-12-20 05:13:09 +000017// GCC #defines PPC on Linux but we use it as our namespace name
18#undef PPC
19
Chris Lattner8c6a41e2006-11-17 22:10:59 +000020namespace llvm {
21namespace PPC {
22 /// Predicate - These are "(BI << 5) | BO" for various predicates.
23 enum Predicate {
24 PRED_ALWAYS = (0 << 5) | 20,
25 PRED_LT = (0 << 5) | 12,
26 PRED_LE = (1 << 5) | 4,
27 PRED_EQ = (2 << 5) | 12,
28 PRED_GE = (0 << 5) | 4,
29 PRED_GT = (1 << 5) | 12,
30 PRED_NE = (2 << 5) | 4,
31 PRED_UN = (3 << 5) | 12,
32 PRED_NU = (3 << 5) | 4
33 };
34
35 /// Invert the specified predicate. != -> ==, < -> >=.
36 Predicate InvertPredicate(Predicate Opcode);
37}
38}
39
40#endif