1 //===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file implements the PowerPC branch predicates. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #include "PPCPredicates.h" 15 #include "llvm/Support/ErrorHandling.h" 16 #include <cassert> 17 using namespace llvm; 18 19 PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) { 20 switch (Opcode) { 21 default: llvm_unreachable("Unknown PPC branch opcode!"); 22 case PPC::PRED_EQ: return PPC::PRED_NE; 23 case PPC::PRED_NE: return PPC::PRED_EQ; 24 case PPC::PRED_LT: return PPC::PRED_GE; 25 case PPC::PRED_GE: return PPC::PRED_LT; 26 case PPC::PRED_GT: return PPC::PRED_LE; 27 case PPC::PRED_LE: return PPC::PRED_GT; 28 case PPC::PRED_NU: return PPC::PRED_UN; 29 case PPC::PRED_UN: return PPC::PRED_NU; 30 } 31 } 32