Skip to content

Commit

Permalink
[AMDGPU] Simplify definition of FLAT segment bits. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed Mar 15, 2024
1 parent 0b0e528 commit 9ecc72f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/AMDGPU/FLATInstructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ class FLAT_Real <bits<7> op, FLAT_Pseudo ps, string opName = ps.Mnemonic> :
bits<1> lds = ps.lds; // LDS DMA for global and scratch

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

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

let Inst{25-24} = !if(ps.is_flat_scratch, 0b01,
!if(ps.is_flat_global, 0b10, 0b00));
let Inst{25-24} = {ps.is_flat_global, ps.is_flat_scratch};
}

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

0 comments on commit 9ecc72f

Please sign in to comment.