1 //===-- PIC16.h - Top-level interface for PIC16 representation --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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 "llvm/Support/ErrorHandling.h"
19 #include "llvm/Target/TargetMachine.h"
26 class PIC16TargetMachine;
28 class MachineCodeEmitter;
29 class formatted_raw_ostream;
46 enum PIC16SectionType {
56 // External symbol names require memory to live till the program end.
57 // So we have to allocate it and keep.
58 inline static const char *createESName (const std::string &name) {
59 char *tmpName = new char[name.size() + 1];
60 strcpy (tmpName, name.c_str());
66 inline static const char *PIC16CondCodeToString(PIC16CC::CondCodes CC) {
68 default: llvm_unreachable("Unknown condition code");
69 case PIC16CC::NE: return "ne";
70 case PIC16CC::EQ: return "eq";
71 case PIC16CC::LT: return "lt";
72 case PIC16CC::ULT: return "lt";
73 case PIC16CC::LE: return "le";
74 case PIC16CC::ULE: return "le";
75 case PIC16CC::GT: return "gt";
76 case PIC16CC::UGT: return "gt";
77 case PIC16CC::GE: return "ge";
78 case PIC16CC::UGE: return "ge";
82 inline static bool isSignedComparison(PIC16CC::CondCodes CC) {
84 default: llvm_unreachable("Unknown condition code");
96 return false; // condition codes for unsigned comparison.
102 FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM);
103 // Banksel optimizer pass.
104 FunctionPass *createPIC16MemSelOptimizerPass();
106 extern Target ThePIC16Target;
107 extern Target TheCooperTarget;
109 } // end namespace llvm;
111 // Defines symbolic names for PIC16 registers. This defines a mapping from
112 // register name to register number.
113 #include "PIC16GenRegisterNames.inc"
115 // Defines symbolic names for the PIC16 instructions.
116 #include "PIC16GenInstrNames.inc"