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
19 /// LLVMIntrinsic Namespace - This namespace contains an enum with a value for
20 /// every intrinsic/builtin function known by LLVM. These enum values are
21 /// returned by Function::getIntrinsicID().
23 namespace LLVMIntrinsic {
25 not_intrinsic = 0, // Must be zero
27 // Varargs handling intrinsics...
28 va_start, // Used to implement the va_start macro in C
29 va_end, // Used to implement the va_end macro in C
30 va_copy, // Used to implement the va_copy macro in C
32 // Setjmp/Longjmp intrinsics...
33 setjmp, // Used to represent a setjmp call in C
34 longjmp, // Used to represent a longjmp call in C
35 sigsetjmp, // Used to represent a sigsetjmp call in C
36 siglongjmp, // Used to represent a siglongjmp call in C
38 //===------------------------------------------------------------------===//
39 // This section defines intrinsic functions used to represent Alpha
42 alpha_ctlz, // CTLZ (count leading zero): counts the number of leading
43 // zeros in the given ulong value
45 alpha_cttz, // CTTZ (count trailing zero): counts the number of trailing
46 // zeros in the given ulong value
48 alpha_ctpop, // CTPOP (count population): counts the number of ones in
49 // the given ulong value
51 alpha_umulh, // UMULH (unsigned multiply quadword high): Takes two 64-bit
52 // (ulong) values, and returns the upper 64 bits of their
53 // 128 bit product as a ulong
55 alpha_vecop, // A generic vector operation. This function is used to
56 // represent various Alpha vector/multimedia instructions.
57 // It takes 4 parameters:
58 // - the first two are 2 ulong vectors
59 // - the third (uint) is the size (in bytes) of each
60 // vector element. Thus a value of 1 means that the two
61 // input vectors consist of 8 bytes
62 // - the fourth (uint) is the operation to be performed on
63 // the vectors. Its possible values are defined in the
64 // enumeration AlphaVecOps.
66 alpha_pup, // A pack/unpack operation. This function is used to
67 // represent Alpha pack/unpack operations.
68 // It takes 3 parameters:
69 // - the first is an ulong to pack/unpack
70 // - the second (uint) is the size of each component
71 // Valid values are 2 (word) or 4 (longword)
72 // - the third (uint) is the operation to be performed.
73 // Possible values defined in the enumeration
76 alpha_bytezap, // This intrinsic function takes two parameters: a ulong
77 // (64-bit) value and a ubyte value, and returns a ulong.
78 // Each bit in the ubyte corresponds to a byte in the
79 // ulong. If the bit is 0, the byte in the output equals
80 // the corresponding byte in the input, else the byte in
81 // the output is zero.
83 alpha_bytemanip,// This intrinsic function represents all Alpha byte
84 // manipulation instructions. It takes 3 parameters:
85 // - The first two are ulong inputs to operate on
86 // - The third (uint) is the operation to perform.
87 // Possible values defined in the enumeration
90 alpha_dfpbop, // This intrinsic function represents Alpha instructions
91 // that operate on two doubles and return a double. The
92 // first two parameters are the two double values to
93 // operate on, and the third is a uint that specifies the
94 // operation to perform. Its possible values are defined in
95 // the enumeration AlphaFloatingBinaryOps
97 alpha_dfpuop, // This intrinsic function represents operation on a single
98 // double precision floating point value. The first
99 // paramters is the value and the second is the operation.
100 // The possible values for the operations are defined in the
101 // enumeration AlphaFloatingUnaryOps
103 alpha_unordered,// This intrinsic function tests if two double precision
104 // floating point values are unordered. It has two
105 // parameters: the two values to be tested. It return a
106 // boolean true if the two are unordered, else false.
108 alpha_uqtodfp, // A generic function that converts a ulong to a double.
109 // How the conversion is performed is specified by the
110 // second parameter, the possible values for which are
111 // defined in the AlphaUqToDfpOps enumeration
113 alpha_uqtosfp, // A generic function that converts a ulong to a float.
114 // How the conversion is performed is specified by the
115 // second parameter, the possible values for which are
116 // defined in the AlphaUqToSfpOps enumeration
118 alpha_dfptosq, // A generic function that converts double 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 AlphaDfpToSqOps enumeration
123 alpha_sfptosq, // A generic function that converts a float to a long.
124 // How the conversion is performed is specified by the
125 // second parameter, the possible values for which are
126 // defined in the AlphaSfpToSq enumeration