1 //===- NeonEmitter.h - Generate arm_neon.h for use with clang ---*- 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 tablegen backend is responsible for emitting arm_neon.h, which includes
11 // a declaration and definition of each function specified by the ARM NEON
12 // compiler interface. See ARM document DUI0348B.
14 //===----------------------------------------------------------------------===//
16 #ifndef NEON_EMITTER_H
17 #define NEON_EMITTER_H
20 #include "TableGenBackend.h"
21 #include "llvm/ADT/DenseMap.h"
22 #include "llvm/ADT/StringMap.h"
56 class NeonEmitter : public TableGenBackend {
57 RecordKeeper &Records;
58 StringMap<OpKind> OpMap;
59 DenseMap<Record*, ClassKind> ClassMap;
62 NeonEmitter(RecordKeeper &R) : Records(R) {
63 OpMap["OP_NONE"] = OpNone;
64 OpMap["OP_ADD"] = OpAdd;
65 OpMap["OP_SUB"] = OpSub;
66 OpMap["OP_MUL"] = OpMul;
67 OpMap["OP_MLA"] = OpMla;
68 OpMap["OP_MLS"] = OpMls;
69 OpMap["OP_EQ"] = OpEq;
70 OpMap["OP_GE"] = OpGe;
71 OpMap["OP_LE"] = OpLe;
72 OpMap["OP_GT"] = OpGt;
73 OpMap["OP_LT"] = OpLt;
74 OpMap["OP_NEG"] = OpNeg;
75 OpMap["OP_NOT"] = OpNot;
76 OpMap["OP_AND"] = OpAnd;
77 OpMap["OP_OR"] = OpOr;
78 OpMap["OP_XOR"] = OpXor;
79 OpMap["OP_ANDN"] = OpAndNot;
80 OpMap["OP_ORN"] = OpOrNot;
81 OpMap["OP_CAST"] = OpCast;
83 Record *SI = R.getClass("SInst");
84 Record *II = R.getClass("IInst");
85 Record *WI = R.getClass("WInst");
86 Record *BI = R.getClass("BInst");
87 ClassMap[SI] = ClassS;
88 ClassMap[II] = ClassI;
89 ClassMap[WI] = ClassW;
90 ClassMap[BI] = ClassB;
93 // run - Emit arm_neon.h.inc
94 void run(raw_ostream &o);
96 // runHeader - Emit all the __builtin prototypes used in arm_neon.h
97 void runHeader(raw_ostream &o);
100 } // End llvm namespace