Skip to content

Commit 9ecc72f

Browse files
committed
[AMDGPU] Simplify definition of FLAT segment bits. NFC.
1 parent 0b0e528 commit 9ecc72f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/AMDGPU/FLATInstructions.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ class FLAT_Real <bits<7> op, FLAT_Pseudo ps, string opName = ps.Mnemonic> :
115115
bits<1> lds = ps.lds; // LDS DMA for global and scratch
116116

117117
// Segment, 00=flat, 01=scratch, 10=global, 11=reserved
118-
bits<2> seg = !if(ps.is_flat_global, 0b10,
119-
!if(ps.is_flat_scratch, 0b01, 0));
118+
bits<2> seg = {ps.is_flat_global, ps.is_flat_scratch};
120119

121120
// Signed offset. Highest bit ignored for flat and treated as 12-bit
122121
// unsigned for flat accesses.
@@ -2562,8 +2561,7 @@ class VFLAT_Real_gfx12 <bits<8> op, FLAT_Pseudo ps,
25622561
let AssemblerPredicate = isGFX12Plus;
25632562
let DecoderNamespace = "GFX12";
25642563

2565-
let Inst{25-24} = !if(ps.is_flat_scratch, 0b01,
2566-
!if(ps.is_flat_global, 0b10, 0b00));
2564+
let Inst{25-24} = {ps.is_flat_global, ps.is_flat_scratch};
25672565
}
25682566

25692567
multiclass VFLAT_Aliases_gfx12<string ps, string opName, int renamed, string alias> {

0 commit comments

Comments
 (0)