FMNMX

Floating point instructions

fixed bit field field the encoding fixes should be

FMNMX (reg)

6362616059585756555453525150494847464544434241403938373635343332
0101110001100
313029282726252423222120191817161514131211109876543210
Rbpred.notpredRaRd

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

Runs execute_FMNMX with Form() 0.

FMNMX (cbuf)

6362616059585756555453525150494847464544434241403938373635343332
0100110001100
313029282726252423222120191817161514131211109876543210
pred.notpredRaRd

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

Runs execute_FMNMX with Form() 1.

FMNMX (imm)

6362616059585756555453525150494847464544434241403938373635343332
001110001100
313029282726252423222120191817161514131211109876543210
pred.notpredRaRd

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

Runs execute_FMNMX 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
right49execute_FMNMX
left48execute_FMNMX
left46execute_FMNMX
right45execute_FMNMX
choose_min42execute_FMNMX
choose_min41:39execute_FMNMX
Rb27:20RegB()
pred.not19the decoder
pred18:16the decoder
Ra15:8RegA()
Rd7:0Dst()

Operation Sail

FMNMX: the minimum of a and b where the predicate at 39 holds, else the maximum; a NaN gives the other operand

let f = Form();
let left0 = R_readF(RegA());
let right0 = if f == 1 then CbufF() else if f == 2 then Imm20F() else R_readF(RegB());
let left = FloatMod(left0, UInt(Field(46, 1)), UInt(Field(48, 1)));
let right = FloatMod(right0, UInt(Field(49, 1)), UInt(Field(45, 1)));
let is_left_nan = FIsNaN(left);
let is_right_nan = FIsNaN(right);
let choose_min = PredRead(UInt(Field(39, 3)), UInt(Field(42, 1)));
let value = MinMaxF(choose_min, left, right);
let v1 = if is_right_nan then left else value;
R_writeF(Dst(), if is_left_nan then right else v1)

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