Skip to content

Commit 0ed7a5a

Browse files
committed
[AMDGPU] Clean up GFX10 FLAT saddr field definition
On GFX10 only, saddr = EXEC_HI (instead of NULL) is use to distinguish ST mode from other SCRATCH addressing modes. Handle this when defining the saddr field instead of overriding it in subclasses.
1 parent 7337db7 commit 0ed7a5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/AMDGPU/FLATInstructions.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,9 @@ class FLAT_Real_gfx10<bits<7> op, FLAT_Pseudo ps> :
21152115

21162116
let Inst{11-0} = offset{11-0};
21172117
let Inst{12} = !if(ps.has_dlc, cpol{CPolBit.DLC}, ps.dlcValue);
2118-
let Inst{54-48} = !if(ps.enabled_saddr, saddr, 0x7d);
2118+
let Inst{54-48} = !cond(ps.enabled_saddr : saddr,
2119+
!and(ps.is_flat_scratch, !not(ps.has_vaddr)) : EXEC_HI.Index{6-0}, // ST mode
2120+
true : SGPR_NULL_gfxpre11.Index{6-0});
21192121
let Inst{55} = 0;
21202122
}
21212123

@@ -2143,7 +2145,6 @@ multiclass FLAT_Real_SADDR_RTN_gfx10<bits<7> op> {
21432145
multiclass FLAT_Real_ST_gfx10<bits<7> op> {
21442146
def _ST_gfx10 :
21452147
FLAT_Real_gfx10<op, !cast<FLAT_Pseudo>(NAME#"_ST")> {
2146-
let Inst{54-48} = EXEC_HI.Index;
21472148
let OtherPredicates = [HasFlatScratchSTMode];
21482149
}
21492150
}

0 commit comments

Comments
 (0)