Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
6.9 KiB

  1. //===-- llvm/Instruction.def - File that describes Instructions -*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file contains descriptions of the various LLVM instructions. This is
  11. // used as a central place for enumerating the different instructions and
  12. // should eventually be the place to put comments about the instructions.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. // NOTE: NO INCLUDE GUARD DESIRED!
  16. // Provide definitions of macros so that users of this file do not have to
  17. // define everything to use it...
  18. //
  19. #ifndef FIRST_TERM_INST
  20. #define FIRST_TERM_INST(num)
  21. #endif
  22. #ifndef HANDLE_TERM_INST
  23. #ifndef HANDLE_INST
  24. #define HANDLE_TERM_INST(num, opcode, Class)
  25. #else
  26. #define HANDLE_TERM_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
  27. #endif
  28. #endif
  29. #ifndef LAST_TERM_INST
  30. #define LAST_TERM_INST(num)
  31. #endif
  32. #ifndef FIRST_BINARY_INST
  33. #define FIRST_BINARY_INST(num)
  34. #endif
  35. #ifndef HANDLE_BINARY_INST
  36. #ifndef HANDLE_INST
  37. #define HANDLE_BINARY_INST(num, opcode, instclass)
  38. #else
  39. #define HANDLE_BINARY_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
  40. #endif
  41. #endif
  42. #ifndef LAST_BINARY_INST
  43. #define LAST_BINARY_INST(num)
  44. #endif
  45. #ifndef FIRST_MEMORY_INST
  46. #define FIRST_MEMORY_INST(num)
  47. #endif
  48. #ifndef HANDLE_MEMORY_INST
  49. #ifndef HANDLE_INST
  50. #define HANDLE_MEMORY_INST(num, opcode, Class)
  51. #else
  52. #define HANDLE_MEMORY_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
  53. #endif
  54. #endif
  55. #ifndef LAST_MEMORY_INST
  56. #define LAST_MEMORY_INST(num)
  57. #endif
  58. #ifndef FIRST_CAST_INST
  59. #define FIRST_CAST_INST(num)
  60. #endif
  61. #ifndef HANDLE_CAST_INST
  62. #ifndef HANDLE_INST
  63. #define HANDLE_CAST_INST(num, opcode, Class)
  64. #else
  65. #define HANDLE_CAST_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
  66. #endif
  67. #endif
  68. #ifndef LAST_CAST_INST
  69. #define LAST_CAST_INST(num)
  70. #endif
  71. #ifndef FIRST_OTHER_INST
  72. #define FIRST_OTHER_INST(num)
  73. #endif
  74. #ifndef HANDLE_OTHER_INST
  75. #ifndef HANDLE_INST
  76. #define HANDLE_OTHER_INST(num, opcode, Class)
  77. #else
  78. #define HANDLE_OTHER_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
  79. #endif
  80. #endif
  81. #ifndef LAST_OTHER_INST
  82. #define LAST_OTHER_INST(num)
  83. #endif
  84. // Terminator Instructions - These instructions are used to terminate a basic
  85. // block of the program. Every basic block must end with one of these
  86. // instructions for it to be a well formed basic block.
  87. //
  88. FIRST_TERM_INST ( 1)
  89. HANDLE_TERM_INST ( 1, Ret , ReturnInst)
  90. HANDLE_TERM_INST ( 2, Br , BranchInst)
  91. HANDLE_TERM_INST ( 3, Switch , SwitchInst)
  92. HANDLE_TERM_INST ( 4, IndirectBr , IndirectBrInst)
  93. HANDLE_TERM_INST ( 5, Invoke , InvokeInst)
  94. HANDLE_TERM_INST ( 6, Resume , ResumeInst)
  95. HANDLE_TERM_INST ( 7, Unreachable, UnreachableInst)
  96. LAST_TERM_INST ( 7)
  97. // Standard binary operators...
  98. FIRST_BINARY_INST( 8)
  99. HANDLE_BINARY_INST( 8, Add , BinaryOperator)
  100. HANDLE_BINARY_INST( 9, FAdd , BinaryOperator)
  101. HANDLE_BINARY_INST(10, Sub , BinaryOperator)
  102. HANDLE_BINARY_INST(11, FSub , BinaryOperator)
  103. HANDLE_BINARY_INST(12, Mul , BinaryOperator)
  104. HANDLE_BINARY_INST(13, FMul , BinaryOperator)
  105. HANDLE_BINARY_INST(14, UDiv , BinaryOperator)
  106. HANDLE_BINARY_INST(15, SDiv , BinaryOperator)
  107. HANDLE_BINARY_INST(16, FDiv , BinaryOperator)
  108. HANDLE_BINARY_INST(17, URem , BinaryOperator)
  109. HANDLE_BINARY_INST(18, SRem , BinaryOperator)
  110. HANDLE_BINARY_INST(19, FRem , BinaryOperator)
  111. // Logical operators (integer operands)
  112. HANDLE_BINARY_INST(20, Shl , BinaryOperator) // Shift left (logical)
  113. HANDLE_BINARY_INST(21, LShr , BinaryOperator) // Shift right (logical)
  114. HANDLE_BINARY_INST(22, AShr , BinaryOperator) // Shift right (arithmetic)
  115. HANDLE_BINARY_INST(23, And , BinaryOperator)
  116. HANDLE_BINARY_INST(24, Or , BinaryOperator)
  117. HANDLE_BINARY_INST(25, Xor , BinaryOperator)
  118. LAST_BINARY_INST(25)
  119. // Memory operators...
  120. FIRST_MEMORY_INST(26)
  121. HANDLE_MEMORY_INST(26, Alloca, AllocaInst) // Stack management
  122. HANDLE_MEMORY_INST(27, Load , LoadInst ) // Memory manipulation instrs
  123. HANDLE_MEMORY_INST(28, Store , StoreInst )
  124. HANDLE_MEMORY_INST(29, GetElementPtr, GetElementPtrInst)
  125. HANDLE_MEMORY_INST(30, Fence , FenceInst )
  126. HANDLE_MEMORY_INST(31, AtomicCmpXchg , AtomicCmpXchgInst )
  127. HANDLE_MEMORY_INST(32, AtomicRMW , AtomicRMWInst )
  128. LAST_MEMORY_INST(32)
  129. // Cast operators ...
  130. // NOTE: The order matters here because CastInst::isEliminableCastPair
  131. // NOTE: (see Instructions.cpp) encodes a table based on this ordering.
  132. FIRST_CAST_INST(33)
  133. HANDLE_CAST_INST(33, Trunc , TruncInst ) // Truncate integers
  134. HANDLE_CAST_INST(34, ZExt , ZExtInst ) // Zero extend integers
  135. HANDLE_CAST_INST(35, SExt , SExtInst ) // Sign extend integers
  136. HANDLE_CAST_INST(36, FPToUI , FPToUIInst ) // floating point -> UInt
  137. HANDLE_CAST_INST(37, FPToSI , FPToSIInst ) // floating point -> SInt
  138. HANDLE_CAST_INST(38, UIToFP , UIToFPInst ) // UInt -> floating point
  139. HANDLE_CAST_INST(39, SIToFP , SIToFPInst ) // SInt -> floating point
  140. HANDLE_CAST_INST(40, FPTrunc , FPTruncInst ) // Truncate floating point
  141. HANDLE_CAST_INST(41, FPExt , FPExtInst ) // Extend floating point
  142. HANDLE_CAST_INST(42, PtrToInt, PtrToIntInst) // Pointer -> Integer
  143. HANDLE_CAST_INST(43, IntToPtr, IntToPtrInst) // Integer -> Pointer
  144. HANDLE_CAST_INST(44, BitCast , BitCastInst ) // Type cast
  145. LAST_CAST_INST(44)
  146. // Other operators...
  147. FIRST_OTHER_INST(45)
  148. HANDLE_OTHER_INST(45, ICmp , ICmpInst ) // Integer comparison instruction
  149. HANDLE_OTHER_INST(46, FCmp , FCmpInst ) // Floating point comparison instr.
  150. HANDLE_OTHER_INST(47, PHI , PHINode ) // PHI node instruction
  151. HANDLE_OTHER_INST(48, Call , CallInst ) // Call a function
  152. HANDLE_OTHER_INST(49, Select , SelectInst ) // select instruction
  153. HANDLE_OTHER_INST(50, UserOp1, Instruction) // May be used internally in a pass
  154. HANDLE_OTHER_INST(51, UserOp2, Instruction) // Internal to passes only
  155. HANDLE_OTHER_INST(52, VAArg , VAArgInst ) // vaarg instruction
  156. HANDLE_OTHER_INST(53, ExtractElement, ExtractElementInst)// extract from vector
  157. HANDLE_OTHER_INST(54, InsertElement, InsertElementInst) // insert into vector
  158. HANDLE_OTHER_INST(55, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
  159. HANDLE_OTHER_INST(56, ExtractValue, ExtractValueInst)// extract from aggregate
  160. HANDLE_OTHER_INST(57, InsertValue, InsertValueInst) // insert into aggregate
  161. HANDLE_OTHER_INST(58, LandingPad, LandingPadInst) // Landing pad instruction.
  162. LAST_OTHER_INST(58)
  163. #undef FIRST_TERM_INST
  164. #undef HANDLE_TERM_INST
  165. #undef LAST_TERM_INST
  166. #undef FIRST_BINARY_INST
  167. #undef HANDLE_BINARY_INST
  168. #undef LAST_BINARY_INST
  169. #undef FIRST_MEMORY_INST
  170. #undef HANDLE_MEMORY_INST
  171. #undef LAST_MEMORY_INST
  172. #undef FIRST_CAST_INST
  173. #undef HANDLE_CAST_INST
  174. #undef LAST_CAST_INST
  175. #undef FIRST_OTHER_INST
  176. #undef HANDLE_OTHER_INST
  177. #undef LAST_OTHER_INST
  178. #ifdef HANDLE_INST
  179. #undef HANDLE_INST
  180. #endif