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 "llvm/Support/ErrorHandling.h"
00016 #include <cassert>
00017 using namespace llvm;
00018 
00019 PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) {
00020   switch (Opcode) {
00021   default: llvm_unreachable("Unknown PPC branch opcode!");
00022   case PPC::PRED_EQ: return PPC::PRED_NE;
00023   case PPC::PRED_NE: return PPC::PRED_EQ;
00024   case PPC::PRED_LT: return PPC::PRED_GE;
00025   case PPC::PRED_GE: return PPC::PRED_LT;
00026   case PPC::PRED_GT: return PPC::PRED_LE;
00027   case PPC::PRED_LE: return PPC::PRED_GT;
00028   case PPC::PRED_NU: return PPC::PRED_UN;
00029   case PPC::PRED_UN: return PPC::PRED_NU;
00030   }
00031 }