Update comments.
[llvm/msp430.git] / lib / Target / PIC16 / PIC16.h
blob786081dc1d2b6b6de0275bd878d05134cf3210ef
1 //===-- PIC16.h - Top-level interface for PIC16 representation --*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the entry points for global functions defined in
11 // the LLVM PIC16 back-end.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TARGET_PIC16_H
16 #define LLVM_TARGET_PIC16_H
18 #include <iosfwd>
19 #include <cassert>
21 namespace llvm {
22 class PIC16TargetMachine;
23 class FunctionPass;
24 class MachineCodeEmitter;
25 class raw_ostream;
27 namespace PIC16CC {
28 enum CondCodes {
29 EQ,
30 NE,
31 LT,
32 LE,
33 GT,
34 GE,
35 ULT,
36 UGT,
37 ULE,
38 UGE
42 inline static const char *PIC16CondCodeToString(PIC16CC::CondCodes CC) {
43 switch (CC) {
44 default: assert(0 && "Unknown condition code");
45 case PIC16CC::NE: return "ne";
46 case PIC16CC::EQ: return "eq";
47 case PIC16CC::LT: return "lt";
48 case PIC16CC::ULT: return "lt";
49 case PIC16CC::LE: return "le";
50 case PIC16CC::GT: return "gt";
51 case PIC16CC::UGT: return "gt";
52 case PIC16CC::GE: return "ge";
56 inline static bool isSignedComparison(PIC16CC::CondCodes CC) {
57 switch (CC) {
58 default: assert(0 && "Unknown condition code");
59 case PIC16CC::NE:
60 case PIC16CC::EQ:
61 case PIC16CC::LT:
62 case PIC16CC::LE:
63 case PIC16CC::GE:
64 case PIC16CC::GT:
65 return true;
66 case PIC16CC::ULT:
67 case PIC16CC::UGT:
68 case PIC16CC::ULE:
69 case PIC16CC::UGE:
70 return false; // condition codes for unsigned comparison.
75 FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM);
76 FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS,
77 PIC16TargetMachine &TM,
78 bool Fast, bool Verbose);
79 } // end namespace llvm;
81 // Defines symbolic names for PIC16 registers. This defines a mapping from
82 // register name to register number.
83 #include "PIC16GenRegisterNames.inc"
85 // Defines symbolic names for the PIC16 instructions.
86 #include "PIC16GenInstrNames.inc"
88 #endif