aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-10-21 19:16:49 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-10-21 19:16:49 +0000
commit3926fb63c24ceeefc0215b8e14eb81c85403639e (patch)
treef0a73573c10869eea25ddcb2842a10eca4674e52 /lib
parent68afa54033eccda0f55e920cb548588e71a45418 (diff)
downloadexternal_llvm-3926fb63c24ceeefc0215b8e14eb81c85403639e.zip
external_llvm-3926fb63c24ceeefc0215b8e14eb81c85403639e.tar.gz
external_llvm-3926fb63c24ceeefc0215b8e14eb81c85403639e.tar.bz2
Cosmetic changes, no functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp12
-rw-r--r--lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp14
-rw-r--r--lib/Target/MSP430/MSP430.h14
-rw-r--r--lib/Target/MSP430/MSP430ISelLowering.cpp27
-rw-r--r--lib/Target/MSP430/MSP430InstrInfo.h14
5 files changed, 40 insertions, 41 deletions
diff --git a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
index 4f5879a..ace358e 100644
--- a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
+++ b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
@@ -250,22 +250,22 @@ void MSP430AsmPrinter::printCCOperand(const MachineInstr *MI, int OpNum) {
default:
llvm_unreachable("Unsupported CC code");
break;
- case MSP430::COND_E:
+ case MSP430CC::COND_E:
O << "eq";
break;
- case MSP430::COND_NE:
+ case MSP430CC::COND_NE:
O << "ne";
break;
- case MSP430::COND_HS:
+ case MSP430CC::COND_HS:
O << "hs";
break;
- case MSP430::COND_LO:
+ case MSP430CC::COND_LO:
O << "lo";
break;
- case MSP430::COND_GE:
+ case MSP430CC::COND_GE:
O << "ge";
break;
- case MSP430::COND_L:
+ case MSP430CC::COND_L:
O << 'l';
break;
}
diff --git a/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp b/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp
index 8f1ee81..a3ecc67 100644
--- a/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp
+++ b/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "asm-printer"
+#include "MSP430.h"
#include "MSP430InstrInfo.h"
#include "MSP430InstPrinter.h"
#include "llvm/MC/MCInst.h"
@@ -19,7 +20,6 @@
#include "llvm/MC/MCExpr.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
-#include "MSP430GenInstrNames.inc"
using namespace llvm;
@@ -94,22 +94,22 @@ void MSP430InstPrinter::printCCOperand(const MCInst *MI, unsigned OpNo) {
default:
llvm_unreachable("Unsupported CC code");
break;
- case MSP430::COND_E:
+ case MSP430CC::COND_E:
O << "eq";
break;
- case MSP430::COND_NE:
+ case MSP430CC::COND_NE:
O << "ne";
break;
- case MSP430::COND_HS:
+ case MSP430CC::COND_HS:
O << "hs";
break;
- case MSP430::COND_LO:
+ case MSP430CC::COND_LO:
O << "lo";
break;
- case MSP430::COND_GE:
+ case MSP430CC::COND_GE:
O << "ge";
break;
- case MSP430::COND_L:
+ case MSP430CC::COND_L:
O << 'l';
break;
}
diff --git a/lib/Target/MSP430/MSP430.h b/lib/Target/MSP430/MSP430.h
index d9f5f86..1ff178d 100644
--- a/lib/Target/MSP430/MSP430.h
+++ b/lib/Target/MSP430/MSP430.h
@@ -17,6 +17,20 @@
#include "llvm/Target/TargetMachine.h"
+namespace MSP430CC {
+ // MSP430 specific condition code.
+ enum CondCodes {
+ COND_E = 0, // aka COND_Z
+ COND_NE = 1, // aka COND_NZ
+ COND_HS = 2, // aka COND_C
+ COND_LO = 3, // aka COND_NC
+ COND_GE = 4,
+ COND_L = 5,
+
+ COND_INVALID = -1
+ };
+}
+
namespace llvm {
class MSP430TargetMachine;
class FunctionPass;
diff --git a/lib/Target/MSP430/MSP430ISelLowering.cpp b/lib/Target/MSP430/MSP430ISelLowering.cpp
index b56f069..34e6d2c 100644
--- a/lib/Target/MSP430/MSP430ISelLowering.cpp
+++ b/lib/Target/MSP430/MSP430ISelLowering.cpp
@@ -567,44 +567,45 @@ SDValue MSP430TargetLowering::LowerExternalSymbol(SDValue Op,
return DAG.getNode(MSP430ISD::Wrapper, dl, getPointerTy(), Result);;
}
-static SDValue EmitCMP(SDValue &LHS, SDValue &RHS, unsigned &TargetCC,
+static SDValue EmitCMP(SDValue &LHS, SDValue &RHS, SDValue &TargetCC,
ISD::CondCode CC,
DebugLoc dl, SelectionDAG &DAG) {
// FIXME: Handle bittests someday
assert(!LHS.getValueType().isFloatingPoint() && "We don't handle FP yet");
// FIXME: Handle jump negative someday
- TargetCC = MSP430::COND_INVALID;
+ MSP430CC::CondCodes TCC = MSP430CC::COND_INVALID;
switch (CC) {
default: llvm_unreachable("Invalid integer condition!");
case ISD::SETEQ:
- TargetCC = MSP430::COND_E; // aka COND_Z
+ TCC = MSP430CC::COND_E; // aka COND_Z
break;
case ISD::SETNE:
- TargetCC = MSP430::COND_NE; // aka COND_NZ
+ TCC = MSP430CC::COND_NE; // aka COND_NZ
break;
case ISD::SETULE:
std::swap(LHS, RHS); // FALLTHROUGH
case ISD::SETUGE:
- TargetCC = MSP430::COND_HS; // aka COND_C
+ TCC = MSP430CC::COND_HS; // aka COND_C
break;
case ISD::SETUGT:
std::swap(LHS, RHS); // FALLTHROUGH
case ISD::SETULT:
- TargetCC = MSP430::COND_LO; // aka COND_NC
+ TCC = MSP430CC::COND_LO; // aka COND_NC
break;
case ISD::SETLE:
std::swap(LHS, RHS); // FALLTHROUGH
case ISD::SETGE:
- TargetCC = MSP430::COND_GE;
+ TCC = MSP430CC::COND_GE;
break;
case ISD::SETGT:
std::swap(LHS, RHS); // FALLTHROUGH
case ISD::SETLT:
- TargetCC = MSP430::COND_L;
+ TCC = MSP430CC::COND_L;
break;
}
+ TargetCC = DAG.getConstant(TCC, MVT::i8);
return DAG.getNode(MSP430ISD::CMP, dl, MVT::Flag, LHS, RHS);
}
@@ -617,13 +618,11 @@ SDValue MSP430TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) {
SDValue Dest = Op.getOperand(4);
DebugLoc dl = Op.getDebugLoc();
- unsigned TargetCC = MSP430::COND_INVALID;
+ SDValue TargetCC;
SDValue Flag = EmitCMP(LHS, RHS, TargetCC, CC, dl, DAG);
return DAG.getNode(MSP430ISD::BR_CC, dl, Op.getValueType(),
- Chain,
- Dest, DAG.getConstant(TargetCC, MVT::i8),
- Flag);
+ Chain, Dest, TargetCC, Flag);
}
SDValue MSP430TargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) {
@@ -634,14 +633,14 @@ SDValue MSP430TargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) {
ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(4))->get();
DebugLoc dl = Op.getDebugLoc();
- unsigned TargetCC = MSP430::COND_INVALID;
+ SDValue TargetCC;
SDValue Flag = EmitCMP(LHS, RHS, TargetCC, CC, dl, DAG);
SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Flag);
SmallVector<SDValue, 4> Ops;
Ops.push_back(TrueV);
Ops.push_back(FalseV);
- Ops.push_back(DAG.getConstant(TargetCC, MVT::i8));
+ Ops.push_back(TargetCC);
Ops.push_back(Flag);
return DAG.getNode(MSP430ISD::SELECT_CC, dl, VTs, &Ops[0], Ops.size());
diff --git a/lib/Target/MSP430/MSP430InstrInfo.h b/lib/Target/MSP430/MSP430InstrInfo.h
index e07aaca..06c0c71 100644
--- a/lib/Target/MSP430/MSP430InstrInfo.h
+++ b/lib/Target/MSP430/MSP430InstrInfo.h
@@ -21,20 +21,6 @@ namespace llvm {
class MSP430TargetMachine;
-namespace MSP430 {
- // MSP430 specific condition code.
- enum CondCode {
- COND_E = 0, // aka COND_Z
- COND_NE = 1, // aka COND_NZ
- COND_HS = 2, // aka COND_C
- COND_LO = 3, // aka COND_NC
- COND_GE = 4,
- COND_L = 5,
-
- COND_INVALID
- };
-}
-
class MSP430InstrInfo : public TargetInstrInfoImpl {
const MSP430RegisterInfo RI;
MSP430TargetMachine &TM;