P2R

Moves and predicates

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
byte
6362616059585756555453525150494847464544434241403938373635343332
313029282726252423222120191817161514131211109876543210
RaRdpred.notpredform000000011

bits 15:0: ---- 0010 0000 0011
bits 15:0: ---- 1000 0000 0011
bits 15:0: ---- 1010 0000 0011
bits 15:0: ---- 1100 0000 0011

Forms

Form (bits 11:9)bc
1 (001)Rb at 32Rc at 64
4 (100)immediate at 32Rc at 64
5 (101)constant buffer: offset at 38, bank at 54Rc at 64
6 (110)URb at 32Rc at 64

P2R (0x803) and its uniform UP2UR (0x883): CuAssembler's sm_86 and sm_80 encodings

Runs execute_P2R.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
byte77:76execute_P2R
Ra31:24the decoder
Rd23:16the decoder
pred.not15the decoder
pred14:12the decoder
form11:9the decoder

Operation Sail

P2R and UP2UR: P2R Rd, PR, Ra, mask: Ra with the masked bits (at byte 76-77) from P0-P6, PT the bit 7

let byte = UInt(Field(76, 2));
if not_bool(SrcIsImm(B)) then throw(Unsupported("%s with a register mask", OpName()));
let mask = SrcImm(B);
var bits : bits(32) = 0x00000080;
foreach (i from 0 to 6) {
    if MOD(DIV(mask, 2 ^ i), 2) == 1 then {
        bits = bits | (if PredRead(i, 0, if Uniform() then 1 else 0) then to_bits(32, 2 ^ i) else 0x00000000)
    }
};
let pr = bits & to_bits(32, MOD(mask, 256));
let keep = SrcBits(A) & not_vec(to_bits(32, MOD(mask, 256) * 2 ^ (8 * byte)));
D_write(keep | (pr << (8 * byte)))

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.