R2P

Integer, logic, video and predicate instructions

fixed bit field field the encoding fixes should be

R2P (reg)

6362616059585756555453525150494847464544434241403938373635343332
0101110011110
313029282726252423222120191817161514131211109876543210
Rbpred.notpredRa

bits 63:48: 0101 1100 1111 0---

Runs execute_R2P with Form() 0.

R2P (cbuf)

6362616059585756555453525150494847464544434241403938373635343332
0100110011110cbuf.bankcbuf.offset
313029282726252423222120191817161514131211109876543210
cbuf.offsetpred.notpredRa

bits 63:48: 0100 1100 1111 0---

Runs execute_R2P with Form() 1.

R2P (imm)

6362616059585756555453525150494847464544434241403938373635343332
0011100imm.sign11110imm
313029282726252423222120191817161514131211109876543210
immpred.notpredRa

bits 63:48: 0011 100- 1111 0---

Runs execute_R2P 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
source42:41execute_R2P
flags40execute_R2P
Rb27:20the right operand
pred.not19the decoder
pred18:16the decoder
Ra15:8RegA()

Operation Sail

R2P: the predicates P0-P6 (or with bit 40 the flags) of a's bits of the byte at 41-42, where the mask has them

let source0 = R_read(RegA());
let source = if Field(41, 2) != 0b00 then source0 >> to_bits(32, UInt(Field(41, 2)) * 8) else source0;
let mask = RightOf(Form());
let flags = Field(40, 1) == 0b1;
foreach (p from 0 to (if flags then 3 else 6)) {
    let enabled = (mask & to_bits(32, 2 ^ p)) != 0x00000000;
    let bit = source & to_bits(32, 2 ^ p);
    R2PSet(p, if flags then 1 else 0, enabled, bit != 0x00000000)
}

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).