@@ -272,13 +272,13 @@ class MIMGNSAHelper<int num_addrs,
272
272
!if(!le(num_addrs, 13), 3, ?))));
273
273
}
274
274
275
- class PartialNSAHelper<int num_addrs, int max_addr, RegisterClass LastAddrRC>
275
+ class PartialNSAHelper<int num_addrs, int max_addr, RegisterOperand LastAddrRC>
276
276
: NSAHelper<> {
277
277
278
- list<RegisterClass > addr_types =
278
+ list<RegisterOperand > addr_types =
279
279
!if(!ge(num_addrs, max_addr),
280
- !listconcat(!listsplat(VGPR_32 , !sub(max_addr, 1)), [LastAddrRC]),
281
- !listsplat(VGPR_32 , num_addrs));
280
+ !listconcat(!listsplat(VGPROp_32 , !sub(max_addr, 1)), [LastAddrRC]),
281
+ !listsplat(VGPROp_32 , num_addrs));
282
282
283
283
int VAddrCount = !if(!gt(num_addrs, max_addr), max_addr, num_addrs);
284
284
list<string> AddrAsmNames = !foreach(i, !range(VAddrCount), "vaddr" # i);
@@ -359,7 +359,7 @@ class MIMG_gfx11<int op, dag outs, string dns = "">
359
359
// Note that 1-dword addresses always use non-NSA variants.
360
360
class MIMG_nsa_gfx11<int op, dag outs, int num_addrs, string dns="",
361
361
list<RegisterClass> addr_types=[],
362
- RegisterClass LastAddrRC = VGPR_32 >
362
+ RegisterOperand LastAddrRC = VGPROp_32 >
363
363
: MIMG<outs, dns>, MIMGe_gfx11<op> {
364
364
let SubtargetPredicate = isGFX11Only;
365
365
let AssemblerPredicate = isGFX11Only;
@@ -400,7 +400,7 @@ class VIMAGE_gfx12<int op, dag outs, int num_addrs, string dns="",
400
400
}
401
401
402
402
class VSAMPLE_gfx12<int op, dag outs, int num_addrs, string dns="",
403
- RegisterClass Addr3RC>
403
+ RegisterOperand Addr3RC>
404
404
: VSAMPLE<outs, dns>, VSAMPLEe<op> {
405
405
let SubtargetPredicate = isGFX12Plus;
406
406
let AssemblerPredicate = isGFX12Plus;
@@ -421,7 +421,7 @@ class VSAMPLE_gfx12<int op, dag outs, int num_addrs, string dns="",
421
421
422
422
class MIMG_NoSampler_Helper <mimgopc op, string asm,
423
423
RegisterOperand dst_rc,
424
- RegisterClass addr_rc,
424
+ RegisterOperand addr_rc,
425
425
string dns="">
426
426
: MIMG_gfx6789 <op.GFX10M, (outs dst_rc:$vdata), dns> {
427
427
let InOperandList = !con((ins addr_rc:$vaddr, SReg_256_XNULL:$srsrc,
@@ -434,10 +434,10 @@ class MIMG_NoSampler_Helper <mimgopc op, string asm,
434
434
435
435
class MIMG_NoSampler_Helper_gfx90a <mimgopc op, string asm,
436
436
RegisterOperand dst_rc,
437
- RegisterClass addr_rc,
437
+ RegisterOperand addr_rc,
438
438
string dns="">
439
439
: MIMG_gfx90a <op.GFX10M, (outs getAlign2RegOp<dst_rc>.ret:$vdata), dns> {
440
- let InOperandList = !con((ins addr_rc:$vaddr, SReg_256_XNULL:$srsrc,
440
+ let InOperandList = !con((ins getAlign2RegOp< addr_rc>.ret :$vaddr, SReg_256_XNULL:$srsrc,
441
441
DMask:$dmask, UNorm:$unorm, CPol:$cpol,
442
442
R128A16:$r128, LWE:$lwe, DA:$da),
443
443
!if(BaseOpcode.HasD16, (ins D16:$d16), (ins)));
@@ -446,7 +446,7 @@ class MIMG_NoSampler_Helper_gfx90a <mimgopc op, string asm,
446
446
}
447
447
448
448
class MIMG_NoSampler_gfx10<mimgopc op, string opcode,
449
- RegisterOperand DataRC, RegisterClass AddrRC,
449
+ RegisterOperand DataRC, RegisterOperand AddrRC,
450
450
string dns="">
451
451
: MIMG_gfx10<op.GFX10M, (outs DataRC:$vdata), dns> {
452
452
let InOperandList = !con((ins AddrRC:$vaddr0, SReg_256_XNULL:$srsrc, DMask:$dmask,
@@ -471,7 +471,7 @@ class MIMG_NoSampler_nsa_gfx10<mimgopc op, string opcode,
471
471
}
472
472
473
473
class MIMG_NoSampler_gfx11<mimgopc op, string opcode,
474
- RegisterOperand DataRC, RegisterClass AddrRC,
474
+ RegisterOperand DataRC, RegisterOperand AddrRC,
475
475
string dns="">
476
476
: MIMG_gfx11<op.GFX11, (outs DataRC:$vdata), dns> {
477
477
let InOperandList = !con((ins AddrRC:$vaddr0, SReg_256_XNULL:$srsrc, DMask:$dmask,
@@ -508,7 +508,7 @@ class VIMAGE_NoSampler_gfx12<mimgopc op, string opcode,
508
508
}
509
509
510
510
class VSAMPLE_Sampler_gfx12<mimgopc op, string opcode, RegisterOperand DataRC,
511
- int num_addrs, RegisterClass Addr3RC = VGPR_32 ,
511
+ int num_addrs, RegisterOperand Addr3RC = VGPROp_32 ,
512
512
string dns="">
513
513
: VSAMPLE_gfx12<op.GFX12, (outs DataRC:$vdata), num_addrs, dns, Addr3RC> {
514
514
let InOperandList = !con(AddrIns,
@@ -525,7 +525,7 @@ class VSAMPLE_Sampler_gfx12<mimgopc op, string opcode, RegisterOperand DataRC,
525
525
}
526
526
527
527
class VSAMPLE_Sampler_nortn_gfx12<mimgopc op, string opcode,
528
- int num_addrs, RegisterClass Addr3RC = VGPR_32 ,
528
+ int num_addrs, RegisterOperand Addr3RC = VGPROp_32 ,
529
529
string dns="">
530
530
: VSAMPLE_gfx12<op.GFX12, (outs), num_addrs, dns, Addr3RC> {
531
531
let InOperandList = !con(AddrIns,
@@ -550,16 +550,16 @@ multiclass MIMG_NoSampler_Src_Helper <mimgopc op, string asm,
550
550
let VAddrDwords = 1 in {
551
551
let ssamp = 0 in {
552
552
if op.HAS_GFX10M then {
553
- def _V1 : MIMG_NoSampler_Helper <op, asm, dst_rc, VGPR_32 ,
553
+ def _V1 : MIMG_NoSampler_Helper <op, asm, dst_rc, VGPROp_32 ,
554
554
!if(enableDisasm, "GFX8", "")>;
555
555
if !not(ExtendedImageInst) then
556
- def _V1_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VGPR_32 ,
556
+ def _V1_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VGPROp_32 ,
557
557
!if(enableDisasm, "GFX90A", "")>;
558
- def _V1_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VGPR_32 ,
558
+ def _V1_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VGPROp_32 ,
559
559
!if(enableDisasm, "GFX10", "")>;
560
560
}
561
561
if op.HAS_GFX11 then {
562
- def _V1_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VGPR_32 ,
562
+ def _V1_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VGPROp_32 ,
563
563
!if(enableDisasm, "GFX11", "")>;
564
564
}
565
565
}
@@ -576,14 +576,14 @@ multiclass MIMG_NoSampler_Src_Helper <mimgopc op, string asm,
576
576
let VAddrDwords = 2 in {
577
577
let ssamp = 0 in {
578
578
if op.HAS_GFX10M then {
579
- def _V2 : MIMG_NoSampler_Helper <op, asm, dst_rc, VReg_64 >;
579
+ def _V2 : MIMG_NoSampler_Helper <op, asm, dst_rc, VGPROp_64 >;
580
580
if !not(ExtendedImageInst) then
581
- def _V2_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VReg_64_Align2 >;
582
- def _V2_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VReg_64 >;
581
+ def _V2_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VGPROp_64_Align2 >;
582
+ def _V2_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VGPROp_64 >;
583
583
def _V2_nsa_gfx10 : MIMG_NoSampler_nsa_gfx10<op, asm, dst_rc, 2>;
584
584
}
585
585
if op.HAS_GFX11 then {
586
- def _V2_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VReg_64 >;
586
+ def _V2_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VGPROp_64 >;
587
587
def _V2_nsa_gfx11 : MIMG_NoSampler_nsa_gfx11<op, asm, dst_rc, 2>;
588
588
}
589
589
}
@@ -600,14 +600,14 @@ multiclass MIMG_NoSampler_Src_Helper <mimgopc op, string asm,
600
600
let VAddrDwords = 3 in {
601
601
let ssamp = 0 in {
602
602
if op.HAS_GFX10M then {
603
- def _V3 : MIMG_NoSampler_Helper <op, asm, dst_rc, VReg_96 >;
603
+ def _V3 : MIMG_NoSampler_Helper <op, asm, dst_rc, VGPROp_96 >;
604
604
if !not(ExtendedImageInst) then
605
- def _V3_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VReg_96_Align2 >;
606
- def _V3_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VReg_96 >;
605
+ def _V3_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VGPROp_96_Align2 >;
606
+ def _V3_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VGPROp_96 >;
607
607
def _V3_nsa_gfx10 : MIMG_NoSampler_nsa_gfx10<op, asm, dst_rc, 3>;
608
608
}
609
609
if op.HAS_GFX11 then {
610
- def _V3_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VReg_96 >;
610
+ def _V3_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VGPROp_96 >;
611
611
def _V3_nsa_gfx11 : MIMG_NoSampler_nsa_gfx11<op, asm, dst_rc, 3>;
612
612
}
613
613
}
@@ -624,23 +624,23 @@ multiclass MIMG_NoSampler_Src_Helper <mimgopc op, string asm,
624
624
let VAddrDwords = 4 in {
625
625
let ssamp = 0 in {
626
626
if op.HAS_GFX10M then {
627
- def _V4 : MIMG_NoSampler_Helper <op, asm, dst_rc, VReg_128 >;
627
+ def _V4 : MIMG_NoSampler_Helper <op, asm, dst_rc, VGPROp_128 >;
628
628
if !not(ExtendedImageInst) then
629
- def _V4_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VReg_128_Align2 >;
630
- def _V4_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VReg_128 >;
629
+ def _V4_gfx90a : MIMG_NoSampler_Helper_gfx90a <op, asm, dst_rc, VGPROp_128_Align2 >;
630
+ def _V4_gfx10 : MIMG_NoSampler_gfx10<op, asm, dst_rc, VGPROp_128 >;
631
631
def _V4_nsa_gfx10 : MIMG_NoSampler_nsa_gfx10<op, asm, dst_rc, 4,
632
632
!if(enableDisasm, "GFX10", "")>;
633
633
}
634
634
if op.HAS_GFX11 then {
635
- def _V4_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VReg_128 >;
635
+ def _V4_gfx11 : MIMG_NoSampler_gfx11<op, asm, dst_rc, VGPROp_128 >;
636
636
def _V4_nsa_gfx11 : MIMG_NoSampler_nsa_gfx11<op, asm, dst_rc, 4,
637
637
!if(enableDisasm, "GFX11", "")>;
638
638
}
639
639
}
640
640
if op.HAS_GFX12 then {
641
641
if isVSample then {
642
642
let samp = 0 in
643
- def _V4_gfx12 : VSAMPLE_Sampler_gfx12<op, asm, dst_rc, 4, VGPR_32 ,
643
+ def _V4_gfx12 : VSAMPLE_Sampler_gfx12<op, asm, dst_rc, 4, VGPROp_32 ,
644
644
!if(enableDisasm, "GFX12", "")>;
645
645
}
646
646
else {
@@ -1128,7 +1128,7 @@ multiclass MIMG_Atomic_Renamed <mimgopc op, string asm, string renamed,
1128
1128
: MIMG_Atomic <op, asm, isCmpSwap, isFP, renamed>;
1129
1129
1130
1130
class MIMG_Sampler_Helper <mimgopc op, string asm, RegisterOperand dst_rc,
1131
- RegisterClass src_rc, string dns="">
1131
+ RegisterOperand src_rc, string dns="">
1132
1132
: MIMG_gfx6789 <op.VI, (outs dst_rc:$vdata), dns> {
1133
1133
let InOperandList = !con((ins src_rc:$vaddr, SReg_256_XNULL:$srsrc, SReg_128_XNULL:$ssamp,
1134
1134
DMask:$dmask, UNorm:$unorm, CPol:$cpol,
@@ -1139,7 +1139,7 @@ class MIMG_Sampler_Helper <mimgopc op, string asm, RegisterOperand dst_rc,
1139
1139
}
1140
1140
1141
1141
class MIMG_Sampler_gfx90a<mimgopc op, string asm, RegisterOperand dst_rc,
1142
- RegisterClass src_rc, string dns="">
1142
+ RegisterOperand src_rc, string dns="">
1143
1143
: MIMG_gfx90a<op.GFX10M, (outs dst_rc:$vdata), dns> {
1144
1144
let InOperandList = !con((ins src_rc:$vaddr, SReg_256_XNULL:$srsrc, SReg_128_XNULL:$ssamp,
1145
1145
DMask:$dmask, UNorm:$unorm, CPol:$cpol,
@@ -1164,7 +1164,7 @@ class MIMG_Sampler_Asm_gfx10p<string opcode, string AsmPrefix, bit HasD16> {
1164
1164
}
1165
1165
1166
1166
class MIMG_Sampler_gfx10<mimgopc op, string opcode,
1167
- RegisterOperand DataRC, RegisterClass AddrRC,
1167
+ RegisterOperand DataRC, RegisterOperand AddrRC,
1168
1168
string dns="">
1169
1169
: MIMG_gfx10<op.GFX10M, (outs DataRC:$vdata), dns> {
1170
1170
let InOperandList = MIMG_Sampler_OpList_gfx10p<(ins AddrRC:$vaddr0), BaseOpcode.HasD16>.ret;
@@ -1180,7 +1180,7 @@ class MIMG_Sampler_nsa_gfx10<mimgopc op, string opcode,
1180
1180
}
1181
1181
1182
1182
class MIMG_Sampler_nortn_gfx10<mimgopc op, string opcode,
1183
- RegisterClass AddrRC,
1183
+ RegisterOperand AddrRC,
1184
1184
string dns="">
1185
1185
: MIMG_gfx10<op.GFX10M, (outs), dns> {
1186
1186
let InOperandList = MIMG_Sampler_OpList_gfx10p<(ins AddrRC:$vaddr0), BaseOpcode.HasD16>.ret;
@@ -1200,7 +1200,7 @@ class MIMG_Sampler_nortn_nsa_gfx10<mimgopc op, string opcode,
1200
1200
}
1201
1201
1202
1202
class MIMG_Sampler_gfx11<mimgopc op, string opcode,
1203
- RegisterOperand DataRC, RegisterClass AddrRC,
1203
+ RegisterOperand DataRC, RegisterOperand AddrRC,
1204
1204
string dns="">
1205
1205
: MIMG_gfx11<op.GFX11, (outs DataRC:$vdata), dns> {
1206
1206
let InOperandList = MIMG_Sampler_OpList_gfx10p<(ins AddrRC:$vaddr0), BaseOpcode.HasD16>.ret;
@@ -1209,15 +1209,15 @@ class MIMG_Sampler_gfx11<mimgopc op, string opcode,
1209
1209
1210
1210
class MIMG_Sampler_nsa_gfx11<mimgopc op, string opcode,
1211
1211
RegisterOperand DataRC, int num_addrs,
1212
- RegisterClass LastVAddrSize, string dns="">
1212
+ RegisterOperand LastVAddrSize, string dns="">
1213
1213
: MIMG_nsa_gfx11<op.GFX11, (outs DataRC:$vdata), num_addrs, dns, [],
1214
1214
LastVAddrSize> {
1215
1215
let InOperandList = MIMG_Sampler_OpList_gfx10p<AddrIns, BaseOpcode.HasD16>.ret;
1216
1216
let AsmString = MIMG_Sampler_Asm_gfx10p<opcode, " $vdata, "#AddrAsm, BaseOpcode.HasD16>.ret;
1217
1217
}
1218
1218
1219
1219
class MIMG_Sampler_nortn_gfx11<mimgopc op, string opcode,
1220
- RegisterClass AddrRC,
1220
+ RegisterOperand AddrRC,
1221
1221
string dns="">
1222
1222
: MIMG_gfx11<op.GFX11, (outs), dns> {
1223
1223
let InOperandList = MIMG_Sampler_OpList_gfx10p<(ins AddrRC:$vaddr0), BaseOpcode.HasD16>.ret;
@@ -1227,7 +1227,7 @@ class MIMG_Sampler_nortn_gfx11<mimgopc op, string opcode,
1227
1227
1228
1228
class MIMG_Sampler_nortn_nsa_gfx11<mimgopc op, string opcode,
1229
1229
int num_addrs,
1230
- RegisterClass LastVAddrSize, string dns="">
1230
+ RegisterOperand LastVAddrSize, string dns="">
1231
1231
: MIMG_nsa_gfx11<op.GFX11, (outs), num_addrs, dns, [], LastVAddrSize> {
1232
1232
let InOperandList = MIMG_Sampler_OpList_gfx10p<AddrIns, BaseOpcode.HasD16>.ret;
1233
1233
let AsmString = MIMG_Sampler_Asm_gfx10p<opcode, "off, "#AddrAsm, BaseOpcode.HasD16>.ret;
@@ -1237,20 +1237,20 @@ class MIMG_Sampler_nortn_nsa_gfx11<mimgopc op, string opcode,
1237
1237
class MIMGAddrSize<int dw, bit enable_disasm, int AddrDW = dw> {
1238
1238
int NumWords = dw;
1239
1239
1240
- RegisterClass RegClass = !if(!le(AddrDW, 0), ?,
1241
- !if(!eq(AddrDW, 1), VGPR_32 ,
1242
- !if(!eq(AddrDW, 2), VReg_64 ,
1243
- !if(!eq(AddrDW, 3), VReg_96 ,
1244
- !if(!eq(AddrDW, 4), VReg_128 ,
1245
- !if(!eq(AddrDW, 5), VReg_160 ,
1246
- !if(!eq(AddrDW, 6), VReg_192 ,
1247
- !if(!eq(AddrDW, 7), VReg_224 ,
1248
- !if(!eq(AddrDW, 8), VReg_256 ,
1249
- !if(!eq(AddrDW, 9), VReg_288 ,
1250
- !if(!eq(AddrDW, 10), VReg_320 ,
1251
- !if(!eq(AddrDW, 11), VReg_352 ,
1252
- !if(!eq(AddrDW, 12), VReg_384 ,
1253
- !if(!le(AddrDW, 16), VReg_512 , ?))))))))))))));
1240
+ RegisterOperand RegClass = !if(!le(AddrDW, 0), ?,
1241
+ !if(!eq(AddrDW, 1), VGPROp_32 ,
1242
+ !if(!eq(AddrDW, 2), VGPROp_64 ,
1243
+ !if(!eq(AddrDW, 3), VGPROp_96 ,
1244
+ !if(!eq(AddrDW, 4), VGPROp_128 ,
1245
+ !if(!eq(AddrDW, 5), VGPROp_160 ,
1246
+ !if(!eq(AddrDW, 6), VGPROp_192 ,
1247
+ !if(!eq(AddrDW, 7), VGPROp_224 ,
1248
+ !if(!eq(AddrDW, 8), VGPROp_256 ,
1249
+ !if(!eq(AddrDW, 9), VGPROp_288 ,
1250
+ !if(!eq(AddrDW, 10), VGPROp_320 ,
1251
+ !if(!eq(AddrDW, 11), VGPROp_352 ,
1252
+ !if(!eq(AddrDW, 12), VGPROp_384 ,
1253
+ !if(!le(AddrDW, 16), VGPROp_512 , ?))))))))))))));
1254
1254
1255
1255
// Whether the instruction variant with this vaddr size should be enabled for
1256
1256
// the auto-generated disassembler.
@@ -1514,8 +1514,10 @@ multiclass MIMG_Gather_WQM <mimgopc op, AMDGPUSampleVariant sample>
1514
1514
1515
1515
class MIMG_IntersectRay_Helper<bit Is64, bit IsA16, bit isDual, bit isBVH8> {
1516
1516
int num_addrs = !if(isBVH8, 11, !if(Is64, !if(IsA16, 9, 12), !if(IsA16, 8, 11)));
1517
- RegisterClass RegClass = MIMGAddrSize<num_addrs, 0>.RegClass;
1518
- int VAddrDwords = !srl(RegClass.Size, 5);
1517
+ RegisterOperand RegClass = MIMGAddrSize<num_addrs, 0>.RegClass;
1518
+
1519
+ defvar Size = !cast<SIRegisterClass>(RegClass.RegClass).Size;
1520
+ int VAddrDwords = !srl(Size, 5);
1519
1521
1520
1522
int GFX11PlusNSAAddrs = !if(IsA16, 4, 5);
1521
1523
RegisterClass node_ptr_type = !if(Is64, VReg_64, VGPR_32);
@@ -1526,7 +1528,7 @@ class MIMG_IntersectRay_Helper<bit Is64, bit IsA16, bit isDual, bit isBVH8> {
1526
1528
true : [node_ptr_type, VGPR_32, VReg_96, VReg_96, VReg_96]);
1527
1529
}
1528
1530
1529
- class MIMG_IntersectRay_gfx10<mimgopc op, string opcode, RegisterClass AddrRC>
1531
+ class MIMG_IntersectRay_gfx10<mimgopc op, string opcode, RegisterOperand AddrRC>
1530
1532
: MIMG_gfx10<op.GFX10M, (outs VReg_128:$vdata), "GFX10"> {
1531
1533
let InOperandList = (ins AddrRC:$vaddr0, SReg_128_XNULL:$srsrc, A16:$a16);
1532
1534
let AsmString = opcode#" $vdata, $vaddr0, $srsrc$a16";
@@ -1540,7 +1542,7 @@ class MIMG_IntersectRay_nsa_gfx10<mimgopc op, string opcode, int num_addrs>
1540
1542
let AsmString = opcode#" $vdata, "#nsah.AddrAsm#", $srsrc$a16";
1541
1543
}
1542
1544
1543
- class MIMG_IntersectRay_gfx11<mimgopc op, string opcode, RegisterClass AddrRC>
1545
+ class MIMG_IntersectRay_gfx11<mimgopc op, string opcode, RegisterOperand AddrRC>
1544
1546
: MIMG_gfx11<op.GFX11, (outs VReg_128:$vdata), "GFX11"> {
1545
1547
let InOperandList = (ins AddrRC:$vaddr0, SReg_128_XNULL:$srsrc, A16:$a16);
1546
1548
let AsmString = opcode#" $vdata, $vaddr0, $srsrc$a16";
0 commit comments