1 //===-- DSInstructions.td - DS Instruction Defintions ---------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 class DS_Pseudo <string opName, dag outs, dag ins, string asmOps, list<dag> pattern=[]> :
10 InstSI <outs, ins, "", pattern>,
11 SIMCInstr <opName, SIEncodingFamily.NONE> {
16 let UseNamedOperandTable = 1;
18 // Most instruction load and store data, so set this as the default.
23 let hasSideEffects = 0;
24 let SchedRW = [WriteLDS];
27 let isCodeGenOnly = 1;
29 let AsmMatchConverter = "cvtDS";
31 string Mnemonic = opName;
32 string AsmOperands = asmOps;
34 // Well these bits a kind of hack because it would be more natural
35 // to test "outs" and "ins" dags for the presence of particular operands
38 bits<1> has_data0 = 1;
39 bits<1> has_data1 = 1;
41 bits<1> has_gws_data0 = 0; // data0 is encoded as addr
43 bits<1> has_offset = 1; // has "offset" that should be split to offset0,1
44 bits<1> has_offset0 = 1;
45 bits<1> has_offset1 = 1;
48 bits<1> gdsValue = 0; // if has_gds == 0 set gds to this value
50 bits<1> has_m0_read = 1;
52 let Uses = !if(has_m0_read, [M0, EXEC], [EXEC]);
55 class DS_Real <DS_Pseudo ds> :
56 InstSI <ds.OutOperandList, ds.InOperandList, ds.Mnemonic # " " # ds.AsmOperands, []>,
60 let isCodeGenOnly = 0;
62 // copy relevant pseudo op flags
63 let SubtargetPredicate = ds.SubtargetPredicate;
64 let OtherPredicates = ds.OtherPredicates;
65 let AsmMatchConverter = ds.AsmMatchConverter;
77 let offset0 = !if(ds.has_offset, offset{7-0}, ?);
78 let offset1 = !if(ds.has_offset, offset{15-8}, ?);
82 // DS Pseudo instructions
84 class DS_0A1D_NORET<string opName, RegisterClass rc = VGPR_32>
87 (ins rc:$data0, offset:$offset, gds:$gds),
88 "$data0$offset$gds"> {
95 class DS_1A1D_NORET<string opName, RegisterClass rc = VGPR_32>
98 (ins VGPR_32:$addr, rc:$data0, offset:$offset, gds:$gds),
99 "$addr, $data0$offset$gds"> {
105 multiclass DS_1A1D_NORET_mc<string opName, RegisterClass rc = VGPR_32> {
106 def "" : DS_1A1D_NORET<opName, rc>,
107 AtomicNoRet<opName, 0>;
109 let has_m0_read = 0 in {
110 def _gfx9 : DS_1A1D_NORET<opName, rc>,
111 AtomicNoRet<opName#"_gfx9", 0>;
115 class DS_1A2D_NORET<string opName, RegisterClass rc = VGPR_32>
118 (ins VGPR_32:$addr, rc:$data0, rc:$data1, offset:$offset, gds:$gds),
119 "$addr, $data0, $data1"#"$offset"#"$gds"> {
124 multiclass DS_1A2D_NORET_mc<string opName, RegisterClass rc = VGPR_32> {
125 def "" : DS_1A2D_NORET<opName, rc>,
126 AtomicNoRet<opName, 0>;
128 let has_m0_read = 0 in {
129 def _gfx9 : DS_1A2D_NORET<opName, rc>,
130 AtomicNoRet<opName#"_gfx9", 0>;
134 class DS_1A2D_Off8_NORET <string opName, RegisterClass rc = VGPR_32>
137 (ins VGPR_32:$addr, rc:$data0, rc:$data1,
138 offset0:$offset0, offset1:$offset1, gds:$gds),
139 "$addr, $data0, $data1$offset0$offset1$gds"> {
143 let AsmMatchConverter = "cvtDSOffset01";
146 multiclass DS_1A2D_Off8_NORET_mc <string opName, RegisterClass rc = VGPR_32> {
147 def "" : DS_1A2D_Off8_NORET<opName, rc>;
149 let has_m0_read = 0 in {
150 def _gfx9 : DS_1A2D_Off8_NORET<opName, rc>;
154 class DS_1A1D_RET <string opName, RegisterClass rc = VGPR_32>
157 (ins VGPR_32:$addr, rc:$data0, offset:$offset, gds:$gds),
158 "$vdst, $addr, $data0$offset$gds"> {
160 let hasPostISelHook = 1;
164 multiclass DS_1A1D_RET_mc <string opName, RegisterClass rc = VGPR_32,
165 string NoRetOp = ""> {
166 def "" : DS_1A1D_RET<opName, rc>,
167 AtomicNoRet<NoRetOp, !if(!eq(NoRetOp, ""), 0, 1)>;
169 let has_m0_read = 0 in {
170 def _gfx9 : DS_1A1D_RET<opName, rc>,
171 AtomicNoRet<!if(!eq(NoRetOp, ""), "", NoRetOp#"_gfx9"),
172 !if(!eq(NoRetOp, ""), 0, 1)>;
176 class DS_1A2D_RET<string opName,
177 RegisterClass rc = VGPR_32,
178 RegisterClass src = rc>
181 (ins VGPR_32:$addr, src:$data0, src:$data1, offset:$offset, gds:$gds),
182 "$vdst, $addr, $data0, $data1$offset$gds"> {
184 let hasPostISelHook = 1;
187 multiclass DS_1A2D_RET_mc<string opName,
188 RegisterClass rc = VGPR_32,
190 RegisterClass src = rc> {
191 def "" : DS_1A2D_RET<opName, rc, src>,
192 AtomicNoRet<NoRetOp, !if(!eq(NoRetOp, ""), 0, 1)>;
194 let has_m0_read = 0 in {
195 def _gfx9 : DS_1A2D_RET<opName, rc, src>,
196 AtomicNoRet<NoRetOp#"_gfx9", !if(!eq(NoRetOp, ""), 0, 1)>;
200 class DS_1A2D_Off8_RET<string opName,
201 RegisterClass rc = VGPR_32,
202 RegisterClass src = rc>
205 (ins VGPR_32:$addr, src:$data0, src:$data1, offset0:$offset0, offset1:$offset1, gds:$gds),
206 "$vdst, $addr, $data0, $data1$offset0$offset1$gds"> {
209 let AsmMatchConverter = "cvtDSOffset01";
211 let hasPostISelHook = 1;
214 multiclass DS_1A2D_Off8_RET_mc<string opName,
215 RegisterClass rc = VGPR_32,
216 RegisterClass src = rc> {
217 def "" : DS_1A2D_Off8_RET<opName, rc, src>;
219 let has_m0_read = 0 in {
220 def _gfx9 : DS_1A2D_Off8_RET<opName, rc, src>;
225 class DS_1A_RET<string opName, RegisterClass rc = VGPR_32, bit HasTiedOutput = 0, Operand ofs = offset>
229 (ins VGPR_32:$addr, ofs:$offset, gds:$gds, rc:$vdst_in),
230 (ins VGPR_32:$addr, ofs:$offset, gds:$gds)),
231 "$vdst, $addr$offset$gds"> {
232 let Constraints = !if(HasTiedOutput, "$vdst = $vdst_in", "");
233 let DisableEncoding = !if(HasTiedOutput, "$vdst_in", "");
238 multiclass DS_1A_RET_mc<string opName, RegisterClass rc = VGPR_32, bit HasTiedOutput = 0, Operand ofs = offset> {
239 def "" : DS_1A_RET<opName, rc, HasTiedOutput, ofs>;
241 let has_m0_read = 0 in {
242 def _gfx9 : DS_1A_RET<opName, rc, HasTiedOutput, ofs>;
246 class DS_1A_RET_Tied<string opName, RegisterClass rc = VGPR_32> :
247 DS_1A_RET<opName, rc, 1>;
249 class DS_1A_Off8_RET <string opName, RegisterClass rc = VGPR_32>
252 (ins VGPR_32:$addr, offset0:$offset0, offset1:$offset1, gds:$gds),
253 "$vdst, $addr$offset0$offset1$gds"> {
258 let AsmMatchConverter = "cvtDSOffset01";
261 multiclass DS_1A_Off8_RET_mc <string opName, RegisterClass rc = VGPR_32> {
262 def "" : DS_1A_Off8_RET<opName, rc>;
264 let has_m0_read = 0 in {
265 def _gfx9 : DS_1A_Off8_RET<opName, rc>;
269 class DS_1A_RET_GDS <string opName> : DS_Pseudo<opName,
270 (outs VGPR_32:$vdst),
271 (ins VGPR_32:$addr, offset:$offset),
272 "$vdst, $addr$offset gds"> {
278 let AsmMatchConverter = "cvtDSGds";
281 class DS_0A_RET <string opName> : DS_Pseudo<opName,
282 (outs VGPR_32:$vdst),
283 (ins offset:$offset, gds:$gds),
284 "$vdst$offset$gds"> {
294 class DS_1A <string opName> : DS_Pseudo<opName,
296 (ins VGPR_32:$addr, offset:$offset, gds:$gds),
297 "$addr$offset$gds"> {
307 multiclass DS_1A_mc <string opName> {
308 def "" : DS_1A<opName>;
310 let has_m0_read = 0 in {
311 def _gfx9 : DS_1A<opName>;
316 class DS_GWS <string opName, dag ins, string asmOps>
317 : DS_Pseudo<opName, (outs), ins, asmOps> {
326 let AsmMatchConverter = "cvtDSGds";
329 class DS_GWS_0D <string opName>
331 (ins offset:$offset, gds:$gds), "$offset gds"> {
332 let hasSideEffects = 1;
335 class DS_GWS_1D <string opName>
337 (ins VGPR_32:$data0, offset:$offset, gds:$gds), "$data0$offset gds"> {
339 let has_gws_data0 = 1;
340 let hasSideEffects = 1;
343 class DS_VOID <string opName> : DS_Pseudo<opName,
347 let hasSideEffects = 1;
348 let UseNamedOperandTable = 0;
349 let AsmMatchConverter = "";
361 class DS_1A1D_PERMUTE <string opName, SDPatternOperator node = null_frag>
363 (outs VGPR_32:$vdst),
364 (ins VGPR_32:$addr, VGPR_32:$data0, offset:$offset),
365 "$vdst, $addr, $data0$offset",
367 (node (DS1Addr1Offset i32:$addr, i16:$offset), i32:$data0))] > {
371 let isConvergent = 1;
377 defm DS_ADD_U32 : DS_1A1D_NORET_mc<"ds_add_u32">;
378 defm DS_SUB_U32 : DS_1A1D_NORET_mc<"ds_sub_u32">;
379 defm DS_RSUB_U32 : DS_1A1D_NORET_mc<"ds_rsub_u32">;
380 defm DS_INC_U32 : DS_1A1D_NORET_mc<"ds_inc_u32">;
381 defm DS_DEC_U32 : DS_1A1D_NORET_mc<"ds_dec_u32">;
382 defm DS_MIN_I32 : DS_1A1D_NORET_mc<"ds_min_i32">;
383 defm DS_MAX_I32 : DS_1A1D_NORET_mc<"ds_max_i32">;
384 defm DS_MIN_U32 : DS_1A1D_NORET_mc<"ds_min_u32">;
385 defm DS_MAX_U32 : DS_1A1D_NORET_mc<"ds_max_u32">;
386 defm DS_AND_B32 : DS_1A1D_NORET_mc<"ds_and_b32">;
387 defm DS_OR_B32 : DS_1A1D_NORET_mc<"ds_or_b32">;
388 defm DS_XOR_B32 : DS_1A1D_NORET_mc<"ds_xor_b32">;
389 defm DS_ADD_F32 : DS_1A1D_NORET_mc<"ds_add_f32">;
390 defm DS_MIN_F32 : DS_1A1D_NORET_mc<"ds_min_f32">;
391 defm DS_MAX_F32 : DS_1A1D_NORET_mc<"ds_max_f32">;
394 defm DS_WRITE_B8 : DS_1A1D_NORET_mc<"ds_write_b8">;
395 defm DS_WRITE_B16 : DS_1A1D_NORET_mc<"ds_write_b16">;
396 defm DS_WRITE_B32 : DS_1A1D_NORET_mc<"ds_write_b32">;
397 defm DS_WRITE2_B32 : DS_1A2D_Off8_NORET_mc<"ds_write2_b32">;
398 defm DS_WRITE2ST64_B32: DS_1A2D_Off8_NORET_mc<"ds_write2st64_b32">;
401 let has_m0_read = 0 in {
403 let SubtargetPredicate = HasD16LoadStore in {
404 def DS_WRITE_B8_D16_HI : DS_1A1D_NORET<"ds_write_b8_d16_hi">;
405 def DS_WRITE_B16_D16_HI : DS_1A1D_NORET<"ds_write_b16_d16_hi">;
408 } // End has_m0_read = 0
410 let SubtargetPredicate = HasDSAddTid in {
411 def DS_WRITE_ADDTID_B32 : DS_0A1D_NORET<"ds_write_addtid_b32">;
416 defm DS_MSKOR_B32 : DS_1A2D_NORET_mc<"ds_mskor_b32">;
417 defm DS_CMPST_B32 : DS_1A2D_NORET_mc<"ds_cmpst_b32">;
418 defm DS_CMPST_F32 : DS_1A2D_NORET_mc<"ds_cmpst_f32">;
420 defm DS_ADD_U64 : DS_1A1D_NORET_mc<"ds_add_u64", VReg_64>;
421 defm DS_SUB_U64 : DS_1A1D_NORET_mc<"ds_sub_u64", VReg_64>;
422 defm DS_RSUB_U64 : DS_1A1D_NORET_mc<"ds_rsub_u64", VReg_64>;
423 defm DS_INC_U64 : DS_1A1D_NORET_mc<"ds_inc_u64", VReg_64>;
424 defm DS_DEC_U64 : DS_1A1D_NORET_mc<"ds_dec_u64", VReg_64>;
425 defm DS_MIN_I64 : DS_1A1D_NORET_mc<"ds_min_i64", VReg_64>;
426 defm DS_MAX_I64 : DS_1A1D_NORET_mc<"ds_max_i64", VReg_64>;
427 defm DS_MIN_U64 : DS_1A1D_NORET_mc<"ds_min_u64", VReg_64>;
428 defm DS_MAX_U64 : DS_1A1D_NORET_mc<"ds_max_u64", VReg_64>;
429 defm DS_AND_B64 : DS_1A1D_NORET_mc<"ds_and_b64", VReg_64>;
430 defm DS_OR_B64 : DS_1A1D_NORET_mc<"ds_or_b64", VReg_64>;
431 defm DS_XOR_B64 : DS_1A1D_NORET_mc<"ds_xor_b64", VReg_64>;
432 defm DS_MSKOR_B64 : DS_1A2D_NORET_mc<"ds_mskor_b64", VReg_64>;
434 defm DS_WRITE_B64 : DS_1A1D_NORET_mc<"ds_write_b64", VReg_64>;
435 defm DS_WRITE2_B64 : DS_1A2D_Off8_NORET_mc<"ds_write2_b64", VReg_64>;
436 defm DS_WRITE2ST64_B64: DS_1A2D_Off8_NORET_mc<"ds_write2st64_b64", VReg_64>;
438 defm DS_CMPST_B64 : DS_1A2D_NORET_mc<"ds_cmpst_b64", VReg_64>;
439 defm DS_CMPST_F64 : DS_1A2D_NORET_mc<"ds_cmpst_f64", VReg_64>;
440 defm DS_MIN_F64 : DS_1A1D_NORET_mc<"ds_min_f64", VReg_64>;
441 defm DS_MAX_F64 : DS_1A1D_NORET_mc<"ds_max_f64", VReg_64>;
443 defm DS_ADD_RTN_U32 : DS_1A1D_RET_mc<"ds_add_rtn_u32", VGPR_32, "ds_add_u32">;
444 defm DS_ADD_RTN_F32 : DS_1A1D_RET_mc<"ds_add_rtn_f32", VGPR_32, "ds_add_f32">;
445 defm DS_SUB_RTN_U32 : DS_1A1D_RET_mc<"ds_sub_rtn_u32", VGPR_32, "ds_sub_u32">;
446 defm DS_RSUB_RTN_U32 : DS_1A1D_RET_mc<"ds_rsub_rtn_u32", VGPR_32, "ds_rsub_u32">;
447 defm DS_INC_RTN_U32 : DS_1A1D_RET_mc<"ds_inc_rtn_u32", VGPR_32, "ds_inc_u32">;
448 defm DS_DEC_RTN_U32 : DS_1A1D_RET_mc<"ds_dec_rtn_u32", VGPR_32, "ds_dec_u32">;
449 defm DS_MIN_RTN_I32 : DS_1A1D_RET_mc<"ds_min_rtn_i32", VGPR_32, "ds_min_i32">;
450 defm DS_MAX_RTN_I32 : DS_1A1D_RET_mc<"ds_max_rtn_i32", VGPR_32, "ds_max_i32">;
451 defm DS_MIN_RTN_U32 : DS_1A1D_RET_mc<"ds_min_rtn_u32", VGPR_32, "ds_min_u32">;
452 defm DS_MAX_RTN_U32 : DS_1A1D_RET_mc<"ds_max_rtn_u32", VGPR_32, "ds_max_u32">;
453 defm DS_AND_RTN_B32 : DS_1A1D_RET_mc<"ds_and_rtn_b32", VGPR_32, "ds_and_b32">;
454 defm DS_OR_RTN_B32 : DS_1A1D_RET_mc<"ds_or_rtn_b32", VGPR_32, "ds_or_b32">;
455 defm DS_XOR_RTN_B32 : DS_1A1D_RET_mc<"ds_xor_rtn_b32", VGPR_32, "ds_xor_b32">;
456 defm DS_MSKOR_RTN_B32 : DS_1A2D_RET_mc<"ds_mskor_rtn_b32", VGPR_32, "ds_mskor_b32">;
457 defm DS_CMPST_RTN_B32 : DS_1A2D_RET_mc<"ds_cmpst_rtn_b32", VGPR_32, "ds_cmpst_b32">;
458 defm DS_CMPST_RTN_F32 : DS_1A2D_RET_mc<"ds_cmpst_rtn_f32", VGPR_32, "ds_cmpst_f32">;
459 defm DS_MIN_RTN_F32 : DS_1A1D_RET_mc<"ds_min_rtn_f32", VGPR_32, "ds_min_f32">;
460 defm DS_MAX_RTN_F32 : DS_1A1D_RET_mc<"ds_max_rtn_f32", VGPR_32, "ds_max_f32">;
462 defm DS_WRXCHG_RTN_B32 : DS_1A1D_RET_mc<"ds_wrxchg_rtn_b32">;
463 defm DS_WRXCHG2_RTN_B32 : DS_1A2D_Off8_RET_mc<"ds_wrxchg2_rtn_b32", VReg_64, VGPR_32>;
464 defm DS_WRXCHG2ST64_RTN_B32 : DS_1A2D_Off8_RET_mc<"ds_wrxchg2st64_rtn_b32", VReg_64, VGPR_32>;
466 defm DS_ADD_RTN_U64 : DS_1A1D_RET_mc<"ds_add_rtn_u64", VReg_64, "ds_add_u64">;
467 defm DS_SUB_RTN_U64 : DS_1A1D_RET_mc<"ds_sub_rtn_u64", VReg_64, "ds_sub_u64">;
468 defm DS_RSUB_RTN_U64 : DS_1A1D_RET_mc<"ds_rsub_rtn_u64", VReg_64, "ds_rsub_u64">;
469 defm DS_INC_RTN_U64 : DS_1A1D_RET_mc<"ds_inc_rtn_u64", VReg_64, "ds_inc_u64">;
470 defm DS_DEC_RTN_U64 : DS_1A1D_RET_mc<"ds_dec_rtn_u64", VReg_64, "ds_dec_u64">;
471 defm DS_MIN_RTN_I64 : DS_1A1D_RET_mc<"ds_min_rtn_i64", VReg_64, "ds_min_i64">;
472 defm DS_MAX_RTN_I64 : DS_1A1D_RET_mc<"ds_max_rtn_i64", VReg_64, "ds_max_i64">;
473 defm DS_MIN_RTN_U64 : DS_1A1D_RET_mc<"ds_min_rtn_u64", VReg_64, "ds_min_u64">;
474 defm DS_MAX_RTN_U64 : DS_1A1D_RET_mc<"ds_max_rtn_u64", VReg_64, "ds_max_u64">;
475 defm DS_AND_RTN_B64 : DS_1A1D_RET_mc<"ds_and_rtn_b64", VReg_64, "ds_and_b64">;
476 defm DS_OR_RTN_B64 : DS_1A1D_RET_mc<"ds_or_rtn_b64", VReg_64, "ds_or_b64">;
477 defm DS_XOR_RTN_B64 : DS_1A1D_RET_mc<"ds_xor_rtn_b64", VReg_64, "ds_xor_b64">;
478 defm DS_MSKOR_RTN_B64 : DS_1A2D_RET_mc<"ds_mskor_rtn_b64", VReg_64, "ds_mskor_b64">;
479 defm DS_CMPST_RTN_B64 : DS_1A2D_RET_mc<"ds_cmpst_rtn_b64", VReg_64, "ds_cmpst_b64">;
480 defm DS_CMPST_RTN_F64 : DS_1A2D_RET_mc<"ds_cmpst_rtn_f64", VReg_64, "ds_cmpst_f64">;
481 defm DS_MIN_RTN_F64 : DS_1A1D_RET_mc<"ds_min_rtn_f64", VReg_64, "ds_min_f64">;
482 defm DS_MAX_RTN_F64 : DS_1A1D_RET_mc<"ds_max_rtn_f64", VReg_64, "ds_max_f64">;
484 defm DS_WRXCHG_RTN_B64 : DS_1A1D_RET_mc<"ds_wrxchg_rtn_b64", VReg_64>;
485 defm DS_WRXCHG2_RTN_B64 : DS_1A2D_Off8_RET_mc<"ds_wrxchg2_rtn_b64", VReg_128, VReg_64>;
486 defm DS_WRXCHG2ST64_RTN_B64 : DS_1A2D_Off8_RET_mc<"ds_wrxchg2st64_rtn_b64", VReg_128, VReg_64>;
488 let isConvergent = 1, usesCustomInserter = 1 in {
489 def DS_GWS_INIT : DS_GWS_1D<"ds_gws_init"> {
492 def DS_GWS_SEMA_V : DS_GWS_0D<"ds_gws_sema_v">;
493 def DS_GWS_SEMA_BR : DS_GWS_1D<"ds_gws_sema_br">;
494 def DS_GWS_SEMA_P : DS_GWS_0D<"ds_gws_sema_p">;
495 def DS_GWS_BARRIER : DS_GWS_1D<"ds_gws_barrier">;
498 def DS_ADD_SRC2_U32 : DS_1A<"ds_add_src2_u32">;
499 def DS_SUB_SRC2_U32 : DS_1A<"ds_sub_src2_u32">;
500 def DS_RSUB_SRC2_U32 : DS_1A<"ds_rsub_src2_u32">;
501 def DS_INC_SRC2_U32 : DS_1A<"ds_inc_src2_u32">;
502 def DS_DEC_SRC2_U32 : DS_1A<"ds_dec_src2_u32">;
503 def DS_MIN_SRC2_I32 : DS_1A<"ds_min_src2_i32">;
504 def DS_MAX_SRC2_I32 : DS_1A<"ds_max_src2_i32">;
505 def DS_MIN_SRC2_U32 : DS_1A<"ds_min_src2_u32">;
506 def DS_MAX_SRC2_U32 : DS_1A<"ds_max_src2_u32">;
507 def DS_AND_SRC2_B32 : DS_1A<"ds_and_src2_b32">;
508 def DS_OR_SRC2_B32 : DS_1A<"ds_or_src2_b32">;
509 def DS_XOR_SRC2_B32 : DS_1A<"ds_xor_src2_b32">;
510 def DS_MIN_SRC2_F32 : DS_1A<"ds_min_src2_f32">;
511 def DS_MAX_SRC2_F32 : DS_1A<"ds_max_src2_f32">;
513 def DS_ADD_SRC2_U64 : DS_1A<"ds_add_src2_u64">;
514 def DS_SUB_SRC2_U64 : DS_1A<"ds_sub_src2_u64">;
515 def DS_RSUB_SRC2_U64 : DS_1A<"ds_rsub_src2_u64">;
516 def DS_INC_SRC2_U64 : DS_1A<"ds_inc_src2_u64">;
517 def DS_DEC_SRC2_U64 : DS_1A<"ds_dec_src2_u64">;
518 def DS_MIN_SRC2_I64 : DS_1A<"ds_min_src2_i64">;
519 def DS_MAX_SRC2_I64 : DS_1A<"ds_max_src2_i64">;
520 def DS_MIN_SRC2_U64 : DS_1A<"ds_min_src2_u64">;
521 def DS_MAX_SRC2_U64 : DS_1A<"ds_max_src2_u64">;
522 def DS_AND_SRC2_B64 : DS_1A<"ds_and_src2_b64">;
523 def DS_OR_SRC2_B64 : DS_1A<"ds_or_src2_b64">;
524 def DS_XOR_SRC2_B64 : DS_1A<"ds_xor_src2_b64">;
525 def DS_MIN_SRC2_F64 : DS_1A<"ds_min_src2_f64">;
526 def DS_MAX_SRC2_F64 : DS_1A<"ds_max_src2_f64">;
528 def DS_WRITE_SRC2_B32 : DS_1A<"ds_write_src2_b32">;
529 def DS_WRITE_SRC2_B64 : DS_1A<"ds_write_src2_b64">;
531 let Uses = [EXEC], mayLoad = 0, mayStore = 0, isConvergent = 1 in {
532 def DS_SWIZZLE_B32 : DS_1A_RET <"ds_swizzle_b32", VGPR_32, 0, SwizzleImm>;
535 let mayStore = 0 in {
536 defm DS_READ_I8 : DS_1A_RET_mc<"ds_read_i8">;
537 defm DS_READ_U8 : DS_1A_RET_mc<"ds_read_u8">;
538 defm DS_READ_I16 : DS_1A_RET_mc<"ds_read_i16">;
539 defm DS_READ_U16 : DS_1A_RET_mc<"ds_read_u16">;
540 defm DS_READ_B32 : DS_1A_RET_mc<"ds_read_b32">;
541 defm DS_READ_B64 : DS_1A_RET_mc<"ds_read_b64", VReg_64>;
543 defm DS_READ2_B32 : DS_1A_Off8_RET_mc<"ds_read2_b32", VReg_64>;
544 defm DS_READ2ST64_B32: DS_1A_Off8_RET_mc<"ds_read2st64_b32", VReg_64>;
546 defm DS_READ2_B64 : DS_1A_Off8_RET_mc<"ds_read2_b64", VReg_128>;
547 defm DS_READ2ST64_B64: DS_1A_Off8_RET_mc<"ds_read2st64_b64", VReg_128>;
549 let has_m0_read = 0 in {
550 let SubtargetPredicate = HasD16LoadStore in {
551 def DS_READ_U8_D16 : DS_1A_RET_Tied<"ds_read_u8_d16">;
552 def DS_READ_U8_D16_HI : DS_1A_RET_Tied<"ds_read_u8_d16_hi">;
553 def DS_READ_I8_D16 : DS_1A_RET_Tied<"ds_read_i8_d16">;
554 def DS_READ_I8_D16_HI : DS_1A_RET_Tied<"ds_read_i8_d16_hi">;
555 def DS_READ_U16_D16 : DS_1A_RET_Tied<"ds_read_u16_d16">;
556 def DS_READ_U16_D16_HI : DS_1A_RET_Tied<"ds_read_u16_d16_hi">;
558 } // End has_m0_read = 0
560 let SubtargetPredicate = HasDSAddTid in {
561 def DS_READ_ADDTID_B32 : DS_0A_RET<"ds_read_addtid_b32">;
564 } // End mayStore = 0
566 def DS_CONSUME : DS_0A_RET<"ds_consume">;
567 def DS_APPEND : DS_0A_RET<"ds_append">;
568 def DS_ORDERED_COUNT : DS_1A_RET_GDS<"ds_ordered_count">;
570 //===----------------------------------------------------------------------===//
571 // Instruction definitions for CI and newer.
572 //===----------------------------------------------------------------------===//
574 let SubtargetPredicate = isGFX7Plus in {
576 defm DS_WRAP_RTN_B32 : DS_1A2D_RET_mc<"ds_wrap_rtn_b32", VGPR_32>;
577 defm DS_CONDXCHG32_RTN_B64 : DS_1A1D_RET_mc<"ds_condxchg32_rtn_b64", VReg_64>;
579 let isConvergent = 1, usesCustomInserter = 1 in {
580 def DS_GWS_SEMA_RELEASE_ALL : DS_GWS_0D<"ds_gws_sema_release_all">;
583 let mayStore = 0 in {
584 defm DS_READ_B96 : DS_1A_RET_mc<"ds_read_b96", VReg_96>;
585 defm DS_READ_B128: DS_1A_RET_mc<"ds_read_b128", VReg_128>;
586 } // End mayStore = 0
589 defm DS_WRITE_B96 : DS_1A1D_NORET_mc<"ds_write_b96", VReg_96>;
590 defm DS_WRITE_B128 : DS_1A1D_NORET_mc<"ds_write_b128", VReg_128>;
593 def DS_NOP : DS_VOID<"ds_nop">;
595 } // let SubtargetPredicate = isGFX7Plus
597 //===----------------------------------------------------------------------===//
598 // Instruction definitions for VI and newer.
599 //===----------------------------------------------------------------------===//
601 let SubtargetPredicate = isGFX8Plus in {
603 let Uses = [EXEC] in {
604 def DS_PERMUTE_B32 : DS_1A1D_PERMUTE <"ds_permute_b32",
605 int_amdgcn_ds_permute>;
606 def DS_BPERMUTE_B32 : DS_1A1D_PERMUTE <"ds_bpermute_b32",
607 int_amdgcn_ds_bpermute>;
610 def DS_ADD_SRC2_F32 : DS_1A<"ds_add_src2_f32">;
612 } // let SubtargetPredicate = isGFX8Plus
614 //===----------------------------------------------------------------------===//
616 //===----------------------------------------------------------------------===//
619 (int_amdgcn_ds_swizzle i32:$src, timm:$offset16),
620 (DS_SWIZZLE_B32 $src, (as_i16imm $offset16), (i1 0))
623 class DSReadPat <DS_Pseudo inst, ValueType vt, PatFrag frag, int gds=0> : GCNPat <
624 (vt (frag (DS1Addr1Offset i32:$ptr, i16:$offset))),
625 (inst $ptr, offset:$offset, (i1 gds))
628 multiclass DSReadPat_mc<DS_Pseudo inst, ValueType vt, string frag> {
630 let OtherPredicates = [LDSRequiresM0Init] in {
631 def : DSReadPat<inst, vt, !cast<PatFrag>(frag#"_m0")>;
634 let OtherPredicates = [NotLDSRequiresM0Init] in {
635 def : DSReadPat<!cast<DS_Pseudo>(!cast<string>(inst)#"_gfx9"), vt, !cast<PatFrag>(frag)>;
639 class DSReadPat_D16 <DS_Pseudo inst, PatFrag frag, ValueType vt> : GCNPat <
640 (frag (DS1Addr1Offset i32:$ptr, i16:$offset), vt:$in),
641 (inst $ptr, offset:$offset, (i1 0), $in)
644 defm : DSReadPat_mc <DS_READ_I8, i32, "sextloadi8_local">;
645 defm : DSReadPat_mc <DS_READ_I8, i16, "sextloadi8_local">;
646 defm : DSReadPat_mc <DS_READ_U8, i32, "extloadi8_local">;
647 defm : DSReadPat_mc <DS_READ_U8, i32, "zextloadi8_local">;
648 defm : DSReadPat_mc <DS_READ_U8, i16, "extloadi8_local">;
649 defm : DSReadPat_mc <DS_READ_U8, i16, "zextloadi8_local">;
650 defm : DSReadPat_mc <DS_READ_I16, i32, "sextloadi16_local">;
651 defm : DSReadPat_mc <DS_READ_I16, i32, "sextloadi16_local">;
652 defm : DSReadPat_mc <DS_READ_U16, i32, "extloadi16_local">;
653 defm : DSReadPat_mc <DS_READ_U16, i32, "zextloadi16_local">;
654 defm : DSReadPat_mc <DS_READ_U16, i16, "load_local">;
656 foreach vt = Reg32Types.types in {
657 defm : DSReadPat_mc <DS_READ_B32, vt, "load_local">;
660 defm : DSReadPat_mc <DS_READ_B32, i32, "atomic_load_32_local">;
661 defm : DSReadPat_mc <DS_READ_B64, i64, "atomic_load_64_local">;
663 let AddedComplexity = 100 in {
665 foreach vt = VReg_64.RegTypes in {
666 defm : DSReadPat_mc <DS_READ_B64, vt, "load_align8_local">;
669 defm : DSReadPat_mc <DS_READ_B128, v4i32, "load_align16_local">;
671 } // End AddedComplexity = 100
673 let OtherPredicates = [D16PreservesUnusedBits] in {
674 def : DSReadPat_D16<DS_READ_U16_D16_HI, load_d16_hi_local, v2i16>;
675 def : DSReadPat_D16<DS_READ_U16_D16_HI, load_d16_hi_local, v2f16>;
676 def : DSReadPat_D16<DS_READ_U8_D16_HI, az_extloadi8_d16_hi_local, v2i16>;
677 def : DSReadPat_D16<DS_READ_U8_D16_HI, az_extloadi8_d16_hi_local, v2f16>;
678 def : DSReadPat_D16<DS_READ_I8_D16_HI, sextloadi8_d16_hi_local, v2i16>;
679 def : DSReadPat_D16<DS_READ_I8_D16_HI, sextloadi8_d16_hi_local, v2f16>;
681 def : DSReadPat_D16<DS_READ_U16_D16, load_d16_lo_local, v2i16>;
682 def : DSReadPat_D16<DS_READ_U16_D16, load_d16_lo_local, v2f16>;
683 def : DSReadPat_D16<DS_READ_U8_D16, az_extloadi8_d16_lo_local, v2i16>;
684 def : DSReadPat_D16<DS_READ_U8_D16, az_extloadi8_d16_lo_local, v2f16>;
685 def : DSReadPat_D16<DS_READ_I8_D16, sextloadi8_d16_lo_local, v2i16>;
686 def : DSReadPat_D16<DS_READ_I8_D16, sextloadi8_d16_lo_local, v2f16>;
689 class DSWritePat <DS_Pseudo inst, ValueType vt, PatFrag frag, int gds=0> : GCNPat <
690 (frag vt:$value, (DS1Addr1Offset i32:$ptr, i16:$offset)),
691 (inst $ptr, getVregSrcForVT<vt>.ret:$value, offset:$offset, (i1 gds))
694 multiclass DSWritePat_mc <DS_Pseudo inst, ValueType vt, string frag> {
695 let OtherPredicates = [LDSRequiresM0Init] in {
696 def : DSWritePat<inst, vt, !cast<PatFrag>(frag#"_m0")>;
699 let OtherPredicates = [NotLDSRequiresM0Init] in {
700 def : DSWritePat<!cast<DS_Pseudo>(!cast<string>(inst)#"_gfx9"), vt, !cast<PatFrag>(frag)>;
704 // Irritatingly, atomic_store reverses the order of operands from a
706 class DSAtomicWritePat <DS_Pseudo inst, ValueType vt, PatFrag frag> : GCNPat <
707 (frag (DS1Addr1Offset i32:$ptr, i16:$offset), vt:$value),
708 (inst $ptr, $value, offset:$offset, (i1 0))
711 multiclass DSAtomicWritePat_mc <DS_Pseudo inst, ValueType vt, string frag> {
712 let OtherPredicates = [LDSRequiresM0Init] in {
713 def : DSAtomicWritePat<inst, vt, !cast<PatFrag>(frag#"_m0")>;
716 let OtherPredicates = [NotLDSRequiresM0Init] in {
717 def : DSAtomicWritePat<!cast<DS_Pseudo>(!cast<string>(inst)#"_gfx9"), vt, !cast<PatFrag>(frag)>;
721 defm : DSWritePat_mc <DS_WRITE_B8, i32, "truncstorei8_local">;
722 defm : DSWritePat_mc <DS_WRITE_B16, i32, "truncstorei16_local">;
723 defm : DSWritePat_mc <DS_WRITE_B8, i16, "truncstorei8_local">;
724 defm : DSWritePat_mc <DS_WRITE_B16, i16, "store_local">;
726 foreach vt = VGPR_32.RegTypes in {
727 defm : DSWritePat_mc <DS_WRITE_B32, vt, "store_local">;
730 defm : DSAtomicWritePat_mc <DS_WRITE_B32, i32, "atomic_store_local_32">;
731 defm : DSAtomicWritePat_mc <DS_WRITE_B64, i64, "atomic_store_local_64">;
733 let OtherPredicates = [D16PreservesUnusedBits] in {
734 def : DSWritePat <DS_WRITE_B16_D16_HI, i32, store_local_hi16>;
735 def : DSWritePat <DS_WRITE_B8_D16_HI, i32, truncstorei8_local_hi16>;
739 class DS64Bit4ByteAlignedReadPat<DS_Pseudo inst, PatFrag frag> : GCNPat <
740 (v2i32 (frag (DS64Bit4ByteAligned i32:$ptr, i8:$offset0, i8:$offset1))),
741 (inst $ptr, $offset0, $offset1, (i1 0))
744 class DS64Bit4ByteAlignedWritePat<DS_Pseudo inst, PatFrag frag> : GCNPat<
745 (frag v2i32:$value, (DS64Bit4ByteAligned i32:$ptr, i8:$offset0, i8:$offset1)),
746 (inst $ptr, (i32 (EXTRACT_SUBREG $value, sub0)),
747 (i32 (EXTRACT_SUBREG $value, sub1)), $offset0, $offset1,
751 // v2i32 loads are split into i32 loads on SI during lowering, due to a bug
752 // related to bounds checking.
753 let OtherPredicates = [LDSRequiresM0Init, isGFX7Plus] in {
754 def : DS64Bit4ByteAlignedReadPat<DS_READ2_B32, load_local_m0>;
755 def : DS64Bit4ByteAlignedWritePat<DS_WRITE2_B32, store_local_m0>;
758 let OtherPredicates = [NotLDSRequiresM0Init] in {
759 def : DS64Bit4ByteAlignedReadPat<DS_READ2_B32_gfx9, load_local>;
760 def : DS64Bit4ByteAlignedWritePat<DS_WRITE2_B32_gfx9, store_local>;
764 let AddedComplexity = 100 in {
766 foreach vt = VReg_64.RegTypes in {
767 defm : DSWritePat_mc <DS_WRITE_B64, vt, "store_align8_local">;
770 defm : DSWritePat_mc <DS_WRITE_B128, v4i32, "store_align16_local">;
772 } // End AddedComplexity = 100
773 class DSAtomicRetPat<DS_Pseudo inst, ValueType vt, PatFrag frag, bit gds=0> : GCNPat <
774 (frag (DS1Addr1Offset i32:$ptr, i16:$offset), vt:$value),
775 (inst $ptr, getVregSrcForVT<vt>.ret:$value, offset:$offset, (i1 gds))
778 multiclass DSAtomicRetPat_mc<DS_Pseudo inst, ValueType vt, string frag> {
779 let OtherPredicates = [LDSRequiresM0Init] in {
780 def : DSAtomicRetPat<inst, vt, !cast<PatFrag>(frag#"_local_m0_"#vt.Size)>;
783 let OtherPredicates = [NotLDSRequiresM0Init] in {
784 def : DSAtomicRetPat<!cast<DS_Pseudo>(!cast<string>(inst)#"_gfx9"), vt,
785 !cast<PatFrag>(frag#"_local_"#vt.Size)>;
788 def : DSAtomicRetPat<inst, vt, !cast<PatFrag>(frag#"_region_m0_"#vt.Size), 1>;
793 class DSAtomicCmpXChg<DS_Pseudo inst, ValueType vt, PatFrag frag, bit gds=0> : GCNPat <
794 (frag (DS1Addr1Offset i32:$ptr, i16:$offset), vt:$cmp, vt:$swap),
795 (inst $ptr, getVregSrcForVT<vt>.ret:$cmp, getVregSrcForVT<vt>.ret:$swap, offset:$offset, (i1 gds))
798 multiclass DSAtomicCmpXChg_mc<DS_Pseudo inst, ValueType vt, string frag> {
799 let OtherPredicates = [LDSRequiresM0Init] in {
800 def : DSAtomicCmpXChg<inst, vt, !cast<PatFrag>(frag#"_local_m0_"#vt.Size)>;
803 let OtherPredicates = [NotLDSRequiresM0Init] in {
804 def : DSAtomicCmpXChg<!cast<DS_Pseudo>(!cast<string>(inst)#"_gfx9"), vt,
805 !cast<PatFrag>(frag#"_local_"#vt.Size)>;
808 def : DSAtomicCmpXChg<inst, vt, !cast<PatFrag>(frag#"_region_m0_"#vt.Size), 1>;
814 defm : DSAtomicRetPat_mc<DS_WRXCHG_RTN_B32, i32, "atomic_swap">;
815 defm : DSAtomicRetPat_mc<DS_ADD_RTN_U32, i32, "atomic_load_add">;
816 defm : DSAtomicRetPat_mc<DS_SUB_RTN_U32, i32, "atomic_load_sub">;
817 defm : DSAtomicRetPat_mc<DS_INC_RTN_U32, i32, "atomic_inc">;
818 defm : DSAtomicRetPat_mc<DS_DEC_RTN_U32, i32, "atomic_dec">;
819 defm : DSAtomicRetPat_mc<DS_AND_RTN_B32, i32, "atomic_load_and">;
820 defm : DSAtomicRetPat_mc<DS_OR_RTN_B32, i32, "atomic_load_or">;
821 defm : DSAtomicRetPat_mc<DS_XOR_RTN_B32, i32, "atomic_load_xor">;
822 defm : DSAtomicRetPat_mc<DS_MIN_RTN_I32, i32, "atomic_load_min">;
823 defm : DSAtomicRetPat_mc<DS_MAX_RTN_I32, i32, "atomic_load_max">;
824 defm : DSAtomicRetPat_mc<DS_MIN_RTN_U32, i32, "atomic_load_umin">;
825 defm : DSAtomicRetPat_mc<DS_MAX_RTN_U32, i32, "atomic_load_umax">;
826 defm : DSAtomicCmpXChg_mc<DS_CMPST_RTN_B32, i32, "atomic_cmp_swap">;
827 defm : DSAtomicRetPat_mc<DS_MIN_RTN_F32, f32, "atomic_load_fmin">;
828 defm : DSAtomicRetPat_mc<DS_MAX_RTN_F32, f32, "atomic_load_fmax">;
829 defm : DSAtomicRetPat_mc<DS_ADD_RTN_F32, f32, "atomic_load_fadd">;
832 defm : DSAtomicRetPat_mc<DS_WRXCHG_RTN_B64, i64, "atomic_swap">;
833 defm : DSAtomicRetPat_mc<DS_ADD_RTN_U64, i64, "atomic_load_add">;
834 defm : DSAtomicRetPat_mc<DS_SUB_RTN_U64, i64, "atomic_load_sub">;
835 defm : DSAtomicRetPat_mc<DS_INC_RTN_U64, i64, "atomic_inc">;
836 defm : DSAtomicRetPat_mc<DS_DEC_RTN_U64, i64, "atomic_dec">;
837 defm : DSAtomicRetPat_mc<DS_AND_RTN_B64, i64, "atomic_load_and">;
838 defm : DSAtomicRetPat_mc<DS_OR_RTN_B64, i64, "atomic_load_or">;
839 defm : DSAtomicRetPat_mc<DS_XOR_RTN_B64, i64, "atomic_load_xor">;
840 defm : DSAtomicRetPat_mc<DS_MIN_RTN_I64, i64, "atomic_load_min">;
841 defm : DSAtomicRetPat_mc<DS_MAX_RTN_I64, i64, "atomic_load_max">;
842 defm : DSAtomicRetPat_mc<DS_MIN_RTN_U64, i64, "atomic_load_umin">;
843 defm : DSAtomicRetPat_mc<DS_MAX_RTN_U64, i64, "atomic_load_umax">;
845 defm : DSAtomicCmpXChg_mc<DS_CMPST_RTN_B64, i64, "atomic_cmp_swap">;
848 (SIds_ordered_count i32:$value, i16:$offset),
849 (DS_ORDERED_COUNT $value, (as_i16imm $offset))
852 //===----------------------------------------------------------------------===//
853 // Target-specific instruction encodings.
854 //===----------------------------------------------------------------------===//
856 //===----------------------------------------------------------------------===//
857 // Base ENC_DS for GFX6, GFX7, GFX10.
858 //===----------------------------------------------------------------------===//
860 class Base_DS_Real_gfx6_gfx7_gfx10<bits<8> op, DS_Pseudo ps, int ef> :
861 DS_Real<ps>, SIMCInstr <ps.Mnemonic, ef> {
863 let Inst{7-0} = !if(ps.has_offset0, offset0, 0);
864 let Inst{15-8} = !if(ps.has_offset1, offset1, 0);
865 let Inst{17} = !if(ps.has_gds, gds, ps.gdsValue);
866 let Inst{25-18} = op;
867 let Inst{31-26} = 0x36;
868 let Inst{39-32} = !if(ps.has_addr, addr, !if(ps.has_gws_data0, data0, 0));
869 let Inst{47-40} = !if(ps.has_data0, data0, 0);
870 let Inst{55-48} = !if(ps.has_data1, data1, 0);
871 let Inst{63-56} = !if(ps.has_vdst, vdst, 0);
874 //===----------------------------------------------------------------------===//
876 //===----------------------------------------------------------------------===//
878 let AssemblerPredicate = isGFX10Plus, DecoderNamespace = "GFX10" in {
879 multiclass DS_Real_gfx10<bits<8> op> {
880 def _gfx10 : Base_DS_Real_gfx6_gfx7_gfx10<op, !cast<DS_Pseudo>(NAME),
881 SIEncodingFamily.GFX10>;
883 } // End AssemblerPredicate = isGFX10Plus, DecoderNamespace = "GFX10"
885 defm DS_ADD_F32 : DS_Real_gfx10<0x015>;
886 defm DS_ADD_RTN_F32 : DS_Real_gfx10<0x055>;
887 defm DS_ADD_SRC2_F32 : DS_Real_gfx10<0x095>;
888 defm DS_WRITE_B8_D16_HI : DS_Real_gfx10<0x0a0>;
889 defm DS_WRITE_B16_D16_HI : DS_Real_gfx10<0x0a1>;
890 defm DS_READ_U8_D16 : DS_Real_gfx10<0x0a2>;
891 defm DS_READ_U8_D16_HI : DS_Real_gfx10<0x0a3>;
892 defm DS_READ_I8_D16 : DS_Real_gfx10<0x0a4>;
893 defm DS_READ_I8_D16_HI : DS_Real_gfx10<0x0a5>;
894 defm DS_READ_U16_D16 : DS_Real_gfx10<0x0a6>;
895 defm DS_READ_U16_D16_HI : DS_Real_gfx10<0x0a7>;
896 defm DS_WRITE_ADDTID_B32 : DS_Real_gfx10<0x0b0>;
897 defm DS_READ_ADDTID_B32 : DS_Real_gfx10<0x0b1>;
898 defm DS_PERMUTE_B32 : DS_Real_gfx10<0x0b2>;
899 defm DS_BPERMUTE_B32 : DS_Real_gfx10<0x0b3>;
901 //===----------------------------------------------------------------------===//
903 //===----------------------------------------------------------------------===//
905 let AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7" in {
906 multiclass DS_Real_gfx7<bits<8> op> {
907 def _gfx7 : Base_DS_Real_gfx6_gfx7_gfx10<op, !cast<DS_Pseudo>(NAME),
908 SIEncodingFamily.SI>;
910 } // End AssemblerPredicate = isGFX7Only, DecoderNamespace = "GFX7"
912 multiclass DS_Real_gfx7_gfx10<bits<8> op> :
913 DS_Real_gfx7<op>, DS_Real_gfx10<op>;
915 // FIXME-GFX7: Add tests when upstreaming this part.
916 defm DS_GWS_SEMA_RELEASE_ALL : DS_Real_gfx7_gfx10<0x018>;
917 defm DS_WRAP_RTN_B32 : DS_Real_gfx7_gfx10<0x034>;
918 defm DS_CONDXCHG32_RTN_B64 : DS_Real_gfx7_gfx10<0x07e>;
919 defm DS_WRITE_B96 : DS_Real_gfx7_gfx10<0x0de>;
920 defm DS_WRITE_B128 : DS_Real_gfx7_gfx10<0x0df>;
921 defm DS_READ_B96 : DS_Real_gfx7_gfx10<0x0fe>;
922 defm DS_READ_B128 : DS_Real_gfx7_gfx10<0x0ff>;
924 //===----------------------------------------------------------------------===//
925 // GFX6, GFX7, GFX10.
926 //===----------------------------------------------------------------------===//
928 let AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7" in {
929 multiclass DS_Real_gfx6_gfx7<bits<8> op> {
930 def _gfx6_gfx7 : Base_DS_Real_gfx6_gfx7_gfx10<op, !cast<DS_Pseudo>(NAME),
931 SIEncodingFamily.SI>;
933 } // End AssemblerPredicate = isGFX6GFX7, DecoderNamespace = "GFX6GFX7"
935 multiclass DS_Real_gfx6_gfx7_gfx10<bits<8> op> :
936 DS_Real_gfx6_gfx7<op>, DS_Real_gfx10<op>;
938 defm DS_ADD_U32 : DS_Real_gfx6_gfx7_gfx10<0x000>;
939 defm DS_SUB_U32 : DS_Real_gfx6_gfx7_gfx10<0x001>;
940 defm DS_RSUB_U32 : DS_Real_gfx6_gfx7_gfx10<0x002>;
941 defm DS_INC_U32 : DS_Real_gfx6_gfx7_gfx10<0x003>;
942 defm DS_DEC_U32 : DS_Real_gfx6_gfx7_gfx10<0x004>;
943 defm DS_MIN_I32 : DS_Real_gfx6_gfx7_gfx10<0x005>;
944 defm DS_MAX_I32 : DS_Real_gfx6_gfx7_gfx10<0x006>;
945 defm DS_MIN_U32 : DS_Real_gfx6_gfx7_gfx10<0x007>;
946 defm DS_MAX_U32 : DS_Real_gfx6_gfx7_gfx10<0x008>;
947 defm DS_AND_B32 : DS_Real_gfx6_gfx7_gfx10<0x009>;
948 defm DS_OR_B32 : DS_Real_gfx6_gfx7_gfx10<0x00a>;
949 defm DS_XOR_B32 : DS_Real_gfx6_gfx7_gfx10<0x00b>;
950 defm DS_MSKOR_B32 : DS_Real_gfx6_gfx7_gfx10<0x00c>;
951 defm DS_WRITE_B32 : DS_Real_gfx6_gfx7_gfx10<0x00d>;
952 defm DS_WRITE2_B32 : DS_Real_gfx6_gfx7_gfx10<0x00e>;
953 defm DS_WRITE2ST64_B32 : DS_Real_gfx6_gfx7_gfx10<0x00f>;
954 defm DS_CMPST_B32 : DS_Real_gfx6_gfx7_gfx10<0x010>;
955 defm DS_CMPST_F32 : DS_Real_gfx6_gfx7_gfx10<0x011>;
956 defm DS_MIN_F32 : DS_Real_gfx6_gfx7_gfx10<0x012>;
957 defm DS_MAX_F32 : DS_Real_gfx6_gfx7_gfx10<0x013>;
958 defm DS_NOP : DS_Real_gfx6_gfx7_gfx10<0x014>;
959 defm DS_GWS_INIT : DS_Real_gfx6_gfx7_gfx10<0x019>;
960 defm DS_GWS_SEMA_V : DS_Real_gfx6_gfx7_gfx10<0x01a>;
961 defm DS_GWS_SEMA_BR : DS_Real_gfx6_gfx7_gfx10<0x01b>;
962 defm DS_GWS_SEMA_P : DS_Real_gfx6_gfx7_gfx10<0x01c>;
963 defm DS_GWS_BARRIER : DS_Real_gfx6_gfx7_gfx10<0x01d>;
964 defm DS_WRITE_B8 : DS_Real_gfx6_gfx7_gfx10<0x01e>;
965 defm DS_WRITE_B16 : DS_Real_gfx6_gfx7_gfx10<0x01f>;
966 defm DS_ADD_RTN_U32 : DS_Real_gfx6_gfx7_gfx10<0x020>;
967 defm DS_SUB_RTN_U32 : DS_Real_gfx6_gfx7_gfx10<0x021>;
968 defm DS_RSUB_RTN_U32 : DS_Real_gfx6_gfx7_gfx10<0x022>;
969 defm DS_INC_RTN_U32 : DS_Real_gfx6_gfx7_gfx10<0x023>;
970 defm DS_DEC_RTN_U32 : DS_Real_gfx6_gfx7_gfx10<0x024>;
971 defm DS_MIN_RTN_I32 : DS_Real_gfx6_gfx7_gfx10<0x025>;
972 defm DS_MAX_RTN_I32 : DS_Real_gfx6_gfx7_gfx10<0x026>;
973 defm DS_MIN_RTN_U32 : DS_Real_gfx6_gfx7_gfx10<0x027>;
974 defm DS_MAX_RTN_U32 : DS_Real_gfx6_gfx7_gfx10<0x028>;
975 defm DS_AND_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x029>;
976 defm DS_OR_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x02a>;
977 defm DS_XOR_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x02b>;
978 defm DS_MSKOR_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x02c>;
979 defm DS_WRXCHG_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x02d>;
980 defm DS_WRXCHG2_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x02e>;
981 defm DS_WRXCHG2ST64_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x02f>;
982 defm DS_CMPST_RTN_B32 : DS_Real_gfx6_gfx7_gfx10<0x030>;
983 defm DS_CMPST_RTN_F32 : DS_Real_gfx6_gfx7_gfx10<0x031>;
984 defm DS_MIN_RTN_F32 : DS_Real_gfx6_gfx7_gfx10<0x032>;
985 defm DS_MAX_RTN_F32 : DS_Real_gfx6_gfx7_gfx10<0x033>;
986 defm DS_SWIZZLE_B32 : DS_Real_gfx6_gfx7_gfx10<0x035>;
987 defm DS_READ_B32 : DS_Real_gfx6_gfx7_gfx10<0x036>;
988 defm DS_READ2_B32 : DS_Real_gfx6_gfx7_gfx10<0x037>;
989 defm DS_READ2ST64_B32 : DS_Real_gfx6_gfx7_gfx10<0x038>;
990 defm DS_READ_I8 : DS_Real_gfx6_gfx7_gfx10<0x039>;
991 defm DS_READ_U8 : DS_Real_gfx6_gfx7_gfx10<0x03a>;
992 defm DS_READ_I16 : DS_Real_gfx6_gfx7_gfx10<0x03b>;
993 defm DS_READ_U16 : DS_Real_gfx6_gfx7_gfx10<0x03c>;
994 defm DS_CONSUME : DS_Real_gfx6_gfx7_gfx10<0x03d>;
995 defm DS_APPEND : DS_Real_gfx6_gfx7_gfx10<0x03e>;
996 defm DS_ORDERED_COUNT : DS_Real_gfx6_gfx7_gfx10<0x03f>;
997 defm DS_ADD_U64 : DS_Real_gfx6_gfx7_gfx10<0x040>;
998 defm DS_SUB_U64 : DS_Real_gfx6_gfx7_gfx10<0x041>;
999 defm DS_RSUB_U64 : DS_Real_gfx6_gfx7_gfx10<0x042>;
1000 defm DS_INC_U64 : DS_Real_gfx6_gfx7_gfx10<0x043>;
1001 defm DS_DEC_U64 : DS_Real_gfx6_gfx7_gfx10<0x044>;
1002 defm DS_MIN_I64 : DS_Real_gfx6_gfx7_gfx10<0x045>;
1003 defm DS_MAX_I64 : DS_Real_gfx6_gfx7_gfx10<0x046>;
1004 defm DS_MIN_U64 : DS_Real_gfx6_gfx7_gfx10<0x047>;
1005 defm DS_MAX_U64 : DS_Real_gfx6_gfx7_gfx10<0x048>;
1006 defm DS_AND_B64 : DS_Real_gfx6_gfx7_gfx10<0x049>;
1007 defm DS_OR_B64 : DS_Real_gfx6_gfx7_gfx10<0x04a>;
1008 defm DS_XOR_B64 : DS_Real_gfx6_gfx7_gfx10<0x04b>;
1009 defm DS_MSKOR_B64 : DS_Real_gfx6_gfx7_gfx10<0x04c>;
1010 defm DS_WRITE_B64 : DS_Real_gfx6_gfx7_gfx10<0x04d>;
1011 defm DS_WRITE2_B64 : DS_Real_gfx6_gfx7_gfx10<0x04e>;
1012 defm DS_WRITE2ST64_B64 : DS_Real_gfx6_gfx7_gfx10<0x04f>;
1013 defm DS_CMPST_B64 : DS_Real_gfx6_gfx7_gfx10<0x050>;
1014 defm DS_CMPST_F64 : DS_Real_gfx6_gfx7_gfx10<0x051>;
1015 defm DS_MIN_F64 : DS_Real_gfx6_gfx7_gfx10<0x052>;
1016 defm DS_MAX_F64 : DS_Real_gfx6_gfx7_gfx10<0x053>;
1017 defm DS_ADD_RTN_U64 : DS_Real_gfx6_gfx7_gfx10<0x060>;
1018 defm DS_SUB_RTN_U64 : DS_Real_gfx6_gfx7_gfx10<0x061>;
1019 defm DS_RSUB_RTN_U64 : DS_Real_gfx6_gfx7_gfx10<0x062>;
1020 defm DS_INC_RTN_U64 : DS_Real_gfx6_gfx7_gfx10<0x063>;
1021 defm DS_DEC_RTN_U64 : DS_Real_gfx6_gfx7_gfx10<0x064>;
1022 defm DS_MIN_RTN_I64 : DS_Real_gfx6_gfx7_gfx10<0x065>;
1023 defm DS_MAX_RTN_I64 : DS_Real_gfx6_gfx7_gfx10<0x066>;
1024 defm DS_MIN_RTN_U64 : DS_Real_gfx6_gfx7_gfx10<0x067>;
1025 defm DS_MAX_RTN_U64 : DS_Real_gfx6_gfx7_gfx10<0x068>;
1026 defm DS_AND_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x069>;
1027 defm DS_OR_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x06a>;
1028 defm DS_XOR_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x06b>;
1029 defm DS_MSKOR_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x06c>;
1030 defm DS_WRXCHG_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x06d>;
1031 defm DS_WRXCHG2_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x06e>;
1032 defm DS_WRXCHG2ST64_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x06f>;
1033 defm DS_CMPST_RTN_B64 : DS_Real_gfx6_gfx7_gfx10<0x070>;
1034 defm DS_CMPST_RTN_F64 : DS_Real_gfx6_gfx7_gfx10<0x071>;
1035 defm DS_MIN_RTN_F64 : DS_Real_gfx6_gfx7_gfx10<0x072>;
1036 defm DS_MAX_RTN_F64 : DS_Real_gfx6_gfx7_gfx10<0x073>;
1037 defm DS_READ_B64 : DS_Real_gfx6_gfx7_gfx10<0x076>;
1038 defm DS_READ2_B64 : DS_Real_gfx6_gfx7_gfx10<0x077>;
1039 defm DS_READ2ST64_B64 : DS_Real_gfx6_gfx7_gfx10<0x078>;
1040 defm DS_ADD_SRC2_U32 : DS_Real_gfx6_gfx7_gfx10<0x080>;
1041 defm DS_SUB_SRC2_U32 : DS_Real_gfx6_gfx7_gfx10<0x081>;
1042 defm DS_RSUB_SRC2_U32 : DS_Real_gfx6_gfx7_gfx10<0x082>;
1043 defm DS_INC_SRC2_U32 : DS_Real_gfx6_gfx7_gfx10<0x083>;
1044 defm DS_DEC_SRC2_U32 : DS_Real_gfx6_gfx7_gfx10<0x084>;
1045 defm DS_MIN_SRC2_I32 : DS_Real_gfx6_gfx7_gfx10<0x085>;
1046 defm DS_MAX_SRC2_I32 : DS_Real_gfx6_gfx7_gfx10<0x086>;
1047 defm DS_MIN_SRC2_U32 : DS_Real_gfx6_gfx7_gfx10<0x087>;
1048 defm DS_MAX_SRC2_U32 : DS_Real_gfx6_gfx7_gfx10<0x088>;
1049 defm DS_AND_SRC2_B32 : DS_Real_gfx6_gfx7_gfx10<0x089>;
1050 defm DS_OR_SRC2_B32 : DS_Real_gfx6_gfx7_gfx10<0x08a>;
1051 defm DS_XOR_SRC2_B32 : DS_Real_gfx6_gfx7_gfx10<0x08b>;
1052 defm DS_WRITE_SRC2_B32 : DS_Real_gfx6_gfx7_gfx10<0x08d>;
1053 defm DS_MIN_SRC2_F32 : DS_Real_gfx6_gfx7_gfx10<0x092>;
1054 defm DS_MAX_SRC2_F32 : DS_Real_gfx6_gfx7_gfx10<0x093>;
1055 defm DS_ADD_SRC2_U64 : DS_Real_gfx6_gfx7_gfx10<0x0c0>;
1056 defm DS_SUB_SRC2_U64 : DS_Real_gfx6_gfx7_gfx10<0x0c1>;
1057 defm DS_RSUB_SRC2_U64 : DS_Real_gfx6_gfx7_gfx10<0x0c2>;
1058 defm DS_INC_SRC2_U64 : DS_Real_gfx6_gfx7_gfx10<0x0c3>;
1059 defm DS_DEC_SRC2_U64 : DS_Real_gfx6_gfx7_gfx10<0x0c4>;
1060 defm DS_MIN_SRC2_I64 : DS_Real_gfx6_gfx7_gfx10<0x0c5>;
1061 defm DS_MAX_SRC2_I64 : DS_Real_gfx6_gfx7_gfx10<0x0c6>;
1062 defm DS_MIN_SRC2_U64 : DS_Real_gfx6_gfx7_gfx10<0x0c7>;
1063 defm DS_MAX_SRC2_U64 : DS_Real_gfx6_gfx7_gfx10<0x0c8>;
1064 defm DS_AND_SRC2_B64 : DS_Real_gfx6_gfx7_gfx10<0x0c9>;
1065 defm DS_OR_SRC2_B64 : DS_Real_gfx6_gfx7_gfx10<0x0ca>;
1066 defm DS_XOR_SRC2_B64 : DS_Real_gfx6_gfx7_gfx10<0x0cb>;
1067 defm DS_WRITE_SRC2_B64 : DS_Real_gfx6_gfx7_gfx10<0x0cd>;
1068 defm DS_MIN_SRC2_F64 : DS_Real_gfx6_gfx7_gfx10<0x0d2>;
1069 defm DS_MAX_SRC2_F64 : DS_Real_gfx6_gfx7_gfx10<0x0d3>;
1071 //===----------------------------------------------------------------------===//
1073 //===----------------------------------------------------------------------===//
1075 class DS_Real_vi <bits<8> op, DS_Pseudo ds> :
1077 SIMCInstr <ds.Mnemonic, SIEncodingFamily.VI> {
1078 let AssemblerPredicates = [isGFX8GFX9];
1079 let DecoderNamespace = "GFX8";
1082 let Inst{7-0} = !if(ds.has_offset0, offset0, 0);
1083 let Inst{15-8} = !if(ds.has_offset1, offset1, 0);
1084 let Inst{16} = !if(ds.has_gds, gds, ds.gdsValue);
1085 let Inst{24-17} = op;
1086 let Inst{31-26} = 0x36; // ds prefix
1087 let Inst{39-32} = !if(ds.has_addr, addr, !if(ds.has_gws_data0, data0, 0));
1088 let Inst{47-40} = !if(ds.has_data0, data0, 0);
1089 let Inst{55-48} = !if(ds.has_data1, data1, 0);
1090 let Inst{63-56} = !if(ds.has_vdst, vdst, 0);
1093 def DS_ADD_U32_vi : DS_Real_vi<0x0, DS_ADD_U32>;
1094 def DS_SUB_U32_vi : DS_Real_vi<0x1, DS_SUB_U32>;
1095 def DS_RSUB_U32_vi : DS_Real_vi<0x2, DS_RSUB_U32>;
1096 def DS_INC_U32_vi : DS_Real_vi<0x3, DS_INC_U32>;
1097 def DS_DEC_U32_vi : DS_Real_vi<0x4, DS_DEC_U32>;
1098 def DS_MIN_I32_vi : DS_Real_vi<0x5, DS_MIN_I32>;
1099 def DS_MAX_I32_vi : DS_Real_vi<0x6, DS_MAX_I32>;
1100 def DS_MIN_U32_vi : DS_Real_vi<0x7, DS_MIN_U32>;
1101 def DS_MAX_U32_vi : DS_Real_vi<0x8, DS_MAX_U32>;
1102 def DS_AND_B32_vi : DS_Real_vi<0x9, DS_AND_B32>;
1103 def DS_OR_B32_vi : DS_Real_vi<0xa, DS_OR_B32>;
1104 def DS_XOR_B32_vi : DS_Real_vi<0xb, DS_XOR_B32>;
1105 def DS_MSKOR_B32_vi : DS_Real_vi<0xc, DS_MSKOR_B32>;
1106 def DS_WRITE_B32_vi : DS_Real_vi<0xd, DS_WRITE_B32>;
1107 def DS_WRITE2_B32_vi : DS_Real_vi<0xe, DS_WRITE2_B32>;
1108 def DS_WRITE2ST64_B32_vi : DS_Real_vi<0xf, DS_WRITE2ST64_B32>;
1109 def DS_CMPST_B32_vi : DS_Real_vi<0x10, DS_CMPST_B32>;
1110 def DS_CMPST_F32_vi : DS_Real_vi<0x11, DS_CMPST_F32>;
1111 def DS_MIN_F32_vi : DS_Real_vi<0x12, DS_MIN_F32>;
1112 def DS_MAX_F32_vi : DS_Real_vi<0x13, DS_MAX_F32>;
1113 def DS_NOP_vi : DS_Real_vi<0x14, DS_NOP>;
1114 def DS_ADD_F32_vi : DS_Real_vi<0x15, DS_ADD_F32>;
1115 def DS_GWS_INIT_vi : DS_Real_vi<0x99, DS_GWS_INIT>;
1116 def DS_GWS_SEMA_V_vi : DS_Real_vi<0x9a, DS_GWS_SEMA_V>;
1117 def DS_GWS_SEMA_BR_vi : DS_Real_vi<0x9b, DS_GWS_SEMA_BR>;
1118 def DS_GWS_SEMA_P_vi : DS_Real_vi<0x9c, DS_GWS_SEMA_P>;
1119 def DS_GWS_BARRIER_vi : DS_Real_vi<0x9d, DS_GWS_BARRIER>;
1120 def DS_WRITE_ADDTID_B32_vi : DS_Real_vi<0x1d, DS_WRITE_ADDTID_B32>;
1121 def DS_WRITE_B8_vi : DS_Real_vi<0x1e, DS_WRITE_B8>;
1122 def DS_WRITE_B16_vi : DS_Real_vi<0x1f, DS_WRITE_B16>;
1123 def DS_ADD_RTN_U32_vi : DS_Real_vi<0x20, DS_ADD_RTN_U32>;
1124 def DS_SUB_RTN_U32_vi : DS_Real_vi<0x21, DS_SUB_RTN_U32>;
1125 def DS_RSUB_RTN_U32_vi : DS_Real_vi<0x22, DS_RSUB_RTN_U32>;
1126 def DS_INC_RTN_U32_vi : DS_Real_vi<0x23, DS_INC_RTN_U32>;
1127 def DS_DEC_RTN_U32_vi : DS_Real_vi<0x24, DS_DEC_RTN_U32>;
1128 def DS_MIN_RTN_I32_vi : DS_Real_vi<0x25, DS_MIN_RTN_I32>;
1129 def DS_MAX_RTN_I32_vi : DS_Real_vi<0x26, DS_MAX_RTN_I32>;
1130 def DS_MIN_RTN_U32_vi : DS_Real_vi<0x27, DS_MIN_RTN_U32>;
1131 def DS_MAX_RTN_U32_vi : DS_Real_vi<0x28, DS_MAX_RTN_U32>;
1132 def DS_AND_RTN_B32_vi : DS_Real_vi<0x29, DS_AND_RTN_B32>;
1133 def DS_OR_RTN_B32_vi : DS_Real_vi<0x2a, DS_OR_RTN_B32>;
1134 def DS_XOR_RTN_B32_vi : DS_Real_vi<0x2b, DS_XOR_RTN_B32>;
1135 def DS_MSKOR_RTN_B32_vi : DS_Real_vi<0x2c, DS_MSKOR_RTN_B32>;
1136 def DS_WRXCHG_RTN_B32_vi : DS_Real_vi<0x2d, DS_WRXCHG_RTN_B32>;
1137 def DS_WRXCHG2_RTN_B32_vi : DS_Real_vi<0x2e, DS_WRXCHG2_RTN_B32>;
1138 def DS_WRXCHG2ST64_RTN_B32_vi : DS_Real_vi<0x2f, DS_WRXCHG2ST64_RTN_B32>;
1139 def DS_CMPST_RTN_B32_vi : DS_Real_vi<0x30, DS_CMPST_RTN_B32>;
1140 def DS_CMPST_RTN_F32_vi : DS_Real_vi<0x31, DS_CMPST_RTN_F32>;
1141 def DS_MIN_RTN_F32_vi : DS_Real_vi<0x32, DS_MIN_RTN_F32>;
1142 def DS_MAX_RTN_F32_vi : DS_Real_vi<0x33, DS_MAX_RTN_F32>;
1143 def DS_WRAP_RTN_B32_vi : DS_Real_vi<0x34, DS_WRAP_RTN_B32>;
1144 def DS_ADD_RTN_F32_vi : DS_Real_vi<0x35, DS_ADD_RTN_F32>;
1145 def DS_READ_B32_vi : DS_Real_vi<0x36, DS_READ_B32>;
1146 def DS_READ2_B32_vi : DS_Real_vi<0x37, DS_READ2_B32>;
1147 def DS_READ2ST64_B32_vi : DS_Real_vi<0x38, DS_READ2ST64_B32>;
1148 def DS_READ_I8_vi : DS_Real_vi<0x39, DS_READ_I8>;
1149 def DS_READ_U8_vi : DS_Real_vi<0x3a, DS_READ_U8>;
1150 def DS_READ_I16_vi : DS_Real_vi<0x3b, DS_READ_I16>;
1151 def DS_READ_U16_vi : DS_Real_vi<0x3c, DS_READ_U16>;
1152 def DS_READ_ADDTID_B32_vi : DS_Real_vi<0xb6, DS_READ_ADDTID_B32>;
1153 def DS_CONSUME_vi : DS_Real_vi<0xbd, DS_CONSUME>;
1154 def DS_APPEND_vi : DS_Real_vi<0xbe, DS_APPEND>;
1155 def DS_ORDERED_COUNT_vi : DS_Real_vi<0xbf, DS_ORDERED_COUNT>;
1156 def DS_SWIZZLE_B32_vi : DS_Real_vi<0x3d, DS_SWIZZLE_B32>;
1157 def DS_PERMUTE_B32_vi : DS_Real_vi<0x3e, DS_PERMUTE_B32>;
1158 def DS_BPERMUTE_B32_vi : DS_Real_vi<0x3f, DS_BPERMUTE_B32>;
1160 def DS_ADD_U64_vi : DS_Real_vi<0x40, DS_ADD_U64>;
1161 def DS_SUB_U64_vi : DS_Real_vi<0x41, DS_SUB_U64>;
1162 def DS_RSUB_U64_vi : DS_Real_vi<0x42, DS_RSUB_U64>;
1163 def DS_INC_U64_vi : DS_Real_vi<0x43, DS_INC_U64>;
1164 def DS_DEC_U64_vi : DS_Real_vi<0x44, DS_DEC_U64>;
1165 def DS_MIN_I64_vi : DS_Real_vi<0x45, DS_MIN_I64>;
1166 def DS_MAX_I64_vi : DS_Real_vi<0x46, DS_MAX_I64>;
1167 def DS_MIN_U64_vi : DS_Real_vi<0x47, DS_MIN_U64>;
1168 def DS_MAX_U64_vi : DS_Real_vi<0x48, DS_MAX_U64>;
1169 def DS_AND_B64_vi : DS_Real_vi<0x49, DS_AND_B64>;
1170 def DS_OR_B64_vi : DS_Real_vi<0x4a, DS_OR_B64>;
1171 def DS_XOR_B64_vi : DS_Real_vi<0x4b, DS_XOR_B64>;
1172 def DS_MSKOR_B64_vi : DS_Real_vi<0x4c, DS_MSKOR_B64>;
1173 def DS_WRITE_B64_vi : DS_Real_vi<0x4d, DS_WRITE_B64>;
1174 def DS_WRITE2_B64_vi : DS_Real_vi<0x4E, DS_WRITE2_B64>;
1175 def DS_WRITE2ST64_B64_vi : DS_Real_vi<0x4f, DS_WRITE2ST64_B64>;
1176 def DS_CMPST_B64_vi : DS_Real_vi<0x50, DS_CMPST_B64>;
1177 def DS_CMPST_F64_vi : DS_Real_vi<0x51, DS_CMPST_F64>;
1178 def DS_MIN_F64_vi : DS_Real_vi<0x52, DS_MIN_F64>;
1179 def DS_MAX_F64_vi : DS_Real_vi<0x53, DS_MAX_F64>;
1181 def DS_WRITE_B8_D16_HI_vi : DS_Real_vi<0x54, DS_WRITE_B8_D16_HI>;
1182 def DS_WRITE_B16_D16_HI_vi : DS_Real_vi<0x55, DS_WRITE_B16_D16_HI>;
1184 def DS_READ_U8_D16_vi : DS_Real_vi<0x56, DS_READ_U8_D16>;
1185 def DS_READ_U8_D16_HI_vi : DS_Real_vi<0x57, DS_READ_U8_D16_HI>;
1186 def DS_READ_I8_D16_vi : DS_Real_vi<0x58, DS_READ_I8_D16>;
1187 def DS_READ_I8_D16_HI_vi : DS_Real_vi<0x59, DS_READ_I8_D16_HI>;
1188 def DS_READ_U16_D16_vi : DS_Real_vi<0x5a, DS_READ_U16_D16>;
1189 def DS_READ_U16_D16_HI_vi : DS_Real_vi<0x5b, DS_READ_U16_D16_HI>;
1191 def DS_ADD_RTN_U64_vi : DS_Real_vi<0x60, DS_ADD_RTN_U64>;
1192 def DS_SUB_RTN_U64_vi : DS_Real_vi<0x61, DS_SUB_RTN_U64>;
1193 def DS_RSUB_RTN_U64_vi : DS_Real_vi<0x62, DS_RSUB_RTN_U64>;
1194 def DS_INC_RTN_U64_vi : DS_Real_vi<0x63, DS_INC_RTN_U64>;
1195 def DS_DEC_RTN_U64_vi : DS_Real_vi<0x64, DS_DEC_RTN_U64>;
1196 def DS_MIN_RTN_I64_vi : DS_Real_vi<0x65, DS_MIN_RTN_I64>;
1197 def DS_MAX_RTN_I64_vi : DS_Real_vi<0x66, DS_MAX_RTN_I64>;
1198 def DS_MIN_RTN_U64_vi : DS_Real_vi<0x67, DS_MIN_RTN_U64>;
1199 def DS_MAX_RTN_U64_vi : DS_Real_vi<0x68, DS_MAX_RTN_U64>;
1200 def DS_AND_RTN_B64_vi : DS_Real_vi<0x69, DS_AND_RTN_B64>;
1201 def DS_OR_RTN_B64_vi : DS_Real_vi<0x6a, DS_OR_RTN_B64>;
1202 def DS_XOR_RTN_B64_vi : DS_Real_vi<0x6b, DS_XOR_RTN_B64>;
1203 def DS_MSKOR_RTN_B64_vi : DS_Real_vi<0x6c, DS_MSKOR_RTN_B64>;
1204 def DS_WRXCHG_RTN_B64_vi : DS_Real_vi<0x6d, DS_WRXCHG_RTN_B64>;
1205 def DS_WRXCHG2_RTN_B64_vi : DS_Real_vi<0x6e, DS_WRXCHG2_RTN_B64>;
1206 def DS_WRXCHG2ST64_RTN_B64_vi : DS_Real_vi<0x6f, DS_WRXCHG2ST64_RTN_B64>;
1207 def DS_CONDXCHG32_RTN_B64_vi : DS_Real_vi<0x7e, DS_CONDXCHG32_RTN_B64>;
1208 def DS_GWS_SEMA_RELEASE_ALL_vi : DS_Real_vi<0x98, DS_GWS_SEMA_RELEASE_ALL>;
1209 def DS_CMPST_RTN_B64_vi : DS_Real_vi<0x70, DS_CMPST_RTN_B64>;
1210 def DS_CMPST_RTN_F64_vi : DS_Real_vi<0x71, DS_CMPST_RTN_F64>;
1211 def DS_MIN_RTN_F64_vi : DS_Real_vi<0x72, DS_MIN_RTN_F64>;
1212 def DS_MAX_RTN_F64_vi : DS_Real_vi<0x73, DS_MAX_RTN_F64>;
1214 def DS_READ_B64_vi : DS_Real_vi<0x76, DS_READ_B64>;
1215 def DS_READ2_B64_vi : DS_Real_vi<0x77, DS_READ2_B64>;
1216 def DS_READ2ST64_B64_vi : DS_Real_vi<0x78, DS_READ2ST64_B64>;
1218 def DS_ADD_SRC2_U32_vi : DS_Real_vi<0x80, DS_ADD_SRC2_U32>;
1219 def DS_SUB_SRC2_U32_vi : DS_Real_vi<0x81, DS_SUB_SRC2_U32>;
1220 def DS_RSUB_SRC2_U32_vi : DS_Real_vi<0x82, DS_RSUB_SRC2_U32>;
1221 def DS_INC_SRC2_U32_vi : DS_Real_vi<0x83, DS_INC_SRC2_U32>;
1222 def DS_DEC_SRC2_U32_vi : DS_Real_vi<0x84, DS_DEC_SRC2_U32>;
1223 def DS_MIN_SRC2_I32_vi : DS_Real_vi<0x85, DS_MIN_SRC2_I32>;
1224 def DS_MAX_SRC2_I32_vi : DS_Real_vi<0x86, DS_MAX_SRC2_I32>;
1225 def DS_MIN_SRC2_U32_vi : DS_Real_vi<0x87, DS_MIN_SRC2_U32>;
1226 def DS_MAX_SRC2_U32_vi : DS_Real_vi<0x88, DS_MAX_SRC2_U32>;
1227 def DS_AND_SRC2_B32_vi : DS_Real_vi<0x89, DS_AND_SRC2_B32>;
1228 def DS_OR_SRC2_B32_vi : DS_Real_vi<0x8a, DS_OR_SRC2_B32>;
1229 def DS_XOR_SRC2_B32_vi : DS_Real_vi<0x8b, DS_XOR_SRC2_B32>;
1230 def DS_WRITE_SRC2_B32_vi : DS_Real_vi<0x8d, DS_WRITE_SRC2_B32>;
1231 def DS_MIN_SRC2_F32_vi : DS_Real_vi<0x92, DS_MIN_SRC2_F32>;
1232 def DS_MAX_SRC2_F32_vi : DS_Real_vi<0x93, DS_MAX_SRC2_F32>;
1233 def DS_ADD_SRC2_F32_vi : DS_Real_vi<0x95, DS_ADD_SRC2_F32>;
1234 def DS_ADD_SRC2_U64_vi : DS_Real_vi<0xc0, DS_ADD_SRC2_U64>;
1235 def DS_SUB_SRC2_U64_vi : DS_Real_vi<0xc1, DS_SUB_SRC2_U64>;
1236 def DS_RSUB_SRC2_U64_vi : DS_Real_vi<0xc2, DS_RSUB_SRC2_U64>;
1237 def DS_INC_SRC2_U64_vi : DS_Real_vi<0xc3, DS_INC_SRC2_U64>;
1238 def DS_DEC_SRC2_U64_vi : DS_Real_vi<0xc4, DS_DEC_SRC2_U64>;
1239 def DS_MIN_SRC2_I64_vi : DS_Real_vi<0xc5, DS_MIN_SRC2_I64>;
1240 def DS_MAX_SRC2_I64_vi : DS_Real_vi<0xc6, DS_MAX_SRC2_I64>;
1241 def DS_MIN_SRC2_U64_vi : DS_Real_vi<0xc7, DS_MIN_SRC2_U64>;
1242 def DS_MAX_SRC2_U64_vi : DS_Real_vi<0xc8, DS_MAX_SRC2_U64>;
1243 def DS_AND_SRC2_B64_vi : DS_Real_vi<0xc9, DS_AND_SRC2_B64>;
1244 def DS_OR_SRC2_B64_vi : DS_Real_vi<0xca, DS_OR_SRC2_B64>;
1245 def DS_XOR_SRC2_B64_vi : DS_Real_vi<0xcb, DS_XOR_SRC2_B64>;
1246 def DS_WRITE_SRC2_B64_vi : DS_Real_vi<0xcd, DS_WRITE_SRC2_B64>;
1247 def DS_MIN_SRC2_F64_vi : DS_Real_vi<0xd2, DS_MIN_SRC2_F64>;
1248 def DS_MAX_SRC2_F64_vi : DS_Real_vi<0xd3, DS_MAX_SRC2_F64>;
1249 def DS_WRITE_B96_vi : DS_Real_vi<0xde, DS_WRITE_B96>;
1250 def DS_WRITE_B128_vi : DS_Real_vi<0xdf, DS_WRITE_B128>;
1251 def DS_READ_B96_vi : DS_Real_vi<0xfe, DS_READ_B96>;
1252 def DS_READ_B128_vi : DS_Real_vi<0xff, DS_READ_B128>;