LLVM API Documentation

PPCPredicates.cpp

Go to the documentation of this file.
00001 //===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements the PowerPC branch predicates.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "PPCPredicates.h"
00015 #include <cassert>
00016 using namespace llvm;
00017 
00018 PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) {
00019   switch (Opcode) {
00020   default: assert(0 && "Unknown PPC branch opcode!");
00021   case PPC::PRED_EQ: return PPC::PRED_NE;
00022   case PPC::PRED_NE: return PPC::PRED_EQ;
00023   case PPC::PRED_LT: return PPC::PRED_GE;
00024   case PPC::PRED_GE: return PPC::PRED_LT;
00025   case PPC::PRED_GT: return PPC::PRED_LE;
00026   case PPC::PRED_LE: return PPC::PRED_GT;
00027   case PPC::PRED_NU: return PPC::PRED_UN;
00028   case PPC::PRED_UN: return PPC::PRED_NU;
00029   }
00030 }