FSWZADD

Floating point

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
[90:72]b
6362616059585756555453525150494847464544434241403938373635343332
swizzle
313029282726252423222120191817161514131211109876543210
aRdpred.notpred100000100010

bits 15:0: ---- 1000 0010 0010

Runs execute_FSWZADD.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
[90:72]90:72execute_FSWZADD
b71:64execute_FSWZADD
swizzle39:32execute_FSWZADD
a31:24execute_FSWZADD
Rd23:16the decoder
pred.not15the decoder
pred14:12the decoder

Operation Sail

FSWZADD: a at 24, b at 64, the swizzle at 32-39. Each lane of a quad does the mode in its two bits of the swizzle, lane L's at bits 6 - 2L (lane 0 the upper left), as Maxwell's FSWZADD: a + b (0), b - a (1), a - b (2) or b (3). CuAssembler's sm_86 names show the order: 0xcc is ZPPPZPPP, b alone in lanes 0 and 2. Bit 77 is NDV, which changes nothing computed. The other bits are refused

if (Field(72, 19) & not_vec(0b0000000000000100000)) != 0b0000000000000000000 then
    throw(Unsupported("FSWZADD with modifiers 0x%x", Field(72, 19)));
let swizzle = Field(32, 8);
let a = Float32(R_read(UInt(Field(24, 8))));
let b = Float32(R_read(UInt(Field(64, 8))));
Capability(61);
let lane = NativeLane() & 0x00000003;
let shift = 0x00000006 - (lane << 1);
let mode = (ZeroExtend(swizzle, 32) >> shift) & 0x00000003;
let x = if mode == 0x00000001 then FNeg(a) else a;
let y = if mode == 0x00000002 then FNeg(b) else b;
let sum = NoContract(FAdd(x, y));
D_write(Bits32(if mode == 0x00000003 then b else sum))

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.