1 //===-- iBinaryOperators.cpp - Implement the BinaryOperators -----*- C++ -*--=//
3 // This file implements the nontrivial binary operator instructions.
5 //===----------------------------------------------------------------------===//
7 #include "llvm/iBinary.h"
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 SetCondInst::SetCondInst(BinaryOps opType, Value *S1, Value *S2,
16 : BinaryOperator(opType, S1, S2, Name) {
19 setType(Type::BoolTy); // setcc instructions always return bool type.
21 // Make sure it's a valid type...
22 assert(getOpcode() != "Invalid opcode type to SetCondInst class!");
25 string SetCondInst::getOpcode() const {
27 case SetLE: return "setle";
28 case SetGE: return "setge";
29 case SetLT: return "setlt";
30 case SetGT: return "setgt";
31 case SetEQ: return "seteq";
32 case SetNE: return "setne";
34 assert(0 && "Invalid opcode type to SetCondInst class!");
35 return "invalid opcode type to SetCondInst";