Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 1 | //===-- PIC16.h - Top-level interface for PIC16 representation --*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Sanjiv Gupta | 2d4e7f7 | 2008-05-14 06:50:01 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the entry points for global functions defined in |
| 11 | // the LLVM PIC16 back-end. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Sanjiv Gupta | b1b5ffd | 2008-11-19 11:00:54 +0000 | [diff] [blame] | 15 | #ifndef LLVM_TARGET_PIC16_H |
| 16 | #define LLVM_TARGET_PIC16_H |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 17 | |
Sanjiv Gupta | 1b04694 | 2009-01-13 19:18:47 +0000 | [diff] [blame^] | 18 | #include <iosfwd> |
| 19 | #include <cassert> |
| 20 | |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 21 | namespace llvm { |
| 22 | class PIC16TargetMachine; |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 23 | class FunctionPass; |
| 24 | class MachineCodeEmitter; |
Owen Anderson | cb37188 | 2008-08-21 00:14:44 +0000 | [diff] [blame] | 25 | class raw_ostream; |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 26 | |
Sanjiv Gupta | 1b04694 | 2009-01-13 19:18:47 +0000 | [diff] [blame^] | 27 | namespace 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 Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 51 | FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM); |
Owen Anderson | cb37188 | 2008-08-21 00:14:44 +0000 | [diff] [blame] | 52 | FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS, |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 53 | 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 |