opcodes.inc 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. // opcode name, return type, arg1 type, arg2 type, arg3 type, arg4 type, arg4 type, ...
  4. OPCODE(Phi, Opaque, )
  5. OPCODE(Identity, Opaque, Opaque, )
  6. OPCODE(Void, Void, )
  7. OPCODE(ConditionRef, U1, U1, )
  8. OPCODE(Reference, Void, Opaque, )
  9. OPCODE(PhiMove, Void, Opaque, Opaque, )
  10. // Special operations
  11. OPCODE(Prologue, Void, )
  12. OPCODE(Epilogue, Void, )
  13. OPCODE(Join, Void, )
  14. OPCODE(DemoteToHelperInvocation, Void, )
  15. OPCODE(EmitVertex, Void, U32, )
  16. OPCODE(EndPrimitive, Void, U32, )
  17. // Barriers
  18. OPCODE(Barrier, Void, )
  19. OPCODE(WorkgroupMemoryBarrier, Void, )
  20. OPCODE(DeviceMemoryBarrier, Void, )
  21. // Context getters/setters
  22. OPCODE(GetRegister, U32, Reg, )
  23. OPCODE(SetRegister, Void, Reg, U32, )
  24. OPCODE(GetPred, U1, Pred, )
  25. OPCODE(SetPred, Void, Pred, U1, )
  26. OPCODE(GetGotoVariable, U1, U32, )
  27. OPCODE(SetGotoVariable, Void, U32, U1, )
  28. OPCODE(GetIndirectBranchVariable, U32, )
  29. OPCODE(SetIndirectBranchVariable, Void, U32, )
  30. OPCODE(GetCbufU8, U32, U32, U32, )
  31. OPCODE(GetCbufS8, U32, U32, U32, )
  32. OPCODE(GetCbufU16, U32, U32, U32, )
  33. OPCODE(GetCbufS16, U32, U32, U32, )
  34. OPCODE(GetCbufU32, U32, U32, U32, )
  35. OPCODE(GetCbufF32, F32, U32, U32, )
  36. OPCODE(GetCbufU32x2, U32x2, U32, U32, )
  37. OPCODE(GetAttribute, F32, Attribute, U32, )
  38. OPCODE(GetAttributeU32, U32, Attribute, U32, )
  39. OPCODE(SetAttribute, Void, Attribute, F32, U32, )
  40. OPCODE(GetAttributeIndexed, F32, U32, U32, )
  41. OPCODE(SetAttributeIndexed, Void, U32, F32, U32, )
  42. OPCODE(GetPatch, F32, Patch, )
  43. OPCODE(SetPatch, Void, Patch, F32, )
  44. OPCODE(SetFragColor, Void, U32, U32, F32, )
  45. OPCODE(SetSampleMask, Void, U32, )
  46. OPCODE(SetFragDepth, Void, F32, )
  47. OPCODE(GetZFlag, U1, Void, )
  48. OPCODE(GetSFlag, U1, Void, )
  49. OPCODE(GetCFlag, U1, Void, )
  50. OPCODE(GetOFlag, U1, Void, )
  51. OPCODE(SetZFlag, Void, U1, )
  52. OPCODE(SetSFlag, Void, U1, )
  53. OPCODE(SetCFlag, Void, U1, )
  54. OPCODE(SetOFlag, Void, U1, )
  55. OPCODE(WorkgroupId, U32x3, )
  56. OPCODE(LocalInvocationId, U32x3, )
  57. OPCODE(InvocationId, U32, )
  58. OPCODE(InvocationInfo, U32, )
  59. OPCODE(SampleId, U32, )
  60. OPCODE(IsHelperInvocation, U1, )
  61. OPCODE(YDirection, F32, )
  62. OPCODE(ResolutionDownFactor, F32, )
  63. OPCODE(RenderArea, F32x4, )
  64. // Undefined
  65. OPCODE(UndefU1, U1, )
  66. OPCODE(UndefU8, U8, )
  67. OPCODE(UndefU16, U16, )
  68. OPCODE(UndefU32, U32, )
  69. OPCODE(UndefU64, U64, )
  70. // Memory operations
  71. OPCODE(LoadGlobalU8, U32, Opaque, )
  72. OPCODE(LoadGlobalS8, U32, Opaque, )
  73. OPCODE(LoadGlobalU16, U32, Opaque, )
  74. OPCODE(LoadGlobalS16, U32, Opaque, )
  75. OPCODE(LoadGlobal32, U32, Opaque, )
  76. OPCODE(LoadGlobal64, U32x2, Opaque, )
  77. OPCODE(LoadGlobal128, U32x4, Opaque, )
  78. OPCODE(WriteGlobalU8, Void, Opaque, U32, )
  79. OPCODE(WriteGlobalS8, Void, Opaque, U32, )
  80. OPCODE(WriteGlobalU16, Void, Opaque, U32, )
  81. OPCODE(WriteGlobalS16, Void, Opaque, U32, )
  82. OPCODE(WriteGlobal32, Void, Opaque, U32, )
  83. OPCODE(WriteGlobal64, Void, Opaque, U32x2, )
  84. OPCODE(WriteGlobal128, Void, Opaque, U32x4, )
  85. // Storage buffer operations
  86. OPCODE(LoadStorageU8, U32, U32, U32, )
  87. OPCODE(LoadStorageS8, U32, U32, U32, )
  88. OPCODE(LoadStorageU16, U32, U32, U32, )
  89. OPCODE(LoadStorageS16, U32, U32, U32, )
  90. OPCODE(LoadStorage32, U32, U32, U32, )
  91. OPCODE(LoadStorage64, U32x2, U32, U32, )
  92. OPCODE(LoadStorage128, U32x4, U32, U32, )
  93. OPCODE(WriteStorageU8, Void, U32, U32, U32, )
  94. OPCODE(WriteStorageS8, Void, U32, U32, U32, )
  95. OPCODE(WriteStorageU16, Void, U32, U32, U32, )
  96. OPCODE(WriteStorageS16, Void, U32, U32, U32, )
  97. OPCODE(WriteStorage32, Void, U32, U32, U32, )
  98. OPCODE(WriteStorage64, Void, U32, U32, U32x2, )
  99. OPCODE(WriteStorage128, Void, U32, U32, U32x4, )
  100. // Local memory operations
  101. OPCODE(LoadLocal, U32, U32, )
  102. OPCODE(WriteLocal, Void, U32, U32, )
  103. // Shared memory operations
  104. OPCODE(LoadSharedU8, U32, U32, )
  105. OPCODE(LoadSharedS8, U32, U32, )
  106. OPCODE(LoadSharedU16, U32, U32, )
  107. OPCODE(LoadSharedS16, U32, U32, )
  108. OPCODE(LoadSharedU32, U32, U32, )
  109. OPCODE(LoadSharedU64, U32x2, U32, )
  110. OPCODE(LoadSharedU128, U32x4, U32, )
  111. OPCODE(WriteSharedU8, Void, U32, U32, )
  112. OPCODE(WriteSharedU16, Void, U32, U32, )
  113. OPCODE(WriteSharedU32, Void, U32, U32, )
  114. OPCODE(WriteSharedU64, Void, U32, U32x2, )
  115. OPCODE(WriteSharedU128, Void, U32, U32x4, )
  116. // Vector utility
  117. OPCODE(CompositeConstructU32x2, U32x2, U32, U32, )
  118. OPCODE(CompositeConstructU32x3, U32x3, U32, U32, U32, )
  119. OPCODE(CompositeConstructU32x4, U32x4, U32, U32, U32, U32, )
  120. OPCODE(CompositeExtractU32x2, U32, U32x2, U32, )
  121. OPCODE(CompositeExtractU32x3, U32, U32x3, U32, )
  122. OPCODE(CompositeExtractU32x4, U32, U32x4, U32, )
  123. OPCODE(CompositeInsertU32x2, U32x2, U32x2, U32, U32, )
  124. OPCODE(CompositeInsertU32x3, U32x3, U32x3, U32, U32, )
  125. OPCODE(CompositeInsertU32x4, U32x4, U32x4, U32, U32, )
  126. OPCODE(CompositeConstructF16x2, F16x2, F16, F16, )
  127. OPCODE(CompositeConstructF16x3, F16x3, F16, F16, F16, )
  128. OPCODE(CompositeConstructF16x4, F16x4, F16, F16, F16, F16, )
  129. OPCODE(CompositeExtractF16x2, F16, F16x2, U32, )
  130. OPCODE(CompositeExtractF16x3, F16, F16x3, U32, )
  131. OPCODE(CompositeExtractF16x4, F16, F16x4, U32, )
  132. OPCODE(CompositeInsertF16x2, F16x2, F16x2, F16, U32, )
  133. OPCODE(CompositeInsertF16x3, F16x3, F16x3, F16, U32, )
  134. OPCODE(CompositeInsertF16x4, F16x4, F16x4, F16, U32, )
  135. OPCODE(CompositeConstructF32x2, F32x2, F32, F32, )
  136. OPCODE(CompositeConstructF32x3, F32x3, F32, F32, F32, )
  137. OPCODE(CompositeConstructF32x4, F32x4, F32, F32, F32, F32, )
  138. OPCODE(CompositeExtractF32x2, F32, F32x2, U32, )
  139. OPCODE(CompositeExtractF32x3, F32, F32x3, U32, )
  140. OPCODE(CompositeExtractF32x4, F32, F32x4, U32, )
  141. OPCODE(CompositeInsertF32x2, F32x2, F32x2, F32, U32, )
  142. OPCODE(CompositeInsertF32x3, F32x3, F32x3, F32, U32, )
  143. OPCODE(CompositeInsertF32x4, F32x4, F32x4, F32, U32, )
  144. OPCODE(CompositeConstructF64x2, F64x2, F64, F64, )
  145. OPCODE(CompositeConstructF64x3, F64x3, F64, F64, F64, )
  146. OPCODE(CompositeConstructF64x4, F64x4, F64, F64, F64, F64, )
  147. OPCODE(CompositeExtractF64x2, F64, F64x2, U32, )
  148. OPCODE(CompositeExtractF64x3, F64, F64x3, U32, )
  149. OPCODE(CompositeExtractF64x4, F64, F64x4, U32, )
  150. OPCODE(CompositeInsertF64x2, F64x2, F64x2, F64, U32, )
  151. OPCODE(CompositeInsertF64x3, F64x3, F64x3, F64, U32, )
  152. OPCODE(CompositeInsertF64x4, F64x4, F64x4, F64, U32, )
  153. // Select operations
  154. OPCODE(SelectU1, U1, U1, U1, U1, )
  155. OPCODE(SelectU8, U8, U1, U8, U8, )
  156. OPCODE(SelectU16, U16, U1, U16, U16, )
  157. OPCODE(SelectU32, U32, U1, U32, U32, )
  158. OPCODE(SelectU64, U64, U1, U64, U64, )
  159. OPCODE(SelectF16, F16, U1, F16, F16, )
  160. OPCODE(SelectF32, F32, U1, F32, F32, )
  161. OPCODE(SelectF64, F64, U1, F64, F64, )
  162. // Bitwise conversions
  163. OPCODE(BitCastU16F16, U16, F16, )
  164. OPCODE(BitCastU32F32, U32, F32, )
  165. OPCODE(BitCastU64F64, U64, F64, )
  166. OPCODE(BitCastS32F32, S32, F32, )
  167. OPCODE(BitCastF16U16, F16, U16, )
  168. OPCODE(BitCastF32U32, F32, U32, )
  169. OPCODE(BitCastF64U64, F64, U64, )
  170. OPCODE(PackUint2x32, U64, U32x2, )
  171. OPCODE(UnpackUint2x32, U32x2, U64, )
  172. OPCODE(PackFloat2x16, U32, F16x2, )
  173. OPCODE(UnpackFloat2x16, F16x2, U32, )
  174. OPCODE(PackHalf2x16, U32, F32x2, )
  175. OPCODE(UnpackHalf2x16, F32x2, U32, )
  176. OPCODE(PackDouble2x32, F64, U32x2, )
  177. OPCODE(UnpackDouble2x32, U32x2, F64, )
  178. // Pseudo-operation, handled specially at final emit
  179. OPCODE(GetZeroFromOp, U1, Opaque, )
  180. OPCODE(GetSignFromOp, U1, Opaque, )
  181. OPCODE(GetCarryFromOp, U1, Opaque, )
  182. OPCODE(GetOverflowFromOp, U1, Opaque, )
  183. OPCODE(GetSparseFromOp, U1, Opaque, )
  184. OPCODE(GetInBoundsFromOp, U1, Opaque, )
  185. // Floating-point operations
  186. OPCODE(FPAbs16, F16, F16, )
  187. OPCODE(FPAbs32, F32, F32, )
  188. OPCODE(FPAbs64, F64, F64, )
  189. OPCODE(FPAdd16, F16, F16, F16, )
  190. OPCODE(FPAdd32, F32, F32, F32, )
  191. OPCODE(FPAdd64, F64, F64, F64, )
  192. OPCODE(FPFma16, F16, F16, F16, F16, )
  193. OPCODE(FPFma32, F32, F32, F32, F32, )
  194. OPCODE(FPFma64, F64, F64, F64, F64, )
  195. OPCODE(FPMax32, F32, F32, F32, )
  196. OPCODE(FPMax64, F64, F64, F64, )
  197. OPCODE(FPMin32, F32, F32, F32, )
  198. OPCODE(FPMin64, F64, F64, F64, )
  199. OPCODE(FPMul16, F16, F16, F16, )
  200. OPCODE(FPMul32, F32, F32, F32, )
  201. OPCODE(FPMul64, F64, F64, F64, )
  202. OPCODE(FPNeg16, F16, F16, )
  203. OPCODE(FPNeg32, F32, F32, )
  204. OPCODE(FPNeg64, F64, F64, )
  205. OPCODE(FPRecip32, F32, F32, )
  206. OPCODE(FPRecip64, F64, F64, )
  207. OPCODE(FPRecipSqrt32, F32, F32, )
  208. OPCODE(FPRecipSqrt64, F64, F64, )
  209. OPCODE(FPSqrt, F32, F32, )
  210. OPCODE(FPSin, F32, F32, )
  211. OPCODE(FPExp2, F32, F32, )
  212. OPCODE(FPCos, F32, F32, )
  213. OPCODE(FPLog2, F32, F32, )
  214. OPCODE(FPSaturate16, F16, F16, )
  215. OPCODE(FPSaturate32, F32, F32, )
  216. OPCODE(FPSaturate64, F64, F64, )
  217. OPCODE(FPClamp16, F16, F16, F16, F16, )
  218. OPCODE(FPClamp32, F32, F32, F32, F32, )
  219. OPCODE(FPClamp64, F64, F64, F64, F64, )
  220. OPCODE(FPRoundEven16, F16, F16, )
  221. OPCODE(FPRoundEven32, F32, F32, )
  222. OPCODE(FPRoundEven64, F64, F64, )
  223. OPCODE(FPFloor16, F16, F16, )
  224. OPCODE(FPFloor32, F32, F32, )
  225. OPCODE(FPFloor64, F64, F64, )
  226. OPCODE(FPCeil16, F16, F16, )
  227. OPCODE(FPCeil32, F32, F32, )
  228. OPCODE(FPCeil64, F64, F64, )
  229. OPCODE(FPTrunc16, F16, F16, )
  230. OPCODE(FPTrunc32, F32, F32, )
  231. OPCODE(FPTrunc64, F64, F64, )
  232. OPCODE(FPOrdEqual16, U1, F16, F16, )
  233. OPCODE(FPOrdEqual32, U1, F32, F32, )
  234. OPCODE(FPOrdEqual64, U1, F64, F64, )
  235. OPCODE(FPUnordEqual16, U1, F16, F16, )
  236. OPCODE(FPUnordEqual32, U1, F32, F32, )
  237. OPCODE(FPUnordEqual64, U1, F64, F64, )
  238. OPCODE(FPOrdNotEqual16, U1, F16, F16, )
  239. OPCODE(FPOrdNotEqual32, U1, F32, F32, )
  240. OPCODE(FPOrdNotEqual64, U1, F64, F64, )
  241. OPCODE(FPUnordNotEqual16, U1, F16, F16, )
  242. OPCODE(FPUnordNotEqual32, U1, F32, F32, )
  243. OPCODE(FPUnordNotEqual64, U1, F64, F64, )
  244. OPCODE(FPOrdLessThan16, U1, F16, F16, )
  245. OPCODE(FPOrdLessThan32, U1, F32, F32, )
  246. OPCODE(FPOrdLessThan64, U1, F64, F64, )
  247. OPCODE(FPUnordLessThan16, U1, F16, F16, )
  248. OPCODE(FPUnordLessThan32, U1, F32, F32, )
  249. OPCODE(FPUnordLessThan64, U1, F64, F64, )
  250. OPCODE(FPOrdGreaterThan16, U1, F16, F16, )
  251. OPCODE(FPOrdGreaterThan32, U1, F32, F32, )
  252. OPCODE(FPOrdGreaterThan64, U1, F64, F64, )
  253. OPCODE(FPUnordGreaterThan16, U1, F16, F16, )
  254. OPCODE(FPUnordGreaterThan32, U1, F32, F32, )
  255. OPCODE(FPUnordGreaterThan64, U1, F64, F64, )
  256. OPCODE(FPOrdLessThanEqual16, U1, F16, F16, )
  257. OPCODE(FPOrdLessThanEqual32, U1, F32, F32, )
  258. OPCODE(FPOrdLessThanEqual64, U1, F64, F64, )
  259. OPCODE(FPUnordLessThanEqual16, U1, F16, F16, )
  260. OPCODE(FPUnordLessThanEqual32, U1, F32, F32, )
  261. OPCODE(FPUnordLessThanEqual64, U1, F64, F64, )
  262. OPCODE(FPOrdGreaterThanEqual16, U1, F16, F16, )
  263. OPCODE(FPOrdGreaterThanEqual32, U1, F32, F32, )
  264. OPCODE(FPOrdGreaterThanEqual64, U1, F64, F64, )
  265. OPCODE(FPUnordGreaterThanEqual16, U1, F16, F16, )
  266. OPCODE(FPUnordGreaterThanEqual32, U1, F32, F32, )
  267. OPCODE(FPUnordGreaterThanEqual64, U1, F64, F64, )
  268. OPCODE(FPIsNan16, U1, F16, )
  269. OPCODE(FPIsNan32, U1, F32, )
  270. OPCODE(FPIsNan64, U1, F64, )
  271. // Integer operations
  272. OPCODE(IAdd32, U32, U32, U32, )
  273. OPCODE(IAdd64, U64, U64, U64, )
  274. OPCODE(ISub32, U32, U32, U32, )
  275. OPCODE(ISub64, U64, U64, U64, )
  276. OPCODE(IMul32, U32, U32, U32, )
  277. OPCODE(SDiv32, U32, U32, U32, )
  278. OPCODE(UDiv32, U32, U32, U32, )
  279. OPCODE(INeg32, U32, U32, )
  280. OPCODE(INeg64, U64, U64, )
  281. OPCODE(IAbs32, U32, U32, )
  282. OPCODE(ShiftLeftLogical32, U32, U32, U32, )
  283. OPCODE(ShiftLeftLogical64, U64, U64, U32, )
  284. OPCODE(ShiftRightLogical32, U32, U32, U32, )
  285. OPCODE(ShiftRightLogical64, U64, U64, U32, )
  286. OPCODE(ShiftRightArithmetic32, U32, U32, U32, )
  287. OPCODE(ShiftRightArithmetic64, U64, U64, U32, )
  288. OPCODE(BitwiseAnd32, U32, U32, U32, )
  289. OPCODE(BitwiseOr32, U32, U32, U32, )
  290. OPCODE(BitwiseXor32, U32, U32, U32, )
  291. OPCODE(BitFieldInsert, U32, U32, U32, U32, U32, )
  292. OPCODE(BitFieldSExtract, U32, U32, U32, U32, )
  293. OPCODE(BitFieldUExtract, U32, U32, U32, U32, )
  294. OPCODE(BitReverse32, U32, U32, )
  295. OPCODE(BitCount32, U32, U32, )
  296. OPCODE(BitwiseNot32, U32, U32, )
  297. OPCODE(FindSMsb32, U32, U32, )
  298. OPCODE(FindUMsb32, U32, U32, )
  299. OPCODE(SMin32, U32, U32, U32, )
  300. OPCODE(UMin32, U32, U32, U32, )
  301. OPCODE(SMax32, U32, U32, U32, )
  302. OPCODE(UMax32, U32, U32, U32, )
  303. OPCODE(SClamp32, U32, U32, U32, U32, )
  304. OPCODE(UClamp32, U32, U32, U32, U32, )
  305. OPCODE(SLessThan, U1, U32, U32, )
  306. OPCODE(ULessThan, U1, U32, U32, )
  307. OPCODE(IEqual, U1, U32, U32, )
  308. OPCODE(SLessThanEqual, U1, U32, U32, )
  309. OPCODE(ULessThanEqual, U1, U32, U32, )
  310. OPCODE(SGreaterThan, U1, U32, U32, )
  311. OPCODE(UGreaterThan, U1, U32, U32, )
  312. OPCODE(INotEqual, U1, U32, U32, )
  313. OPCODE(SGreaterThanEqual, U1, U32, U32, )
  314. OPCODE(UGreaterThanEqual, U1, U32, U32, )
  315. // Atomic operations
  316. OPCODE(SharedAtomicIAdd32, U32, U32, U32, )
  317. OPCODE(SharedAtomicSMin32, U32, U32, U32, )
  318. OPCODE(SharedAtomicUMin32, U32, U32, U32, )
  319. OPCODE(SharedAtomicSMax32, U32, U32, U32, )
  320. OPCODE(SharedAtomicUMax32, U32, U32, U32, )
  321. OPCODE(SharedAtomicInc32, U32, U32, U32, )
  322. OPCODE(SharedAtomicDec32, U32, U32, U32, )
  323. OPCODE(SharedAtomicAnd32, U32, U32, U32, )
  324. OPCODE(SharedAtomicOr32, U32, U32, U32, )
  325. OPCODE(SharedAtomicXor32, U32, U32, U32, )
  326. OPCODE(SharedAtomicExchange32, U32, U32, U32, )
  327. OPCODE(SharedAtomicExchange64, U64, U32, U64, )
  328. OPCODE(SharedAtomicExchange32x2, U32x2, U32, U32x2, )
  329. OPCODE(GlobalAtomicIAdd32, U32, U64, U32, )
  330. OPCODE(GlobalAtomicSMin32, U32, U64, U32, )
  331. OPCODE(GlobalAtomicUMin32, U32, U64, U32, )
  332. OPCODE(GlobalAtomicSMax32, U32, U64, U32, )
  333. OPCODE(GlobalAtomicUMax32, U32, U64, U32, )
  334. OPCODE(GlobalAtomicInc32, U32, U64, U32, )
  335. OPCODE(GlobalAtomicDec32, U32, U64, U32, )
  336. OPCODE(GlobalAtomicAnd32, U32, U64, U32, )
  337. OPCODE(GlobalAtomicOr32, U32, U64, U32, )
  338. OPCODE(GlobalAtomicXor32, U32, U64, U32, )
  339. OPCODE(GlobalAtomicExchange32, U32, U64, U32, )
  340. OPCODE(GlobalAtomicIAdd64, U64, U64, U64, )
  341. OPCODE(GlobalAtomicSMin64, U64, U64, U64, )
  342. OPCODE(GlobalAtomicUMin64, U64, U64, U64, )
  343. OPCODE(GlobalAtomicSMax64, U64, U64, U64, )
  344. OPCODE(GlobalAtomicUMax64, U64, U64, U64, )
  345. OPCODE(GlobalAtomicAnd64, U64, U64, U64, )
  346. OPCODE(GlobalAtomicOr64, U64, U64, U64, )
  347. OPCODE(GlobalAtomicXor64, U64, U64, U64, )
  348. OPCODE(GlobalAtomicExchange64, U64, U64, U64, )
  349. OPCODE(GlobalAtomicIAdd32x2, U32x2, U32x2, U32x2, )
  350. OPCODE(GlobalAtomicSMin32x2, U32x2, U32x2, U32x2, )
  351. OPCODE(GlobalAtomicUMin32x2, U32x2, U32x2, U32x2, )
  352. OPCODE(GlobalAtomicSMax32x2, U32x2, U32x2, U32x2, )
  353. OPCODE(GlobalAtomicUMax32x2, U32x2, U32x2, U32x2, )
  354. OPCODE(GlobalAtomicAnd32x2, U32x2, U32x2, U32x2, )
  355. OPCODE(GlobalAtomicOr32x2, U32x2, U32x2, U32x2, )
  356. OPCODE(GlobalAtomicXor32x2, U32x2, U32x2, U32x2, )
  357. OPCODE(GlobalAtomicExchange32x2, U32x2, U32x2, U32x2, )
  358. OPCODE(GlobalAtomicAddF32, F32, U64, F32, )
  359. OPCODE(GlobalAtomicAddF16x2, U32, U64, F16x2, )
  360. OPCODE(GlobalAtomicAddF32x2, U32, U64, F32x2, )
  361. OPCODE(GlobalAtomicMinF16x2, U32, U64, F16x2, )
  362. OPCODE(GlobalAtomicMinF32x2, U32, U64, F32x2, )
  363. OPCODE(GlobalAtomicMaxF16x2, U32, U64, F16x2, )
  364. OPCODE(GlobalAtomicMaxF32x2, U32, U64, F32x2, )
  365. OPCODE(StorageAtomicIAdd32, U32, U32, U32, U32, )
  366. OPCODE(StorageAtomicSMin32, U32, U32, U32, U32, )
  367. OPCODE(StorageAtomicUMin32, U32, U32, U32, U32, )
  368. OPCODE(StorageAtomicSMax32, U32, U32, U32, U32, )
  369. OPCODE(StorageAtomicUMax32, U32, U32, U32, U32, )
  370. OPCODE(StorageAtomicInc32, U32, U32, U32, U32, )
  371. OPCODE(StorageAtomicDec32, U32, U32, U32, U32, )
  372. OPCODE(StorageAtomicAnd32, U32, U32, U32, U32, )
  373. OPCODE(StorageAtomicOr32, U32, U32, U32, U32, )
  374. OPCODE(StorageAtomicXor32, U32, U32, U32, U32, )
  375. OPCODE(StorageAtomicExchange32, U32, U32, U32, U32, )
  376. OPCODE(StorageAtomicIAdd64, U64, U32, U32, U64, )
  377. OPCODE(StorageAtomicSMin64, U64, U32, U32, U64, )
  378. OPCODE(StorageAtomicUMin64, U64, U32, U32, U64, )
  379. OPCODE(StorageAtomicSMax64, U64, U32, U32, U64, )
  380. OPCODE(StorageAtomicUMax64, U64, U32, U32, U64, )
  381. OPCODE(StorageAtomicAnd64, U64, U32, U32, U64, )
  382. OPCODE(StorageAtomicOr64, U64, U32, U32, U64, )
  383. OPCODE(StorageAtomicXor64, U64, U32, U32, U64, )
  384. OPCODE(StorageAtomicExchange64, U64, U32, U32, U64, )
  385. OPCODE(StorageAtomicIAdd32x2, U32x2, U32, U32, U32x2, )
  386. OPCODE(StorageAtomicSMin32x2, U32x2, U32, U32, U32x2, )
  387. OPCODE(StorageAtomicUMin32x2, U32x2, U32, U32, U32x2, )
  388. OPCODE(StorageAtomicSMax32x2, U32x2, U32, U32, U32x2, )
  389. OPCODE(StorageAtomicUMax32x2, U32x2, U32, U32, U32x2, )
  390. OPCODE(StorageAtomicAnd32x2, U32x2, U32, U32, U32x2, )
  391. OPCODE(StorageAtomicOr32x2, U32x2, U32, U32, U32x2, )
  392. OPCODE(StorageAtomicXor32x2, U32x2, U32, U32, U32x2, )
  393. OPCODE(StorageAtomicExchange32x2, U32x2, U32, U32, U32x2, )
  394. OPCODE(StorageAtomicAddF32, F32, U32, U32, F32, )
  395. OPCODE(StorageAtomicAddF16x2, U32, U32, U32, F16x2, )
  396. OPCODE(StorageAtomicAddF32x2, U32, U32, U32, F32x2, )
  397. OPCODE(StorageAtomicMinF16x2, U32, U32, U32, F16x2, )
  398. OPCODE(StorageAtomicMinF32x2, U32, U32, U32, F32x2, )
  399. OPCODE(StorageAtomicMaxF16x2, U32, U32, U32, F16x2, )
  400. OPCODE(StorageAtomicMaxF32x2, U32, U32, U32, F32x2, )
  401. // Logical operations
  402. OPCODE(LogicalOr, U1, U1, U1, )
  403. OPCODE(LogicalAnd, U1, U1, U1, )
  404. OPCODE(LogicalXor, U1, U1, U1, )
  405. OPCODE(LogicalNot, U1, U1, )
  406. // Conversion operations
  407. OPCODE(ConvertS16F16, U32, F16, )
  408. OPCODE(ConvertS16F32, U32, F32, )
  409. OPCODE(ConvertS16F64, U32, F64, )
  410. OPCODE(ConvertS32F16, U32, F16, )
  411. OPCODE(ConvertS32F32, U32, F32, )
  412. OPCODE(ConvertS32F64, U32, F64, )
  413. OPCODE(ConvertS64F16, U64, F16, )
  414. OPCODE(ConvertS64F32, U64, F32, )
  415. OPCODE(ConvertS64F64, U64, F64, )
  416. OPCODE(ConvertU16F16, U32, F16, )
  417. OPCODE(ConvertU16F32, U32, F32, )
  418. OPCODE(ConvertU16F64, U32, F64, )
  419. OPCODE(ConvertU32F16, U32, F16, )
  420. OPCODE(ConvertU32F32, U32, F32, )
  421. OPCODE(ConvertU32F64, U32, F64, )
  422. OPCODE(ConvertU64F16, U64, F16, )
  423. OPCODE(ConvertU64F32, U64, F32, )
  424. OPCODE(ConvertU64F64, U64, F64, )
  425. OPCODE(ConvertU64U32, U64, U32, )
  426. OPCODE(ConvertU32U64, U32, U64, )
  427. OPCODE(ConvertF16F32, F16, F32, )
  428. OPCODE(ConvertF32F16, F32, F16, )
  429. OPCODE(ConvertF32F64, F32, F64, )
  430. OPCODE(ConvertF64F32, F64, F32, )
  431. OPCODE(ConvertF16S8, F16, U32, )
  432. OPCODE(ConvertF16S16, F16, U32, )
  433. OPCODE(ConvertF16S32, F16, U32, )
  434. OPCODE(ConvertF16S64, F16, U64, )
  435. OPCODE(ConvertF16U8, F16, U32, )
  436. OPCODE(ConvertF16U16, F16, U32, )
  437. OPCODE(ConvertF16U32, F16, U32, )
  438. OPCODE(ConvertF16U64, F16, U64, )
  439. OPCODE(ConvertF32S8, F32, U32, )
  440. OPCODE(ConvertF32S16, F32, U32, )
  441. OPCODE(ConvertF32S32, F32, U32, )
  442. OPCODE(ConvertF32S64, F32, U64, )
  443. OPCODE(ConvertF32U8, F32, U32, )
  444. OPCODE(ConvertF32U16, F32, U32, )
  445. OPCODE(ConvertF32U32, F32, U32, )
  446. OPCODE(ConvertF32U64, F32, U64, )
  447. OPCODE(ConvertF64S8, F64, U32, )
  448. OPCODE(ConvertF64S16, F64, U32, )
  449. OPCODE(ConvertF64S32, F64, U32, )
  450. OPCODE(ConvertF64S64, F64, U64, )
  451. OPCODE(ConvertF64U8, F64, U32, )
  452. OPCODE(ConvertF64U16, F64, U32, )
  453. OPCODE(ConvertF64U32, F64, U32, )
  454. OPCODE(ConvertF64U64, F64, U64, )
  455. // Image operations
  456. OPCODE(BindlessImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
  457. OPCODE(BindlessImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
  458. OPCODE(BindlessImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
  459. OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
  460. OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
  461. OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
  462. OPCODE(BindlessImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, )
  463. OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, )
  464. OPCODE(BindlessImageQueryLod, F32x4, U32, Opaque, )
  465. OPCODE(BindlessImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, )
  466. OPCODE(BindlessImageRead, U32x4, U32, Opaque, )
  467. OPCODE(BindlessImageWrite, Void, U32, Opaque, U32x4, )
  468. OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
  469. OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
  470. OPCODE(BoundImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
  471. OPCODE(BoundImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
  472. OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
  473. OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
  474. OPCODE(BoundImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, )
  475. OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, )
  476. OPCODE(BoundImageQueryLod, F32x4, U32, Opaque, )
  477. OPCODE(BoundImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, )
  478. OPCODE(BoundImageRead, U32x4, U32, Opaque, )
  479. OPCODE(BoundImageWrite, Void, U32, Opaque, U32x4, )
  480. OPCODE(ImageSampleImplicitLod, F32x4, Opaque, Opaque, Opaque, Opaque, )
  481. OPCODE(ImageSampleExplicitLod, F32x4, Opaque, Opaque, Opaque, Opaque, )
  482. OPCODE(ImageSampleDrefImplicitLod, F32, Opaque, Opaque, F32, Opaque, Opaque, )
  483. OPCODE(ImageSampleDrefExplicitLod, F32, Opaque, Opaque, F32, Opaque, Opaque, )
  484. OPCODE(ImageGather, F32x4, Opaque, Opaque, Opaque, Opaque, )
  485. OPCODE(ImageGatherDref, F32x4, Opaque, Opaque, Opaque, Opaque, F32, )
  486. OPCODE(ImageFetch, F32x4, Opaque, Opaque, Opaque, U32, Opaque, )
  487. OPCODE(ImageQueryDimensions, U32x4, Opaque, U32, )
  488. OPCODE(ImageQueryLod, F32x4, Opaque, Opaque, )
  489. OPCODE(ImageGradient, F32x4, Opaque, Opaque, Opaque, Opaque, Opaque, )
  490. OPCODE(ImageRead, U32x4, Opaque, Opaque, )
  491. OPCODE(ImageWrite, Void, Opaque, Opaque, U32x4, )
  492. OPCODE(IsTextureScaled, U1, U32, )
  493. OPCODE(IsImageScaled, U1, U32, )
  494. // Atomic Image operations
  495. OPCODE(BindlessImageAtomicIAdd32, U32, U32, Opaque, U32, )
  496. OPCODE(BindlessImageAtomicSMin32, U32, U32, Opaque, U32, )
  497. OPCODE(BindlessImageAtomicUMin32, U32, U32, Opaque, U32, )
  498. OPCODE(BindlessImageAtomicSMax32, U32, U32, Opaque, U32, )
  499. OPCODE(BindlessImageAtomicUMax32, U32, U32, Opaque, U32, )
  500. OPCODE(BindlessImageAtomicInc32, U32, U32, Opaque, U32, )
  501. OPCODE(BindlessImageAtomicDec32, U32, U32, Opaque, U32, )
  502. OPCODE(BindlessImageAtomicAnd32, U32, U32, Opaque, U32, )
  503. OPCODE(BindlessImageAtomicOr32, U32, U32, Opaque, U32, )
  504. OPCODE(BindlessImageAtomicXor32, U32, U32, Opaque, U32, )
  505. OPCODE(BindlessImageAtomicExchange32, U32, U32, Opaque, U32, )
  506. OPCODE(BoundImageAtomicIAdd32, U32, U32, Opaque, U32, )
  507. OPCODE(BoundImageAtomicSMin32, U32, U32, Opaque, U32, )
  508. OPCODE(BoundImageAtomicUMin32, U32, U32, Opaque, U32, )
  509. OPCODE(BoundImageAtomicSMax32, U32, U32, Opaque, U32, )
  510. OPCODE(BoundImageAtomicUMax32, U32, U32, Opaque, U32, )
  511. OPCODE(BoundImageAtomicInc32, U32, U32, Opaque, U32, )
  512. OPCODE(BoundImageAtomicDec32, U32, U32, Opaque, U32, )
  513. OPCODE(BoundImageAtomicAnd32, U32, U32, Opaque, U32, )
  514. OPCODE(BoundImageAtomicOr32, U32, U32, Opaque, U32, )
  515. OPCODE(BoundImageAtomicXor32, U32, U32, Opaque, U32, )
  516. OPCODE(BoundImageAtomicExchange32, U32, U32, Opaque, U32, )
  517. OPCODE(ImageAtomicIAdd32, U32, Opaque, Opaque, U32, )
  518. OPCODE(ImageAtomicSMin32, U32, Opaque, Opaque, U32, )
  519. OPCODE(ImageAtomicUMin32, U32, Opaque, Opaque, U32, )
  520. OPCODE(ImageAtomicSMax32, U32, Opaque, Opaque, U32, )
  521. OPCODE(ImageAtomicUMax32, U32, Opaque, Opaque, U32, )
  522. OPCODE(ImageAtomicInc32, U32, Opaque, Opaque, U32, )
  523. OPCODE(ImageAtomicDec32, U32, Opaque, Opaque, U32, )
  524. OPCODE(ImageAtomicAnd32, U32, Opaque, Opaque, U32, )
  525. OPCODE(ImageAtomicOr32, U32, Opaque, Opaque, U32, )
  526. OPCODE(ImageAtomicXor32, U32, Opaque, Opaque, U32, )
  527. OPCODE(ImageAtomicExchange32, U32, Opaque, Opaque, U32, )
  528. // Warp operations
  529. OPCODE(LaneId, U32, )
  530. OPCODE(VoteAll, U1, U1, )
  531. OPCODE(VoteAny, U1, U1, )
  532. OPCODE(VoteEqual, U1, U1, )
  533. OPCODE(SubgroupBallot, U32, U1, )
  534. OPCODE(SubgroupEqMask, U32, )
  535. OPCODE(SubgroupLtMask, U32, )
  536. OPCODE(SubgroupLeMask, U32, )
  537. OPCODE(SubgroupGtMask, U32, )
  538. OPCODE(SubgroupGeMask, U32, )
  539. OPCODE(ShuffleIndex, U32, U32, U32, U32, U32, )
  540. OPCODE(ShuffleUp, U32, U32, U32, U32, U32, )
  541. OPCODE(ShuffleDown, U32, U32, U32, U32, U32, )
  542. OPCODE(ShuffleButterfly, U32, U32, U32, U32, U32, )
  543. OPCODE(FSwizzleAdd, F32, F32, F32, U32, )
  544. OPCODE(DPdxFine, F32, F32, )
  545. OPCODE(DPdyFine, F32, F32, )
  546. OPCODE(DPdxCoarse, F32, F32, )
  547. OPCODE(DPdyCoarse, F32, F32, )