mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 16:31:16 +00:00
7e17024400
Now that the PRED_BAD has been removed, this is failing the Clang -Werror build due to -Wcovered-switch-default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183863 91177308-0d34-0410-b5e6-96231b3b80d8
47 lines
1.5 KiB
C++
47 lines
1.5 KiB
C++
//===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements the PowerPC branch predicates.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "PPCPredicates.h"
|
|
#include "llvm/Support/ErrorHandling.h"
|
|
#include <cassert>
|
|
using namespace llvm;
|
|
|
|
PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) {
|
|
switch (Opcode) {
|
|
case PPC::PRED_EQ: return PPC::PRED_NE;
|
|
case PPC::PRED_NE: return PPC::PRED_EQ;
|
|
case PPC::PRED_LT: return PPC::PRED_GE;
|
|
case PPC::PRED_GE: return PPC::PRED_LT;
|
|
case PPC::PRED_GT: return PPC::PRED_LE;
|
|
case PPC::PRED_LE: return PPC::PRED_GT;
|
|
case PPC::PRED_NU: return PPC::PRED_UN;
|
|
case PPC::PRED_UN: return PPC::PRED_NU;
|
|
}
|
|
llvm_unreachable("Unknown PPC branch opcode!");
|
|
}
|
|
|
|
PPC::Predicate PPC::getSwappedPredicate(PPC::Predicate Opcode) {
|
|
switch (Opcode) {
|
|
case PPC::PRED_EQ: return PPC::PRED_EQ;
|
|
case PPC::PRED_NE: return PPC::PRED_NE;
|
|
case PPC::PRED_LT: return PPC::PRED_GT;
|
|
case PPC::PRED_GE: return PPC::PRED_LE;
|
|
case PPC::PRED_GT: return PPC::PRED_LT;
|
|
case PPC::PRED_LE: return PPC::PRED_GE;
|
|
case PPC::PRED_NU: return PPC::PRED_NU;
|
|
case PPC::PRED_UN: return PPC::PRED_UN;
|
|
}
|
|
llvm_unreachable("Unknown PPC branch opcode!");
|
|
}
|
|
|