HSETP2

Floating point

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
accacc[80]cmpswa[71]set_op[68:64]
6362616059585756555453525150494847464544434241403938373635343332
swb
313029282726252423222120191817161514131211109876543210
Rapred.notpred0xx000110100
form

bits 15:0: ---- 0010 0011 0100
bits 15:0: ---- 0100 0011 0100
bits 15:0: ---- 0110 0011 0100

Forms

Form (bits 11:9)bc
1 (001)Rb at 32Rc at 64
2 (010)Rb at 64immediate at 32
3 (011)Rb at 64constant buffer: offset at 38, bank at 54

HSETP2's forms are the 16-bit ALU's: b a register (1), two halves (2), a constant buffer (3), as CuAssembler's sm_86 encodings 0x234, 0x434 and 0x634 show

Runs execute_HSETP2.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
acc90execute_HSETP2
acc89:87execute_HSETP2
[80:64]80:64execute_HSETP2
[80]80execute_HSETP2
cmp79:76execute_HSETP2
swa75:74execute_HSETP2
[71]71execute_HSETP2
set_op70:69execute_HSETP2
[68:64]68:64execute_HSETP2
swb61:60execute_HSETP2
Ra31:24the decoder
pred.not15the decoder
pred14:12the decoder
form11:9the decoder

Operation Sail

HSETP2: the halves of a and of b, each pair compared by the operation at 76-79 (FSETP's codes), then each with the predicate at 87-90 by the operation at 69-70: the low halves into the predicate at 81-83, the high ones into 84-86. The forms of the 16-bit ALU, as CuAssembler's sm_86 encodings show them: b a register at 32 (1), two halves at 32-63 (2), a constant buffer (3). a's swizzle is at 74-75 and b's at 60-61 (HADD2's codes). FTZ (80) and the other bits of 64-71, which no program sets, are refused

if Form() > 3 | Field(80, 1) != 0b0 | Field(64, 5) != 0b00000 | Field(71, 1) != 0b0 then
    throw(Unsupported("HSETP2 of form %u with modifiers 0x%x", Form(), Field(64, 17)));
let swa = UInt(Field(74, 2));
let swb = if SrcIsImm(Second) then 0 else UInt(Field(60, 2));
let va = HalfOperand(A, swa, "HSETP2");
let vb = HalfOperand(Second, swb, "HSETP2");
let acc = PredRead(UInt(Field(87, 3)), UInt(Field(90, 1)), 0);
let set_op = Field(69, 2);
foreach (k from 0 to 1) {
    let cmp = FCompare(UInt(Field(76, 4)), Half2At(va, k), Half2At(vb, k));
    PredWrite(UInt(Field(81 + 3 * k, 3)), Combine(set_op, cmp, acc), 0)
}

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.