HSET2

Floating point instructions

fixed bit field field the encoding fixes should be

HSET2 (reg)

6362616059585756555453525150494847464544434241403938373635343332
0101110100011
313029282726252423222120191817161514131211109876543210
Rbpred.notpredRaRd

bits 63:48: 0101 1101 0001 1---

Runs execute_HSET2 with Form() 0.

HSET2 (cbuf)

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

bits 63:48: 0111 110- 1--- ----

Runs execute_HSET2 with Form() 1.

HSET2 (imm)

6362616059585756555453525150494847464544434241403938373635343332
0111110imm.sign0imm
313029282726252423222120191817161514131211109876543210
immpred.notpredRaRd

bits 63:48: 0111 110- 0--- ----

Runs execute_HSET2 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
[56]56execute_HSET2
lhs48:47execute_HSET2
test46:45execute_HSET2
lhs44execute_HSET2
lhs43execute_HSET2
predicate42execute_HSET2
predicate41:39execute_HSET2
[31]31execute_HSET2
[30]30execute_HSET2
rhs29:28execute_HSET2
Rb27:20RegB()
pred.not19the decoder
pred18:16the decoder
Ra15:8RegA()
Rd7:0Dst()

Operation Sail

HSET2: each half pair compared (35-38, else 49-52), combined with the predicate at 39, as 1.0 (49, else 53) or all ones in its half

let f = Form();
let raw_b = if f == 0 then R_read(RegB()) else if f == 1 then CbufWord() else HalfImmediate();
let lhs = HalfPairMod(HalfPairOf(R_read(RegA()), UInt(Field(47, 2))), UInt(Field(44, 1)), UInt(Field(43, 1)));
let rhs = HalfPairMod(HalfPairOf(raw_b, if f == 0 then UInt(Field(28, 2)) else if f == 1 then 1 else 0),
                      if f == 0 then UInt(Field(30, 1)) else 0,
                      if f == 0 then UInt(Field(31, 1)) else if f == 1 then UInt(Field(56, 1)) else 0);
let predicate = PredRead(UInt(Field(39, 3)), UInt(Field(42, 1)));
let compare = UInt(Field(if f == 0 then 35 else 49, 4));
let truth = if Field(if f == 0 then 49 else 53, 1) == 0b1 then 15360 else 65535; /* 0x3c00, 0xffff */
var result : bits(32) = 0x00000000;
foreach (lane from 0 to 1) {
    let left = Half2At(lhs, lane);
    let right = Half2At(rhs, lane);
    let test0 = FCompare(compare, left, right);
    let test = Combine53(UInt(Field(45, 2)), test0, predicate);
    let bits = RawSelect(test, to_bits(32, truth * 65536 ^ lane), 0x00000000);
    result = result | bits
};
R_write(Dst(), result)

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