blob: 1d626d1c885978419ff874b3788f49ab78ca119a [file] [log] [blame]
Rafael Espindola7bc59bc2006-05-14 22:18:28 +00001//===-- ARM.h - Top-level interface for ARM representation---- --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the "Instituto Nokia de Tecnologia" and
6// is distributed under the University of Illinois Open Source
7// License. See LICENSE.TXT for details.
8//
9//===----------------------------------------------------------------------===//
10//
11// This file contains the entry points for global functions defined in the LLVM
12// ARM back-end.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef TARGET_ARM_H
17#define TARGET_ARM_H
18
19#include <iosfwd>
20#include <cassert>
21
22namespace llvm {
Evan Chenga8e29892007-01-19 07:51:42 +000023
24class ARMTargetMachine;
25class FunctionPass;
26
27// Enums corresponding to ARM condition codes
28namespace ARMCC {
29 enum CondCodes {
30 EQ,
31 NE,
32 HS,
33 LO,
34 MI,
35 PL,
36 VS,
37 VC,
38 HI,
39 LS,
40 GE,
41 LT,
42 GT,
43 LE,
44 AL
45 };
46
47 inline static CondCodes getOppositeCondition(CondCodes CC){
48 switch (CC) {
49 default: assert(0 && "Unknown condition code");
50 case EQ: return NE;
51 case NE: return EQ;
52 case HS: return LO;
53 case LO: return HS;
54 case MI: return PL;
55 case PL: return MI;
56 case VS: return VC;
57 case VC: return VS;
58 case HI: return LS;
59 case LS: return HI;
60 case GE: return LT;
61 case LT: return GE;
62 case GT: return LE;
63 case LE: return GT;
64 }
Rafael Espindola6f602de2006-08-24 16:13:15 +000065 }
Evan Chenga8e29892007-01-19 07:51:42 +000066}
Rafael Espindola6f602de2006-08-24 16:13:15 +000067
Evan Chenga8e29892007-01-19 07:51:42 +000068inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
69 switch (CC) {
70 default: assert(0 && "Unknown condition code");
71 case ARMCC::EQ: return "eq";
72 case ARMCC::NE: return "ne";
73 case ARMCC::HS: return "hs";
74 case ARMCC::LO: return "lo";
75 case ARMCC::MI: return "mi";
76 case ARMCC::PL: return "pl";
77 case ARMCC::VS: return "vs";
78 case ARMCC::VC: return "vc";
79 case ARMCC::HI: return "hi";
80 case ARMCC::LS: return "ls";
81 case ARMCC::GE: return "ge";
82 case ARMCC::LT: return "lt";
83 case ARMCC::GT: return "gt";
84 case ARMCC::LE: return "le";
85 case ARMCC::AL: return "al";
Rafael Espindola3ad5e5c2006-09-13 12:09:43 +000086 }
Evan Chenga8e29892007-01-19 07:51:42 +000087}
Rafael Espindola3ad5e5c2006-09-13 12:09:43 +000088
Evan Chenga8e29892007-01-19 07:51:42 +000089FunctionPass *createARMISelDag(ARMTargetMachine &TM);
90FunctionPass *createARMCodePrinterPass(std::ostream &O, ARMTargetMachine &TM);
91FunctionPass *createARMLoadStoreOptimizationPass();
92FunctionPass *createARMConstantIslandPass();
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000093
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000094} // end namespace llvm;
95
96// Defines symbolic names for ARM registers. This defines a mapping from
97// register name to register number.
98//
99#include "ARMGenRegisterNames.inc"
100
101// Defines symbolic names for the ARM instructions.
102//
103#include "ARMGenInstrNames.inc"
104
105
106#endif