LEA

Integer

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
CarryIn(87)CarryIn(87)p[80]shiftx[72]
6362616059585756555453525150494847464544434241403938373635343332
313029282726252423222120191817161514131211109876543210
RaRdpred.notpredform000010001

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

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

IMAD.HI (0x027): CuAssembler sm_86 (0x827 its immediate form)

Runs execute_LEA.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
CarryIn(87)90CarryIn(87)
CarryIn(87)89:87CarryIn(87)
p83:81execute_LEA
[80]80execute_LEA
shift79:75execute_LEA
x74execute_LEA
[72]72execute_LEA
Ra31:24the decoder
Rd23:16the decoder
pred.not15the decoder
pred14:12the decoder
form11:9the decoder

Operation Sail

LEA and ULEA: (a << shift) + b, with .HI (80) the high word of (c:a) << shift, bit 72 the shifted value negated, the carry out in the predicate at 81 and .X (74) the carry in at 87

let shift = UInt(Field(75, 5));
let p = UInt(Field(81, 3));
let x = Field(74, 1) == 0b1;
let a = SrcBits(A);
var shifted : bits(32) = if Field(80, 1) == 0b1 then
                             (if shift != 0 then (SrcBits(C) << shift) | (a >> (32 - shift)) else SrcBits(C))
                         else a << shift;
if Field(72, 1) == 0b1 then { shifted = 0x00000000 - shifted };
if p >= PT & not_bool(x) then D_write(shifted + SrcInt(B)) else {
    var sum : bits(64) = ZeroExtend(shifted, 64) + ZeroExtend(SrcInt(B), 64);
    if x then { sum = sum + CarryIn(87) };
    D_write(sum[31 .. 0]);
    PredWrite(p, 0 < UInt(sum[63 .. 32]), Uniform())
}

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.