1 //===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
3 // This file defines a set of enums which allow processing of intrinsic
4 // functions. Values of these enum types are returned by
5 // Function::getIntrinsicID.
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_INTRINSICS_H
10 #define LLVM_INTRINSICS_H
12 /// LLVMIntrinsic Namespace - This namespace contains an enum with a value for
13 /// every intrinsic/builtin function known by LLVM. These enum values are
14 /// returned by Function::getIntrinsicID().
16 namespace LLVMIntrinsic {
18 not_intrinsic = 0, // Must be zero
20 // Varargs handling intrinsics...
21 va_start, // Used to represent a va_start call in C
22 va_end, // Used to represent a va_end call in C
23 va_copy, // Used to represent a va_copy call in C
25 // Exception handling intrinsics...
26 exc_throw, // Throw an exception
27 exc_rethrow, // Rethrow a caught exception
28 exc_getcurrent, // Get the current pending exception
30 // Setjmp/Longjmp intrinsics...
31 setjmp, // Used to represent a setjmp call in C
32 longjmp, // Used to represent a longjmp call in C
33 sigsetjmp, // Used to represent a sigsetjmp call in C
34 siglongjmp, // Used to represent a siglongjmp call in C
36 //===------------------------------------------------------------------===//
37 // This section defines intrinsic functions used to represent Alpha
40 alpha_ctlz, // CTLZ (count leading zero): counts the number of leading
41 // zeros in the given ulong value
43 alpha_cttz, // CTTZ (count trailing zero): counts the number of trailing
44 // zeros in the given ulong value
46 alpha_ctpop, // CTPOP (count population): counts the number of ones in
47 // the given ulong value
49 alpha_umulh, // UMULH (unsigned multiply quadword high): Takes two 64-bit
50 // (ulong) values, and returns the upper 64 bits of their
51 // 128 bit product as a ulong
53 alpha_vecop, // A generic vector operation. This function is used to
54 // represent various Alpha vector/multimedia instructions.
55 // It takes 4 parameters:
56 // - the first two are 2 ulong vectors
57 // - the third (uint) is the size (in bytes) of each
58 // vector element. Thus a value of 1 means that the two
59 // input vectors consist of 8 bytes
60 // - the fourth (uint) is the operation to be performed on
61 // the vectors. Its possible values are defined in the
62 // enumeration AlphaVecOps.
64 alpha_pup, // A pack/unpack operation. This function is used to
65 // represent Alpha pack/unpack operations.
66 // It takes 3 parameters:
67 // - the first is an ulong to pack/unpack
68 // - the second (uint) is the size of each component
69 // Valid values are 2 (word) or 4 (longword)
70 // - the third (uint) is the operation to be performed.
71 // Possible values defined in the enumeration
74 alpha_bytezap, // This intrinsic function takes two parameters: a ulong
75 // (64-bit) value and a ubyte value, and returns a ulong.
76 // Each bit in the ubyte corresponds to a byte in the
77 // ulong. If the bit is 0, the byte in the output equals
78 // the corresponding byte in the input, else the byte in
79 // the output is zero.
81 alpha_bytemanip,// This intrinsic function represents all Alpha byte
82 // manipulation instructions. It takes 3 parameters:
83 // - The first two are ulong inputs to operate on
84 // - The third (uint) is the operation to perform.
85 // Possible values defined in the enumeration
88 alpha_dfpbop, // This intrinsic function represents Alpha instructions
89 // that operate on two doubles and return a double. The
90 // first two parameters are the two double values to
91 // operate on, and the third is a uint that specifies the
92 // operation to perform. Its possible values are defined in
93 // the enumeration AlphaFloatingBinaryOps
95 alpha_dfpuop, // This intrinsic function represents operation on a single
96 // double precision floating point value. The first
97 // paramters is the value and the second is the operation.
98 // The possible values for the operations are defined in the
99 // enumeration AlphaFloatingUnaryOps
101 alpha_unordered,// This intrinsic function tests if two double precision
102 // floating point values are unordered. It has two
103 // parameters: the two values to be tested. It return a
104 // boolean true if the two are unordered, else false.
106 alpha_uqtodfp, // A generic function that converts a ulong to a double.
107 // How the conversion is performed is specified by the
108 // second parameter, the possible values for which are
109 // defined in the AlphaUqToDfpOps enumeration
111 alpha_uqtosfp, // A generic function that converts a ulong to a float.
112 // How the conversion is performed is specified by the
113 // second parameter, the possible values for which are
114 // defined in the AlphaUqToSfpOps enumeration
116 alpha_dfptosq, // A generic function that converts double to a long.
117 // How the conversion is performed is specified by the
118 // second parameter, the possible values for which are
119 // defined in the AlphaDfpToSqOps enumeration
121 alpha_sfptosq, // A generic function that converts a float to a long.
122 // How the conversion is performed is specified by the
123 // second parameter, the possible values for which are
124 // defined in the AlphaSfpToSq enumeration