Add support for a cycle counter intrinsic. As basically all processors have
[oota-llvm.git] / include / llvm / Intrinsics.h
1 //===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines a set of enums which allow processing of intrinsic
11 // functions.  Values of these enum types are returned by
12 // Function::getIntrinsicID.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_INTRINSICS_H
17 #define LLVM_INTRINSICS_H
18
19 namespace llvm {
20
21 /// Intrinsic Namespace - This namespace contains an enum with a value for
22 /// every intrinsic/builtin function known by LLVM.  These enum values are
23 /// returned by Function::getIntrinsicID().
24 ///
25 namespace Intrinsic {
26   enum ID {
27     not_intrinsic = 0,   // Must be zero
28
29     // Varargs handling intrinsics.
30     vastart,        // Used to implement the va_start macro in C
31     vaend,          // Used to implement the va_end macro in C
32     vacopy,         // Used to implement the va_copy macro in C
33
34     // Code generator intrinsics.
35     returnaddress,    // Yields the return address of a dynamic call frame
36     frameaddress,     // Yields the frame address of a dynamic call frame
37     prefetch,         // Prefetch a value into the cache
38     pcmarker,         // Export a PC from near the marker
39     readcyclecounter, // Read cycle counter register
40
41     // setjmp/longjmp intrinsics.
42     setjmp,         // Used to represent a setjmp call in C
43     longjmp,        // Used to represent a longjmp call in C
44     sigsetjmp,      // Used to represent a sigsetjmp call in C
45     siglongjmp,     // Used to represent a siglongjmp call in C
46
47     // Garbage Collection intrinsics.
48     gcroot,         // Defines a new GC root on the stack
49     gcread,         // Defines a read of a heap object  (for read barriers)
50     gcwrite,        // Defines a write to a heap object (for write barriers)
51
52     // Debugging intrinsics.
53     dbg_stoppoint,    // Represents source lines and breakpointable places
54     dbg_region_start, // Start of a region
55     dbg_region_end,   // End of a region
56     dbg_func_start,   // Start of a function
57     dbg_declare,      // Declare a local object
58
59
60     // Standard libc functions.
61     memcpy,         // Copy non-overlapping memory blocks
62     memmove,        // Copy potentially overlapping memory blocks
63     memset,         // Fill memory with a byte value
64
65     // libm related functions.
66     isunordered,    // Return true if either argument is a NaN
67     ctpop, //count population
68     ctlz, //count leading zeros
69     cttz, //count trailing zeros
70     sqrt, //square root
71
72     // Input/Output intrinsics.
73     readport,
74     writeport,
75     readio,
76     writeio
77
78   };
79
80 } // End Intrinsic namespace
81
82 } // End llvm namespace
83
84 #endif