LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/AMDGPU - AMDGPUGenIntrinsics.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 1 24 4.2 %
Date: 2017-09-14 15:23:50 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
       2             : |*                                                                            *|
       3             : |* Intrinsic Function Source Fragment                                         *|
       4             : |*                                                                            *|
       5             : |* Automatically generated file, do not edit!                                 *|
       6             : |*                                                                            *|
       7             : \*===----------------------------------------------------------------------===*/
       8             : 
       9             : // VisualStudio defines setjmp as _setjmp
      10             : #if defined(_MSC_VER) && defined(setjmp) && \
      11             :                          !defined(setjmp_undefined_for_msvc)
      12             : #  pragma push_macro("setjmp")
      13             : #  undef setjmp
      14             : #  define setjmp_undefined_for_msvc
      15             : #endif
      16             : 
      17             : // Enum values for Intrinsics.h
      18             : #ifdef GET_INTRINSIC_ENUM_VALUES
      19             :     AMDGPU_kill,                               // llvm.AMDGPU.kill
      20             :     AMDGPU_kilp,                               // llvm.AMDGPU.kilp
      21             :     SI_buffer_load_dword,                      // llvm.SI.buffer.load.dword
      22             :     SI_load_const,                             // llvm.SI.load.const
      23             :     SI_tbuffer_store,                          // llvm.SI.tbuffer.store
      24             :     r600_ddx,                                  // llvm.r600.ddx
      25             :     r600_ddy,                                  // llvm.r600.ddy
      26             :     r600_dot4,                                 // llvm.r600.dot4
      27             :     r600_store_stream_output,                  // llvm.r600.store.stream.output
      28             :     r600_store_swizzle,                        // llvm.r600.store.swizzle
      29             :     r600_tex,                                  // llvm.r600.tex
      30             :     r600_texc,                                 // llvm.r600.texc
      31             :     r600_txb,                                  // llvm.r600.txb
      32             :     r600_txbc,                                 // llvm.r600.txbc
      33             :     r600_txf,                                  // llvm.r600.txf
      34             :     r600_txl,                                  // llvm.r600.txl
      35             :     r600_txlc,                                 // llvm.r600.txlc
      36             :     r600_txq                                   // llvm.r600.txq
      37             : #endif
      38             : 
      39             : // Target mapping
      40             : #ifdef GET_INTRINSIC_TARGET_DATA
      41             : struct IntrinsicTargetInfo {
      42             :   llvm::StringLiteral Name;
      43             :   size_t Offset;
      44             :   size_t Count;
      45             : };
      46             : static constexpr IntrinsicTargetInfo TargetInfos[] = {
      47             :   {llvm::StringLiteral(""), 0, 0},
      48             :   {llvm::StringLiteral("AMDGPU"), 0, 2},
      49             :   {llvm::StringLiteral("SI"), 2, 3},
      50             :   {llvm::StringLiteral("r600"), 5, 13},
      51             : };
      52             : #endif
      53             : 
      54             : // Intrinsic ID to name table
      55             : #ifdef GET_INTRINSIC_NAME_TABLE
      56             :   // Note that entry #0 is the invalid intrinsic!
      57             :   "llvm.AMDGPU.kill",
      58             :   "llvm.AMDGPU.kilp",
      59             :   "llvm.SI.buffer.load.dword",
      60             :   "llvm.SI.load.const",
      61             :   "llvm.SI.tbuffer.store",
      62             :   "llvm.r600.ddx",
      63             :   "llvm.r600.ddy",
      64             :   "llvm.r600.dot4",
      65             :   "llvm.r600.store.stream.output",
      66             :   "llvm.r600.store.swizzle",
      67             :   "llvm.r600.tex",
      68             :   "llvm.r600.texc",
      69             :   "llvm.r600.txb",
      70             :   "llvm.r600.txbc",
      71             :   "llvm.r600.txf",
      72             :   "llvm.r600.txl",
      73             :   "llvm.r600.txlc",
      74             :   "llvm.r600.txq",
      75             : #endif
      76             : 
      77             : // Intrinsic ID to overload bitset
      78             : #ifdef GET_INTRINSIC_OVERLOAD_TABLE
      79             : static const uint8_t OTable[] = {
      80             :   0 | (1<<3) | (1<<4) | (1<<5),
      81             :   0,
      82             :   0
      83             : };
      84             : 
      85         925 : return (OTable[id/8] & (1 << (id%8))) != 0;
      86             : #endif
      87             : 
      88             : // Global intrinsic function declaration type table.
      89             : #ifdef GET_INTRINSIC_GENERATOR_GLOBAL
      90             : static const unsigned IIT_Table[] = {
      91             :   0x70, 0x0, (1U<<31) | 45, 0x41F7, (1U<<31) | 0, (1U<<31) | 31, (1U<<31) | 31, 
      92             :   0x7A7A7, 0x4447A0, 0x447A0, (1U<<31) | 31, (1U<<31) | 31, (1U<<31) | 31, (1U<<31) | 31, (1U<<31) | 17, 
      93             :   (1U<<31) | 31, (1U<<31) | 31, (1U<<31) | 17, 0
      94             : };
      95             : 
      96             : static const unsigned char IIT_LongEncodingTable[] = {
      97             :   /* 0 */ 0, 15, 1, 15, 9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,
      98             :   /* 17 */ 10, 4, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,
      99             :   /* 31 */ 10, 7, 10, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,
     100             :   /* 45 */ 15, 1, 15, 9, 15, 17, 4, 4, 4, 4, 4, 4, 4, 0,
     101             :   255
     102             : };
     103             : 
     104             : #endif
     105             : 
     106             : // Add parameter attributes that are not common to all intrinsics.
     107             : #ifdef GET_INTRINSIC_ATTRIBUTES
     108           0 : static AttributeList getAttributes(LLVMContext &C, AMDGPUIntrinsic::ID id) {
     109             :   static const uint8_t IntrinsicsToAttributesMap[] = {
     110             :     1, // llvm.AMDGPU.kill
     111             :     1, // llvm.AMDGPU.kilp
     112             :     2, // llvm.SI.buffer.load.dword
     113             :     3, // llvm.SI.load.const
     114             :     1, // llvm.SI.tbuffer.store
     115             :     3, // llvm.r600.ddx
     116             :     3, // llvm.r600.ddy
     117             :     4, // llvm.r600.dot4
     118             :     1, // llvm.r600.store.stream.output
     119             :     1, // llvm.r600.store.swizzle
     120             :     3, // llvm.r600.tex
     121             :     3, // llvm.r600.texc
     122             :     3, // llvm.r600.txb
     123             :     3, // llvm.r600.txbc
     124             :     3, // llvm.r600.txf
     125             :     3, // llvm.r600.txl
     126             :     3, // llvm.r600.txlc
     127             :     3, // llvm.r600.txq
     128             :   };
     129             : 
     130           0 :   AttributeList AS[1];
     131           0 :   unsigned NumAttrs = 0;
     132           0 :   if (id != 0) {
     133           0 :     switch(IntrinsicsToAttributesMap[id - Intrinsic::num_intrinsics]) {
     134           0 :     default: llvm_unreachable("Invalid attribute number");
     135           0 :     case 1: {
     136           0 :       const Attribute::AttrKind Atts[] = {Attribute::NoUnwind};
     137           0 :       AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
     138           0 :       NumAttrs = 1;
     139             :       break;
     140             :       }
     141           0 :     case 2: {
     142           0 :       const Attribute::AttrKind Atts[] = {Attribute::NoUnwind,Attribute::ReadOnly,Attribute::ArgMemOnly};
     143           0 :       AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
     144           0 :       NumAttrs = 1;
     145             :       break;
     146             :       }
     147           0 :     case 3: {
     148           0 :       const Attribute::AttrKind Atts[] = {Attribute::NoUnwind,Attribute::ReadNone};
     149           0 :       AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
     150           0 :       NumAttrs = 1;
     151             :       break;
     152             :       }
     153           0 :     case 4: {
     154           0 :       const Attribute::AttrKind Atts[] = {Attribute::NoUnwind,Attribute::Speculatable,Attribute::ReadNone};
     155           0 :       AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
     156           0 :       NumAttrs = 1;
     157             :       break;
     158             :       }
     159             :     }
     160             :   }
     161           0 :   return AttributeList::get(C, makeArrayRef(AS, NumAttrs));
     162             : }
     163             : #endif // GET_INTRINSIC_ATTRIBUTES
     164             : 
     165             : // Get the LLVM intrinsic that corresponds to a builtin.
     166             : // This is used by the C front-end.  The builtin name is passed
     167             : // in as BuiltinName, and a target prefix (e.g. 'ppc') is passed
     168             : // in as TargetPrefix.  The result is assigned to 'IntrinsicID'.
     169             : #ifdef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
     170             : static AMDGPUIntrinsic::ID getIntrinsicForGCCBuiltin(const char *TargetPrefixStr, StringRef BuiltinNameStr) {
     171             :   return (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic;
     172             : }
     173             : #endif
     174             : 
     175             : // Get the LLVM intrinsic that corresponds to a builtin.
     176             : // This is used by the C front-end.  The builtin name is passed
     177             : // in as BuiltinName, and a target prefix (e.g. 'ppc') is passed
     178             : // in as TargetPrefix.  The result is assigned to 'IntrinsicID'.
     179             : #ifdef GET_LLVM_INTRINSIC_FOR_MS_BUILTIN
     180             : static AMDGPUIntrinsic::ID getIntrinsicForMSBuiltin(const char *TargetPrefixStr, StringRef BuiltinNameStr) {
     181             :   return (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic;
     182             : }
     183             : #endif
     184             : 
     185             : #if defined(_MSC_VER) && defined(setjmp_undefined_for_msvc)
     186             : // let's return it to _setjmp state
     187             : #  pragma pop_macro("setjmp")
     188             : #  undef setjmp_undefined_for_msvc
     189             : #endif
     190             : 

Generated by: LCOV version 1.13