LOP3

Integer, logic, video and predicate instructions

fixed bit field field the encoding fixes should be

LOP3 (reg)

6362616059585756555453525150494847464544434241403938373635343332
0101101111100
313029282726252423222120191817161514131211109876543210
Rbpred.notpredRaRd

bits 63:48: 0101 1011 1110 0---

Runs execute_LOP3 with Form() 0.

LOP3 (cbuf)

6362616059585756555453525150494847464544434241403938373635343332
0000001cbuf.bankcbuf.offset
313029282726252423222120191817161514131211109876543210
cbuf.offsetpred.notpredRaRd

bits 63:48: 0000 001- ---- ----

Runs execute_LOP3 with Form() 1.

LOP3 (imm)

6362616059585756555453525150494847464544434241403938373635343332
001111imm.signimm
313029282726252423222120191817161514131211109876543210
immpred.notpredRaRd

bits 63:48: 0011 11-- ---- ----

Runs execute_LOP3 with Form() 2.

Fields

The operation reads some of these fields in some forms alone (it chooses by Form()), so the diagrams show only the decoder's.

FieldBitsFrom
value55:48execute_LOP3
[50:48]50:48execute_LOP3
[47]47execute_LOP3
third46:39execute_LOP3
[37:36]37:36execute_LOP3
value35:28execute_LOP3
Rb27:20the right operand
pred.not19the decoder
pred18:16the decoder
Ra15:8RegA()
Rd7:0Dst()

Operation Sail

LOP3: the truth table (28-35 for the register form, else 48-55) of a, b and c, as the fewest operations that make it (lut3.sail); .CC (47) with .X (38 for the register form, 56 for the constant's, 57 for the immediate's); the register form's predicate at 48 by the mode at 36-37 as LOP's

let f = Form();
let first = R_read(RegA());
let second = RightOf(f);
let third = R_read(UInt(Field(39, 8)));
let value = Lut3(if f == 0 then Field(28, 8) else Field(48, 8), first, second, third);
R_write(Dst(), value);
if Field(47, 1) == 0b1 then FlagsLogicExtended(value, UInt(Field(if f == 0 then 38 else if f == 1 then 56 else 57, 1)));
if f == 0 & UInt(Field(48, 3)) < 7 then PredWrite(UInt(Field(48, 3)), LopPredicate(value, UInt(Field(36, 2))))

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 Eden's maxwell.inc (GPL-2.0-or-later).