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 unwind, // Unwind stack until containing invoke is found
27 // Setjmp/Longjmp intrinsics...
28 setjmp, // Used to represent a setjmp call in C
29 longjmp, // Used to represent a longjmp call in C
30 sigsetjmp, // Used to represent a sigsetjmp call in C
31 siglongjmp, // Used to represent a siglongjmp call in C
33 //===------------------------------------------------------------------===//
34 // This section defines intrinsic functions used to represent Alpha
37 alpha_ctlz, // CTLZ (count leading zero): counts the number of leading
38 // zeros in the given ulong value
40 alpha_cttz, // CTTZ (count trailing zero): counts the number of trailing
41 // zeros in the given ulong value
43 alpha_ctpop, // CTPOP (count population): counts the number of ones in
44 // the given ulong value
46 alpha_umulh, // UMULH (unsigned multiply quadword high): Takes two 64-bit
47 // (ulong) values, and returns the upper 64 bits of their
48 // 128 bit product as a ulong
50 alpha_vecop, // A generic vector operation. This function is used to
51 // represent various Alpha vector/multimedia instructions.
52 // It takes 4 parameters:
53 // - the first two are 2 ulong vectors
54 // - the third (uint) is the size (in bytes) of each
55 // vector element. Thus a value of 1 means that the two
56 // input vectors consist of 8 bytes
57 // - the fourth (uint) is the operation to be performed on
58 // the vectors. Its possible values are defined in the
59 // enumeration AlphaVecOps.
61 alpha_pup, // A pack/unpack operation. This function is used to
62 // represent Alpha pack/unpack operations.
63 // It takes 3 parameters:
64 // - the first is an ulong to pack/unpack
65 // - the second (uint) is the size of each component
66 // Valid values are 2 (word) or 4 (longword)
67 // - the third (uint) is the operation to be performed.
68 // Possible values defined in the enumeration
71 alpha_bytezap, // This intrinsic function takes two parameters: a ulong
72 // (64-bit) value and a ubyte value, and returns a ulong.
73 // Each bit in the ubyte corresponds to a byte in the
74 // ulong. If the bit is 0, the byte in the output equals
75 // the corresponding byte in the input, else the byte in
76 // the output is zero.
78 alpha_bytemanip,// This intrinsic function represents all Alpha byte
79 // manipulation instructions. It takes 3 parameters:
80 // - The first two are ulong inputs to operate on
81 // - The third (uint) is the operation to perform.
82 // Possible values defined in the enumeration
85 alpha_dfpbop, // This intrinsic function represents Alpha instructions
86 // that operate on two doubles and return a double. The
87 // first two parameters are the two double values to
88 // operate on, and the third is a uint that specifies the
89 // operation to perform. Its possible values are defined in
90 // the enumeration AlphaFloatingBinaryOps
92 alpha_dfpuop, // This intrinsic function represents operation on a single
93 // double precision floating point value. The first
94 // paramters is the value and the second is the operation.
95 // The possible values for the operations are defined in the
96 // enumeration AlphaFloatingUnaryOps
98 alpha_unordered,// This intrinsic function tests if two double precision
99 // floating point values are unordered. It has two
100 // parameters: the two values to be tested. It return a
101 // boolean true if the two are unordered, else false.
103 alpha_uqtodfp, // A generic function that converts a ulong to a double.
104 // How the conversion is performed is specified by the
105 // second parameter, the possible values for which are
106 // defined in the AlphaUqToDfpOps enumeration
108 alpha_uqtosfp, // A generic function that converts a ulong to a float.
109 // How the conversion is performed is specified by the
110 // second parameter, the possible values for which are
111 // defined in the AlphaUqToSfpOps enumeration
113 alpha_dfptosq, // A generic function that converts double to a long.
114 // How the conversion is performed is specified by the
115 // second parameter, the possible values for which are
116 // defined in the AlphaDfpToSqOps enumeration
118 alpha_sfptosq, // A generic function that converts a float to a long.
119 // How the conversion is performed is specified by the
120 // second parameter, the possible values for which are
121 // defined in the AlphaSfpToSq enumeration