1 //===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
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.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_INTRINSICS_H
17 #define LLVM_INTRINSICS_H
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().
27 not_intrinsic = 0, // Must be zero
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
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
38 // setjmp/longjmp intrinsics.
39 setjmp, // Used to represent a setjmp call in C
40 longjmp, // Used to represent a longjmp call in C
41 sigsetjmp, // Used to represent a sigsetjmp call in C
42 siglongjmp, // Used to represent a siglongjmp call in C
44 // Garbage Collection intrinsics.
45 gcroot, // Defines a new GC root on the stack
46 gcread, // Defines a read of a heap object (for read barriers)
47 gcwrite, // Defines a write to a heap object (for write barriers)
49 // Debugging intrinsics.
50 dbg_stoppoint, // Represents source lines and breakpointable places
51 dbg_region_start, // Start of a region
52 dbg_region_end, // End of a region
53 dbg_func_start, // Start of a function
54 dbg_declare, // Declare a local object
57 // Standard libc functions.
58 memcpy, // Copy non-overlapping memory blocks
59 memmove, // Copy potentially overlapping memory blocks
60 memset, // Fill memory with a byte value
62 // Standard libm functions.
64 // Input/Output intrinsics.
70 // Support for unordered compare intrinsic
73 //===------------------------------------------------------------------===//
74 // This section defines intrinsic functions used to represent Alpha
77 alpha_ctlz, // CTLZ (count leading zero): counts the number of leading
78 // zeros in the given ulong value
80 alpha_cttz, // CTTZ (count trailing zero): counts the number of trailing
81 // zeros in the given ulong value
83 alpha_ctpop, // CTPOP (count population): counts the number of ones in
84 // the given ulong value
86 alpha_umulh, // UMULH (unsigned multiply quadword high): Takes two 64-bit
87 // (ulong) values, and returns the upper 64 bits of their
88 // 128 bit product as a ulong
90 alpha_vecop, // A generic vector operation. This function is used to
91 // represent various Alpha vector/multimedia instructions.
92 // It takes 4 parameters:
93 // - the first two are 2 ulong vectors
94 // - the third (uint) is the size (in bytes) of each
95 // vector element. Thus a value of 1 means that the two
96 // input vectors consist of 8 bytes
97 // - the fourth (uint) is the operation to be performed on
98 // the vectors. Its possible values are defined in the
99 // enumeration AlphaVecOps.
101 alpha_pup, // A pack/unpack operation. This function is used to
102 // represent Alpha pack/unpack operations.
103 // It takes 3 parameters:
104 // - the first is an ulong to pack/unpack
105 // - the second (uint) is the size of each component
106 // Valid values are 2 (word) or 4 (longword)
107 // - the third (uint) is the operation to be performed.
108 // Possible values defined in the enumeration
111 alpha_bytezap, // This intrinsic function takes two parameters: a ulong
112 // (64-bit) value and a ubyte value, and returns a ulong.
113 // Each bit in the ubyte corresponds to a byte in the
114 // ulong. If the bit is 0, the byte in the output equals
115 // the corresponding byte in the input, else the byte in
116 // the output is zero.
118 alpha_bytemanip,// This intrinsic function represents all Alpha byte
119 // manipulation instructions. It takes 3 parameters:
120 // - The first two are ulong inputs to operate on
121 // - The third (uint) is the operation to perform.
122 // Possible values defined in the enumeration
125 alpha_dfpbop, // This intrinsic function represents Alpha instructions
126 // that operate on two doubles and return a double. The
127 // first two parameters are the two double values to
128 // operate on, and the third is a uint that specifies the
129 // operation to perform. Its possible values are defined in
130 // the enumeration AlphaFloatingBinaryOps
132 alpha_dfpuop, // This intrinsic function represents operation on a single
133 // double precision floating point value. The first
134 // paramters is the value and the second is the operation.
135 // The possible values for the operations are defined in the
136 // enumeration AlphaFloatingUnaryOps
138 alpha_unordered,// This intrinsic function tests if two double precision
139 // floating point values are unordered. It has two
140 // parameters: the two values to be tested. It return a
141 // boolean true if the two are unordered, else false.
143 alpha_uqtodfp, // A generic function that converts a ulong to a double.
144 // How the conversion is performed is specified by the
145 // second parameter, the possible values for which are
146 // defined in the AlphaUqToDfpOps enumeration
148 alpha_uqtosfp, // A generic function that converts a ulong to a float.
149 // How the conversion is performed is specified by the
150 // second parameter, the possible values for which are
151 // defined in the AlphaUqToSfpOps enumeration
153 alpha_dfptosq, // A generic function that converts double to a long.
154 // How the conversion is performed is specified by the
155 // second parameter, the possible values for which are
156 // defined in the AlphaDfpToSqOps enumeration
158 alpha_sfptosq, // A generic function that converts a float to a long.
159 // How the conversion is performed is specified by the
160 // second parameter, the possible values for which are
161 // defined in the AlphaSfpToSq enumeration
164 } // End Intrinsic namespace
166 } // End llvm namespace