Jakob Stoklund Olesen | 1b2cfa4 | 2009-10-15 18:50:52 +0000 | [diff] [blame^] | 1 | //===- BlackfinIntrinsicInfo.cpp - Intrinsic Information --------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the Blackfin implementation of TargetIntrinsicInfo. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "BlackfinIntrinsicInfo.h" |
| 15 | #include "llvm/Intrinsics.h" |
| 16 | #include "llvm/Support/raw_ostream.h" |
| 17 | #include <cstring> |
| 18 | |
| 19 | using namespace llvm; |
| 20 | |
| 21 | namespace bfinIntrinsic { |
| 22 | |
| 23 | enum ID { |
| 24 | last_non_bfin_intrinsic = Intrinsic::num_intrinsics-1, |
| 25 | #define GET_INTRINSIC_ENUM_VALUES |
| 26 | #include "BlackfinGenIntrinsics.inc" |
| 27 | #undef GET_INTRINSIC_ENUM_VALUES |
| 28 | , num_bfin_intrinsics |
| 29 | }; |
| 30 | |
| 31 | } |
| 32 | |
| 33 | const char *BlackfinIntrinsicInfo::getName(unsigned IntrID) const { |
| 34 | static const char *const names[] = { |
| 35 | #define GET_INTRINSIC_NAME_TABLE |
| 36 | #include "BlackfinGenIntrinsics.inc" |
| 37 | #undef GET_INTRINSIC_NAME_TABLE |
| 38 | }; |
| 39 | |
| 40 | if (IntrID < Intrinsic::num_intrinsics) |
| 41 | return 0; |
| 42 | assert(IntrID < bfinIntrinsic::num_bfin_intrinsics && "Invalid intrinsic ID"); |
| 43 | |
| 44 | return names[IntrID - Intrinsic::num_intrinsics]; |
| 45 | } |
| 46 | |
| 47 | unsigned |
| 48 | BlackfinIntrinsicInfo::lookupName(const char *Name, unsigned Len) const { |
| 49 | #define GET_FUNCTION_RECOGNIZER |
| 50 | #include "BlackfinGenIntrinsics.inc" |
| 51 | #undef GET_FUNCTION_RECOGNIZER |
| 52 | return 0; |
| 53 | } |