125105dd303966651c657d4f6e7b5765eef8888f
[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     va_start,       // Used to implement the va_start macro in C
31     va_end,         // Used to implement the va_end macro in C
32     va_copy,        // Used to implement the va_copy macro in C
33
34     // Setjmp/Longjmp intrinsics...
35     setjmp,         // Used to represent a setjmp call in C
36     longjmp,        // Used to represent a longjmp call in C
37     sigsetjmp,      // Used to represent a sigsetjmp call in C
38     siglongjmp,     // Used to represent a siglongjmp call in C
39
40     // Debugging intrinsics...
41     dbg_stoppoint,    // Represents source lines and breakpointable places
42     dbg_region_start, // Start of a region
43     dbg_region_end,   // End of a region
44     dbg_func_start,   // Start of a function
45     dbg_declare,      // Declare a local object
46
47     // Standard libc functions...
48     memcpy,         // Used to copy non-overlapping memory blocks
49     memmove,        // Used to copy overlapping memory blocks
50
51
52     // Standard libm functions...
53     
54
55     //===------------------------------------------------------------------===//
56     // This section defines intrinsic functions used to represent Alpha
57     // instructions...
58     //
59     alpha_ctlz,     // CTLZ (count leading zero): counts the number of leading
60                     // zeros in the given ulong value
61
62     alpha_cttz,     // CTTZ (count trailing zero): counts the number of trailing
63                     // zeros in the given ulong value 
64
65     alpha_ctpop,    // CTPOP (count population): counts the number of ones in
66                     // the given ulong value 
67
68     alpha_umulh,    // UMULH (unsigned multiply quadword high): Takes two 64-bit
69                     // (ulong) values, and returns the upper 64 bits of their
70                     // 128 bit product as a ulong
71
72     alpha_vecop,    // A generic vector operation. This function is used to
73                     // represent various Alpha vector/multimedia instructions.
74                     // It takes 4 parameters:
75                     //  - the first two are 2 ulong vectors
76                     //  - the third (uint) is the size (in bytes) of each 
77                     //    vector element. Thus a value of 1 means that the two
78                     //    input vectors consist of 8 bytes
79                     //  - the fourth (uint) is the operation to be performed on
80                     //    the vectors. Its possible values are defined in the
81                     //    enumeration AlphaVecOps.
82
83     alpha_pup,      // A pack/unpack operation. This function is used to
84                     // represent Alpha pack/unpack operations. 
85                     // It takes 3 parameters:
86                     //  - the first is an ulong to pack/unpack
87                     //  - the second (uint) is the size of each component
88                     //    Valid values are 2 (word) or 4 (longword)
89                     //  - the third (uint) is the operation to be performed.
90                     //    Possible values defined in the enumeration 
91                     //    AlphaPupOps
92
93     alpha_bytezap,  // This intrinsic function takes two parameters: a ulong 
94                     // (64-bit) value and a ubyte value, and returns a ulong.
95                     // Each bit in the ubyte corresponds to a byte in the 
96                     // ulong. If the bit is 0, the byte in the output equals
97                     // the corresponding byte in the input, else the byte in
98                     // the output is zero.
99
100     alpha_bytemanip,// This intrinsic function represents all Alpha byte
101                     // manipulation instructions. It takes 3 parameters:
102                     //  - The first two are ulong inputs to operate on
103                     //  - The third (uint) is the operation to perform. 
104                     //    Possible values defined in the enumeration
105                     //    AlphaByteManipOps
106
107     alpha_dfpbop,   // This intrinsic function represents Alpha instructions
108                     // that operate on two doubles and return a double. The
109                     // first two parameters are the two double values to
110                     // operate on, and the third is a uint that specifies the
111                     // operation to perform. Its possible values are defined in
112                     // the enumeration AlphaFloatingBinaryOps
113
114     alpha_dfpuop,   // This intrinsic function represents operation on a single
115                     // double precision floating point value. The first 
116                     // paramters is the value and the second is the operation.
117                     // The possible values for the operations are defined in the
118                     // enumeration AlphaFloatingUnaryOps
119
120     alpha_unordered,// This intrinsic function tests if two double precision
121                     // floating point values are unordered. It has two
122                     // parameters: the two values to be tested. It return a
123                     // boolean true if the two are unordered, else false.
124
125     alpha_uqtodfp,  // A generic function that converts a ulong to a double.
126                     // How the conversion is performed is specified by the
127                     // second parameter, the possible values for which are
128                     // defined in the AlphaUqToDfpOps enumeration
129
130     alpha_uqtosfp,  // A generic function that converts a ulong to a float.
131                     // How the conversion is performed is specified by the
132                     // second parameter, the possible values for which are
133                     // defined in the AlphaUqToSfpOps enumeration
134
135     alpha_dfptosq,  // A generic function that converts double to a long.
136                     // How the conversion is performed is specified by the
137                     // second parameter, the possible values for which are
138                     // defined in the AlphaDfpToSqOps enumeration
139
140     alpha_sfptosq,  // A generic function that converts a float to a long.
141                     // How the conversion is performed is specified by the
142                     // second parameter, the possible values for which are
143                     // defined in the AlphaSfpToSq enumeration
144   };
145
146 } // End Intrinsic namespace
147
148 } // End llvm namespace
149
150 #endif