REDUX

Moves and predicates

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
howis_signed
6362616059585756555453525150494847464544434241403938373635343332
313029282726252423222120191817161514131211109876543210
[31:24][21:16]pred.notpred001111000100

bits 15:0: ---- 0011 1100 0100

NAK encodes UMOV as a uniform ALU instruction: form 4 an immediate (0x882), form 6 a uniform register (0xc82)

Runs execute_REDUX.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
how80:78execute_REDUX
is_signed73execute_REDUX
[31:24]31:24execute_REDUX
[21:16]21:16execute_REDUX
pred.not15the decoder
pred14:12the decoder

Operation Sail

REDUX: NAK's OpRedux, of the source over the invocation's 32 lanes, into a uniform register: 78-80 0 and, 1 or, 2 xor, 3 sum, 4 min, 5 max, bit 73 signed. A clustered reduction of 32 keeps it to those lanes

let how = UInt(Field(78, 3));
if how > 5 then throw(Unsupported("REDUX operation %u", how));
let is_signed = Field(73, 1) == 0b1;
/* OpGroupNonUniform BitwiseAnd 359, BitwiseOr 360, BitwiseXor 361, IAdd 349, UMin 354, UMax 357, SMin 353, SMax 356 */
let opcode = match how {
    0 => 359,
    1 => 360,
    2 => 361,
    3 => 349,
    4 => if is_signed then 353 else 354,
    _ => if is_signed then 356 else 357
};
if Lone() then U_write(UInt(Field(16, 6)), R_read(UInt(Field(24, 8)))) else {
    Capability(63);
    Capability(67);
    U_write(UInt(Field(16, 6)), ClusterReduce32(opcode, R_read(UInt(Field(24, 8)))))
}

Made from ScarletNX's Sail at 166ad3910f80. The Sail and the encodings' file are ScarletNX's (GPL-3.0-or-later); its encodings are from Mesa's NAK (sm70_encode.rs, MIT) and CuAssembler's sm_86 records.