mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Add new SetCondInst::getInverseCondition() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3405 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bacb8b9a00
commit
e825bde125
@ -122,3 +122,19 @@ SetCondInst::SetCondInst(BinaryOps opType, Value *S1, Value *S2,
|
||||
// Make sure it's a valid type...
|
||||
assert(getOpcodeName() != 0);
|
||||
}
|
||||
|
||||
// getInverseCondition - Return the inverse of the current condition opcode.
|
||||
// For example seteq -> setne, setgt -> setle, setlt -> setge, etc...
|
||||
//
|
||||
Instruction::BinaryOps SetCondInst::getInverseCondition() const {
|
||||
switch (getOpcode()) {
|
||||
default:
|
||||
assert(0 && "Unknown setcc opcode!");
|
||||
case SetEQ: return SetNE;
|
||||
case SetNE: return SetEQ;
|
||||
case SetGT: return SetLE;
|
||||
case SetLT: return SetGE;
|
||||
case SetGE: return SetLT;
|
||||
case SetLE: return SetGT;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user