IPA

Attributes and the stage's own memory

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
freqlocraw
6362616059585756555453525150494847464544434241403938373635343332
[39:32]
313029282726252423222120191817161514131211109876543210
[31:24]Rdpred.notpred001100100110

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

Runs execute_IPA.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
freq79:78execute_IPA
loc77:76execute_IPA
raw71:64execute_IPA
[39:32]39:32execute_IPA
[31:24]31:24execute_IPA
Rd23:16the decoder
pred.not15the decoder
pred14:12the decoder

Operation Sail

IPA: a fragment's input at the attribute address at 64 (a word's), bits 76-77 NAK's InterpLoc (0 the default, 1 the centroid, 2 at an offset), 78-79 its frequency. FragCoord (0x70), the generics (0x80-0x27f), the front face (NAK's NAK_ATTR_FRONT_FACE, all ones for a front face, as spirv_translate.c reads Maxwell's), PointCoord (NAK's NAK_ATTR_POINT_SPRITE_S and _T; the Maxwell path flips T with the sprite's origin, a push constant of the fragment stage that this translation does not have), the primitive's number (NAK's NAK_ATTR_PRIMITIVE_ID, its bits as they are)

let raw = UInt(Field(64, 8)) * 4;
let addr = LegacyAddress(raw);
let loc = UInt(Field(76, 2));
let freq = UInt(Field(78, 2));
if UInt(Field(32, 8)) != RZ | UInt(Field(24, 8)) != 0 | freq > 1 | loc > 1 then
    throw(Unsupported("IPA indexed, at an offset or of frequency %u", freq));
/* the addresses: FragCoord 0x70-0x7f, the generics 0x80-0x27f, the front face 0x3fc, PointCoord 0x2e0 and 0x2e4,
   the primitive's number 0x60, the layer 0x64 */
let v : bits(32) = if addr >= 112 & addr < 128 then FragCoord(MOD(DIV(addr, 4), 4))
    else if addr >= 128 & addr < 640 then IpaInput(DIV(addr - 128, 16), MOD(DIV(addr, 4), 4), loc, freq)
    else if addr == 1020 then Float32(if FrontFacing() then 0xffffffff else 0x00000000)
    else if addr == 736 | addr == 740 then PointCoord(MOD(DIV(addr, 4), 2))
    else if addr == 96 & Stage() == 4 & GeometryOk() then Float32(PrimitiveId())
    else if addr == 100 & Stage() == 4 then Float32(LayerIn())
    else throw(Unsupported("IPA of attribute 0x%x", addr));
R_write(Dst(), Bits32(v))

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.