Skip to content

Commit 966bd1a

Browse files
committed
This commit: (1) improve .td file after resolving merge conflict
(2) replace target check with a prediate (3) add negative tests.
1 parent 7cfdcdb commit 966bd1a

File tree

5 files changed

+132
-51
lines changed

5 files changed

+132
-51
lines changed

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,11 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
16021602

16031603
bool hasKernargPreload() const { return AMDGPU::hasKernargPreload(getSTI()); }
16041604

1605+
bool isFlatInstAndNVAllowed(const MCInst &Inst) const {
1606+
uint64_t TSFlags = MII.get(Inst.getOpcode()).TSFlags;
1607+
return (TSFlags & SIInstrFlags::FLAT) && isGFX9() && !isGFX90A();
1608+
}
1609+
16051610
AMDGPUTargetStreamer &getTargetStreamer() {
16061611
MCTargetStreamer &TS = *getParser().getStreamer().getTargetStreamer();
16071612
return static_cast<AMDGPUTargetStreamer &>(TS);
@@ -5371,8 +5376,7 @@ bool AMDGPUAsmParser::validateCoherencyBits(const MCInst &Inst,
53715376
S = SMLoc::getFromPointer(&CStr.data()[CStr.find("scale_offset")]);
53725377
Error(S, "scale_offset is not supported on this GPU");
53735378
}
5374-
if ((CPol & CPol::NV) && (!isGFX9() || isGFX90A())) {
5375-
// nv not supported on GFX90A+
5379+
if ((CPol & CPol::NV) && !isFlatInstAndNVAllowed(Inst)) {
53765380
SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
53775381
StringRef CStr(S.getPointer());
53785382
S = SMLoc::getFromPointer(&CStr.data()[CStr.find("nv")]);

llvm/lib/Target/AMDGPU/FLATInstructions.td

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,6 +2693,11 @@ class FLAT_Real_vi <bits<7> op, FLAT_Pseudo ps, bit has_sccb = ps.has_sccb> :
26932693
!subst("$sccb", !if(has_sccb, "$sccb",""), ps.AsmOperands);
26942694
}
26952695

2696+
class FLAT_Real_vi_ex_gfx9 <bits<7> op, FLAT_Pseudo ps, bit has_sccb = ps.has_sccb> :
2697+
FLAT_Real_vi <op, ps, has_sccb> {
2698+
let AssemblerPredicate = isGFX8orGFX9After908;
2699+
}
2700+
26962701
class FLAT_Real_gfx9 <bits<7> op, FLAT_Pseudo ps, bit has_sccb = ps.has_sccb> :
26972702
FLAT_Real_vi <op, ps, has_sccb> {
26982703
let AssemblerPredicate = isGFX9NotGFX90A;
@@ -2702,9 +2707,7 @@ class FLAT_Real_gfx9 <bits<7> op, FLAT_Pseudo ps, bit has_sccb = ps.has_sccb> :
27022707
}
27032708

27042709
multiclass FLAT_Real_mc_vi <bits<7> op, FLAT_Pseudo ps, bit has_sccb = ps.has_sccb> {
2705-
let AssemblerPredicate = isGFX8orGFX9After908 in { // GFX8 or GFX9's starting with 90A
2706-
def _vi: FLAT_Real_vi<op, ps, has_sccb>;
2707-
}
2710+
def _vi: FLAT_Real_vi_ex_gfx9<op, ps, has_sccb>;
27082711
def _gfx9: FLAT_Real_gfx9<op, ps, has_sccb>;
27092712
}
27102713

@@ -2714,10 +2717,10 @@ multiclass FLAT_Real_AllAddr_vi<bits<7> op,
27142717
defm _SADDR : FLAT_Real_mc_vi<op, !cast<FLAT_Pseudo>(NAME#"_SADDR"), has_sccb>;
27152718
}
27162719

2717-
multiclass FLAT_Real_AllAddr_vi_only<bits<7> op,
2720+
multiclass FLAT_Real_AllAddr_vi_ex_gfx9<bits<7> op,
27182721
bit has_sccb = !cast<FLAT_Pseudo>(NAME).has_sccb> {
2719-
def _vi : FLAT_Real_vi<op, !cast<FLAT_Pseudo>(NAME), has_sccb>;
2720-
def _SADDR_vi : FLAT_Real_vi<op, !cast<FLAT_Pseudo>(NAME#"_SADDR"), has_sccb>;
2722+
def _vi : FLAT_Real_vi_ex_gfx9<op, !cast<FLAT_Pseudo>(NAME), has_sccb>;
2723+
def _SADDR_vi : FLAT_Real_vi_ex_gfx9<op, !cast<FLAT_Pseudo>(NAME#"_SADDR"), has_sccb>;
27212724
}
27222725

27232726
class FLAT_Real_gfx940 <bits<7> op, FLAT_Pseudo ps> :
@@ -2796,35 +2799,38 @@ defm FLAT_LOAD_SHORT_D16_HI_vi : FLAT_Real_mc_vi <0x25, FLAT_LOAD_SHORT_D16_HI>;
27962799
multiclass FLAT_Real_Atomics_vi <bits<7> op,
27972800
bit has_sccb = !cast<FLAT_Pseudo>(NAME).has_sccb> {
27982801
defvar ps = !cast<FLAT_Pseudo>(NAME);
2799-
defm "" : FLAT_Real_mc_vi<op, !cast<FLAT_Pseudo>(ps.PseudoInstr), has_sccb>;
2802+
defm "" : FLAT_Real_mc_vi<op, !cast<FLAT_Pseudo>(ps.PseudoInstr), has_sccb>;
28002803
defm _RTN : FLAT_Real_mc_vi<op, !cast<FLAT_Pseudo>(ps.PseudoInstr # "_RTN"), has_sccb>;
2804+
def _RTN_agpr_vi : FLAT_Real_vi_ex_gfx9<op, !cast<FLAT_Pseudo>(ps.PseudoInstr # "_RTN_agpr"), has_sccb>;
28012805
}
28022806

2803-
// FLAT_Real_mc_vi contains a vi variant and a gfx9 variant. In some cases, only the vi
2804-
// variant is needed.
2805-
multiclass FLAT_Real_Atomics_vi_only <bits<7> op,
2807+
multiclass FLAT_Real_Atomics_vi_ex_gfx9 <bits<7> op,
28062808
bit has_sccb = !cast<FLAT_Pseudo>(NAME).has_sccb> {
28072809
defvar ps = !cast<FLAT_Pseudo>(NAME);
2808-
def _vi : FLAT_Real_vi<op, !cast<FLAT_Pseudo>(ps.PseudoInstr), has_sccb>;
2809-
def _RTN_vi : FLAT_Real_vi<op, !cast<FLAT_Pseudo>(ps.PseudoInstr # "_RTN"), has_sccb>;
2810-
def _RTN_agpr_vi : FLAT_Real_vi<op, !cast<FLAT_Pseudo>(ps.PseudoInstr # "_RTN_agpr"), has_sccb>;
2810+
def _vi : FLAT_Real_vi_ex_gfx9<op, !cast<FLAT_Pseudo>(ps.PseudoInstr), has_sccb>;
2811+
def _RTN_vi : FLAT_Real_vi_ex_gfx9<op, !cast<FLAT_Pseudo>(ps.PseudoInstr # "_RTN"), has_sccb>;
2812+
2813+
def _RTN_agpr_vi : FLAT_Real_vi_ex_gfx9<op, !cast<FLAT_Pseudo>(ps.PseudoInstr # "_RTN_agpr"), has_sccb>;
28112814
}
28122815

28132816
multiclass FLAT_Global_Real_Atomics_vi<bits<7> op,
28142817
bit has_sccb = !cast<FLAT_Pseudo>(NAME).has_sccb> :
28152818
FLAT_Real_AllAddr_vi<op, has_sccb> {
28162819
defm _RTN : FLAT_Real_mc_vi <op, !cast<FLAT_Pseudo>(NAME#"_RTN"), has_sccb>;
28172820
defm _SADDR_RTN : FLAT_Real_mc_vi <op, !cast<FLAT_Pseudo>(NAME#"_SADDR_RTN"), has_sccb>;
2821+
2822+
def _RTN_agpr_vi : FLAT_Real_vi_ex_gfx9 <op, !cast<FLAT_Pseudo>(NAME#"_RTN_agpr"), has_sccb>;
2823+
def _SADDR_RTN_agpr_vi : FLAT_Real_vi_ex_gfx9 <op, !cast<FLAT_Pseudo>(NAME#"_SADDR_RTN_agpr"), has_sccb>;
28182824
}
28192825

2820-
multiclass FLAT_Global_Real_Atomics_vi_only<bits<7> op,
2826+
multiclass FLAT_Global_Real_Atomics_vi_ex_gfx9<bits<7> op,
28212827
bit has_sccb = !cast<FLAT_Pseudo>(NAME).has_sccb> :
2822-
FLAT_Real_AllAddr_vi_only<op, has_sccb> {
2823-
def _RTN_vi : FLAT_Real_vi <op, !cast<FLAT_Pseudo>(NAME#"_RTN"), has_sccb>;
2824-
def _SADDR_RTN_vi : FLAT_Real_vi <op, !cast<FLAT_Pseudo>(NAME#"_SADDR_RTN"), has_sccb>;
2828+
FLAT_Real_AllAddr_vi_ex_gfx9<op, has_sccb> {
2829+
def _RTN_vi : FLAT_Real_vi_ex_gfx9 <op, !cast<FLAT_Pseudo>(NAME#"_RTN"), has_sccb>;
2830+
def _SADDR_RTN_vi : FLAT_Real_vi_ex_gfx9 <op, !cast<FLAT_Pseudo>(NAME#"_SADDR_RTN"), has_sccb>;
28252831

2826-
def _RTN_agpr_vi : FLAT_Real_vi <op, !cast<FLAT_Pseudo>(NAME#"_RTN_agpr"), has_sccb>;
2827-
def _SADDR_RTN_agpr_vi : FLAT_Real_vi <op, !cast<FLAT_Pseudo>(NAME#"_SADDR_RTN_agpr"), has_sccb>;
2832+
def _RTN_agpr_vi : FLAT_Real_vi_ex_gfx9 <op, !cast<FLAT_Pseudo>(NAME#"_RTN_agpr"), has_sccb>;
2833+
def _SADDR_RTN_agpr_vi : FLAT_Real_vi_ex_gfx9 <op, !cast<FLAT_Pseudo>(NAME#"_SADDR_RTN_agpr"), has_sccb>;
28282834
}
28292835

28302836
defm FLAT_ATOMIC_SWAP : FLAT_Real_Atomics_vi <0x40>;
@@ -2986,10 +2992,10 @@ let AssemblerPredicate = isGFX940Plus in {
29862992
defm GLOBAL_ATOMIC_ADD_F64 : FLAT_Global_Real_Atomics_gfx940<0x4f>;
29872993
defm GLOBAL_ATOMIC_MIN_F64 : FLAT_Global_Real_Atomics_gfx940<0x50>;
29882994
defm GLOBAL_ATOMIC_MAX_F64 : FLAT_Global_Real_Atomics_gfx940<0x51>;
2989-
defm FLAT_ATOMIC_ADD_F32 : FLAT_Real_Atomics_vi_only<0x4d>;
2990-
defm FLAT_ATOMIC_PK_ADD_F16 : FLAT_Real_Atomics_vi_only<0x4e>;
2991-
defm FLAT_ATOMIC_PK_ADD_BF16 : FLAT_Real_Atomics_vi_only<0x52>;
2992-
defm GLOBAL_ATOMIC_PK_ADD_BF16 : FLAT_Global_Real_Atomics_vi_only<0x52>;
2995+
defm FLAT_ATOMIC_ADD_F32 : FLAT_Real_Atomics_vi_ex_gfx9<0x4d>;
2996+
defm FLAT_ATOMIC_PK_ADD_F16 : FLAT_Real_Atomics_vi_ex_gfx9<0x4e>;
2997+
defm FLAT_ATOMIC_PK_ADD_BF16 : FLAT_Real_Atomics_vi_ex_gfx9<0x52>;
2998+
defm GLOBAL_ATOMIC_PK_ADD_BF16 : FLAT_Global_Real_Atomics_vi_ex_gfx9<0x52>;
29932999
} // End AssemblerPredicate = isGFX940Plus
29943000

29953001
//===----------------------------------------------------------------------===//

llvm/test/MC/AMDGPU/gfx90a_err.s

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,3 +674,46 @@ v_dot8c_i32_i4 v0, v1, v2, v3 op_sel:[1,1] op_sel_hi:[1,0]
674674
v_dot8c_i32_i4 v0, v1, v2, v3 op_sel:[1,1] op_sel_hi:[1,1]
675675
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand.
676676

677+
// nv bit in FLAT instructions
678+
flat_load_ubyte v5, v[2:3] offset:4095 nv
679+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
680+
681+
flat_load_ubyte a5, v[2:3] offset:4095 nv
682+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
683+
684+
flat_store_dword v[2:3], v5 offset:4095 nv
685+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
686+
687+
flat_store_dword v[2:3], a5 offset:4095 nv
688+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
689+
690+
flat_atomic_add_f64 v[0:1], v[2:3] offset:4095 nv
691+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
692+
693+
global_load_ubyte v5, v[2:3], off offset:-1 nv
694+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
695+
696+
global_store_byte v[2:3], v5, off offset:-1 nv
697+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
698+
699+
global_atomic_add v[2:3], v5, off nv
700+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
701+
702+
global_atomic_swap a1, v[2:3], a2, off glc nv
703+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
704+
705+
global_atomic_swap_x2 v[2:3], v[4:5], off nv
706+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
707+
708+
global_atomic_swap_x2 v[2:3], a[4:5], off nv
709+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
710+
711+
scratch_load_ubyte v5, off, s2 offset:-1 nv
712+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
713+
714+
scratch_load_ubyte a5, off, s2 offset:-1 nv
715+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
716+
717+
scratch_store_dword v2, v3, off nv
718+
// GFX90A: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
719+

llvm/test/MC/AMDGPU/gfx90a_ldst_acc.s

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -706,107 +706,107 @@ flat_load_short_d16_hi a5, v[2:3] offset:4095 glc
706706
flat_load_short_d16_hi a5, v[2:3] offset:4095 slc
707707

708708
// GFX90A: flat_atomic_swap a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x01,0xdd,0x02,0x02,0x80,0x00]
709-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
709+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
710710
flat_atomic_swap a0, v[2:3], a2 offset:4095 glc
711711

712712
// GFX90A: flat_atomic_cmpswap a0, v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x05,0xdd,0x02,0x02,0x80,0x00]
713-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
713+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
714714
flat_atomic_cmpswap a0, v[2:3], a[2:3] offset:4095 glc
715715

716716
// GFX90A: flat_atomic_add a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x09,0xdd,0x02,0x02,0x80,0x00]
717-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
717+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
718718
flat_atomic_add a0, v[2:3], a2 offset:4095 glc
719719

720720
// GFX90A: flat_atomic_sub a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x0d,0xdd,0x02,0x02,0x80,0x00]
721-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
721+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
722722
flat_atomic_sub a0, v[2:3], a2 offset:4095 glc
723723

724724
// GFX90A: flat_atomic_smin a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x11,0xdd,0x02,0x02,0x80,0x00]
725-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
725+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
726726
flat_atomic_smin a0, v[2:3], a2 offset:4095 glc
727727

728728
// GFX90A: flat_atomic_umin a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x15,0xdd,0x02,0x02,0x80,0x00]
729-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
729+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
730730
flat_atomic_umin a0, v[2:3], a2 offset:4095 glc
731731

732732
// GFX90A: flat_atomic_smax a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x19,0xdd,0x02,0x02,0x80,0x00]
733-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
733+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
734734
flat_atomic_smax a0, v[2:3], a2 offset:4095 glc
735735

736736
// GFX90A: flat_atomic_umax a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x1d,0xdd,0x02,0x02,0x80,0x00]
737-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
737+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
738738
flat_atomic_umax a0, v[2:3], a2 offset:4095 glc
739739

740740
// GFX90A: flat_atomic_and a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x21,0xdd,0x02,0x02,0x80,0x00]
741-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
741+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
742742
flat_atomic_and a0, v[2:3], a2 offset:4095 glc
743743

744744
// GFX90A: flat_atomic_or a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x25,0xdd,0x02,0x02,0x80,0x00]
745-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
745+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
746746
flat_atomic_or a0, v[2:3], a2 offset:4095 glc
747747

748748
// GFX90A: flat_atomic_xor a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x29,0xdd,0x02,0x02,0x80,0x00]
749-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
749+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
750750
flat_atomic_xor a0, v[2:3], a2 offset:4095 glc
751751

752752
// GFX90A: flat_atomic_inc a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x2d,0xdd,0x02,0x02,0x80,0x00]
753-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
753+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
754754
flat_atomic_inc a0, v[2:3], a2 offset:4095 glc
755755

756756
// GFX90A: flat_atomic_dec a0, v[2:3], a2 offset:4095 glc ; encoding: [0xff,0x0f,0x31,0xdd,0x02,0x02,0x80,0x00]
757-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
757+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
758758
flat_atomic_dec a0, v[2:3], a2 offset:4095 glc
759759

760760
// GFX90A: flat_atomic_swap_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x81,0xdd,0x02,0x02,0x80,0x00]
761-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
761+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
762762
flat_atomic_swap_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
763763

764764
// GFX90A: flat_atomic_cmpswap_x2 a[0:1], v[2:3], a[2:5] offset:4095 glc ; encoding: [0xff,0x0f,0x85,0xdd,0x02,0x02,0x80,0x00]
765-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
765+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
766766
flat_atomic_cmpswap_x2 a[0:1], v[2:3], a[2:5] offset:4095 glc
767767

768768
// GFX90A: flat_atomic_add_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x89,0xdd,0x02,0x02,0x80,0x00]
769-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
769+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
770770
flat_atomic_add_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
771771

772772
// GFX90A: flat_atomic_sub_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x8d,0xdd,0x02,0x02,0x80,0x00]
773-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
773+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
774774
flat_atomic_sub_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
775775

776776
// GFX90A: flat_atomic_smin_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x91,0xdd,0x02,0x02,0x80,0x00]
777-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
777+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
778778
flat_atomic_smin_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
779779

780780
// GFX90A: flat_atomic_umin_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x95,0xdd,0x02,0x02,0x80,0x00]
781-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
781+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
782782
flat_atomic_umin_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
783783

784784
// GFX90A: flat_atomic_smax_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x99,0xdd,0x02,0x02,0x80,0x00]
785-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
785+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
786786
flat_atomic_smax_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
787787

788788
// GFX90A: flat_atomic_umax_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0x9d,0xdd,0x02,0x02,0x80,0x00]
789-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
789+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
790790
flat_atomic_umax_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
791791

792792
// GFX90A: flat_atomic_and_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0xa1,0xdd,0x02,0x02,0x80,0x00]
793-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
793+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
794794
flat_atomic_and_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
795795

796796
// GFX90A: flat_atomic_or_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0xa5,0xdd,0x02,0x02,0x80,0x00]
797-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
797+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
798798
flat_atomic_or_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
799799

800800
// GFX90A: flat_atomic_xor_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0xa9,0xdd,0x02,0x02,0x80,0x00]
801-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
801+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
802802
flat_atomic_xor_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
803803

804804
// GFX90A: flat_atomic_inc_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0xad,0xdd,0x02,0x02,0x80,0x00]
805-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
805+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
806806
flat_atomic_inc_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
807807

808808
// GFX90A: flat_atomic_dec_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc ; encoding: [0xff,0x0f,0xb1,0xdd,0x02,0x02,0x80,0x00]
809-
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: invalid register class: agpr loads and stores not supported on this GPU
809+
// NOT-GFX90A: :[[@LINE+1]]:{{[0-9]+}}: error: operands are not valid for this GPU or mode
810810
flat_atomic_dec_x2 a[0:1], v[2:3], a[2:3] offset:4095 glc
811811

812812
// GFX90A: flat_atomic_swap v[2:3], a2 offset:4095 ; encoding: [0xff,0x0f,0x00,0xdd,0x02,0x02,0x80,0x00]

llvm/test/MC/AMDGPU/gfx942_err.s

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,31 @@ global_load_dword v[2:3], off lds
125125

126126
scratch_load_dword v2, off lds
127127
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
128+
129+
// nv bit in FLAT instructions
130+
flat_load_ubyte v5, v[2:3] offset:4095 nv
131+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
132+
133+
flat_store_dword v[2:3], v5 offset:4095 nv
134+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
135+
136+
flat_atomic_add_f32 v[2:3], v5 nv
137+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
138+
139+
global_load_dword v2, v[2:3], off sc0 nv
140+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
141+
142+
global_store_dword v[2:3], v5 off sc0 nv
143+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
144+
145+
global_atomic_add_f64 v[0:1], v[2:3], off sc1 nv
146+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
147+
148+
global_atomic_swap v0, v[2:3], v5 off sc0 nv
149+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
150+
151+
scratch_load_lds_dword v2, off nv
152+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU
153+
154+
scratch_store_dword v2, v3, off nv
155+
// GFX942: :[[@LINE-1]]:{{[0-9]+}}: error: nv is not supported on this GPU

0 commit comments

Comments
 (0)