blob: f9f51ab9cce1cd35f193df446b7e1210f062a15e [file] [log] [blame]
Sanjiv Gupta0e687712008-05-13 09:02:57 +00001//===-- PIC16.h - Top-level interface for PIC16 representation --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Sanjiv Gupta2d4e7f72008-05-14 06:50:01 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Sanjiv Gupta0e687712008-05-13 09:02:57 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the entry points for global functions defined in
11// the LLVM PIC16 back-end.
12//
13//===----------------------------------------------------------------------===//
14
Sanjiv Guptab1b5ffd2008-11-19 11:00:54 +000015#ifndef LLVM_TARGET_PIC16_H
16#define LLVM_TARGET_PIC16_H
Sanjiv Gupta0e687712008-05-13 09:02:57 +000017
Sanjiv Gupta1b046942009-01-13 19:18:47 +000018#include <iosfwd>
19#include <cassert>
20
Sanjiv Gupta0e687712008-05-13 09:02:57 +000021namespace llvm {
22 class PIC16TargetMachine;
Sanjiv Gupta0e687712008-05-13 09:02:57 +000023 class FunctionPass;
24 class MachineCodeEmitter;
Owen Andersoncb371882008-08-21 00:14:44 +000025 class raw_ostream;
Sanjiv Gupta0e687712008-05-13 09:02:57 +000026
Sanjiv Gupta1b046942009-01-13 19:18:47 +000027namespace PIC16CC {
28 enum CondCodes {
29 EQ,
30 NE,
31 LT,
32 LE,
33 GT,
34 GE
35 };
36}
37
38 inline static const char *PIC16CondCodeToString(PIC16CC::CondCodes CC) {
39 switch (CC) {
40 default: assert(0 && "Unknown condition code");
41 case PIC16CC::NE: return "ne";
42 case PIC16CC::EQ: return "eq";
43 case PIC16CC::LT: return "lt";
44 case PIC16CC::LE: return "le";
45 case PIC16CC::GT: return "gt";
46 case PIC16CC::GE: return "ge";
47 }
48 }
49
50
Sanjiv Gupta0e687712008-05-13 09:02:57 +000051 FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM);
Owen Andersoncb371882008-08-21 00:14:44 +000052 FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS,
Sanjiv Gupta0e687712008-05-13 09:02:57 +000053 PIC16TargetMachine &TM);
54} // end namespace llvm;
55
56// Defines symbolic names for PIC16 registers. This defines a mapping from
57// register name to register number.
58#include "PIC16GenRegisterNames.inc"
59
60// Defines symbolic names for the PIC16 instructions.
61#include "PIC16GenInstrNames.inc"
62
63#endif