LLVM 20.0.0git
PPCPredicates.cpp
Go to the documentation of this file.
1//===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the PowerPC branch predicates.
10//
11//===----------------------------------------------------------------------===//
12
13#include "PPCPredicates.h"
15using namespace llvm;
16
18 switch (Opcode) {
19 case PPC::PRED_EQ: return PPC::PRED_NE;
20 case PPC::PRED_NE: return PPC::PRED_EQ;
21 case PPC::PRED_LT: return PPC::PRED_GE;
22 case PPC::PRED_GE: return PPC::PRED_LT;
23 case PPC::PRED_GT: return PPC::PRED_LE;
24 case PPC::PRED_LE: return PPC::PRED_GT;
25 case PPC::PRED_NU: return PPC::PRED_UN;
26 case PPC::PRED_UN: return PPC::PRED_NU;
43
44 // Simple predicates for single condition-register bits.
47 }
48 llvm_unreachable("Unknown PPC branch opcode!");
49}
50
52 switch (Opcode) {
53 case PPC::PRED_EQ: return PPC::PRED_EQ;
54 case PPC::PRED_NE: return PPC::PRED_NE;
55 case PPC::PRED_LT: return PPC::PRED_GT;
56 case PPC::PRED_GE: return PPC::PRED_LE;
57 case PPC::PRED_GT: return PPC::PRED_LT;
58 case PPC::PRED_LE: return PPC::PRED_GE;
59 case PPC::PRED_NU: return PPC::PRED_NU;
60 case PPC::PRED_UN: return PPC::PRED_UN;
77
80 llvm_unreachable("Invalid use of bit predicate code");
81 }
82 llvm_unreachable("Unknown PPC branch opcode!");
83}
84
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Predicate getSwappedPredicate(Predicate Opcode)
Assume the condition register is set by MI(a,b), return the predicate if we modify the instructions s...
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:26
Predicate InvertPredicate(Predicate Opcode)
Invert the specified predicate. != -> ==, < -> >=.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18