HADD2

Floating point

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
[78]sumswa
6362616059585756555453525150494847464544434241403938373635343332
swb
313029282726252423222120191817161514131211109876543210
RaRdpred.notpredform000110000

bits 15:0: ---- 0010 0011 0000
bits 15:0: ---- 0100 0011 0000
bits 15:0: ---- 0110 0011 0000
bits 15:0: ---- 1000 0011 0000
bits 15:0: ---- 1010 0011 0000
bits 15:0: ---- 1100 0011 0000
bits 15:0: ---- 1110 0011 0000

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
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
7 (111)Rb at 64URc at 32

Runs execute_HADD2.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
[78]78execute_HADD2
sum77execute_HADD2
swa75:74execute_HADD2
swb61:60execute_HADD2
Ra31:24the decoder
Rd23:16the decoder
pred.not15the decoder
pred14:12the decoder
form11:9the decoder

Operation Sail

HADD2: two halves added, bit 77 saturate, 78 a float result, 80 FTZ. .F32 (bit 78): the low half's sum as a float, as ptxas's HADD2.F32 R, -RZ, R.H0_H0 widens a half

let swa = UInt(Field(74, 2));
let swb = if SrcIsImm(Second) then 0 else UInt(Field(60, 2));
let va = HalfPair(A, swa, SrcAbs(A), SrcNeg(A), "HADD2");
let vb = HalfPair(Second, swb, SrcAbs(Second), SrcNeg(Second), "HADD2");
let s0 = NoContract2(Half2Add(va, vb));
let sum = if Field(77, 1) == 0b1 then Half2Clamp01(s0) else s0;
if Field(78, 1) == 0b1 then D_write(Bits32(Half2At(sum, 0))) else D_write(PackHalf(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.