fnmul

Floating-Point Negated Multiply (Scalar)

FNMUL <Hd|Sd|Dd>, <Hn|Sn|Dn>, <Hm|Sm|Dm>

Calculates -(Vn * Vm).

Details

Floating-Point Negated Multiply computes the negation of the product of two floating-point values: -(Vn × Vm), writing the result to Vd. Supports half-precision (type=0, 16-bit), single-precision (type=1, 32-bit), and double-precision (type=2, 64-bit) operands. FPSR exception flags may be set based on invalid, inexact, or overflow conditions. This instruction executes only in AArch64 state.

Pseudocode Operation

if type == 0:
  Vd ← -(Vn_float16 × Vm_float16)
else if type == 1:
  Vd ← -(Vn_float32 × Vm_float32)
else if type == 2:
  Vd ← -(Vn_float64 × Vm_float64)

Example

FNMUL Dd, Dn, Dm

Encoding

Binary Layout
0
0
0
11110
00
1
Rm
1
00010
Rn
Rd
 
Format FP Data Processing
Opcode 0x1E208800
Extension Floating Point

Operands

  • Vd
    Destination SIMD/FP vector register
  • Vn
    First source SIMD/FP vector register
  • Vm
    Second source SIMD/FP vector register

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x1EE08800 FNMUL <Hd>, <Hn>, <Hm> A64 0 | 0 | 0 | 11110 | 11 | 1 | Rm | 1 | 00010 | Rn | Rd
0x1E208800 FNMUL <Sd>, <Sn>, <Sm> A64 0 | 0 | 0 | 11110 | 00 | 1 | Rm | 1 | 00010 | Rn | Rd
0x1E608800 FNMUL <Dd>, <Dn>, <Dm> A64 0 | 0 | 0 | 11110 | 01 | 1 | Rm | 1 | 00010 | Rn | Rd

Description

Floating-point Multiply-Negate (scalar). This instruction multiplies the floating-point values of the two source SIMD&FP registers, and writes the negation of the result to the destination SIMD&FP register. This instruction can generate a floating-point exception. Depending on the settings in FPCR, the exception results in either a flag being set in FPSR, or a synchronous exception being generated. For more information, see Floating-point exception traps. Depending on the settings in the CPACR_EL1, CPTR_EL2, and CPTR_EL3 registers, and the current Security state and Exception level, an attempt to execute the instruction might be trapped.

Operation

CheckFPEnabled64();
bits(esize) operand1 = V[n, esize];
bits(esize) operand2 = V[m, esize];

boolean merge = IsMerging(FPCR);
bits(128) result = if merge then V[n, 128] else Zeros(128);

bits(esize) product = FPMul(operand1, operand2, FPCR);
product = FPNeg(product, FPCR);
Elem[result, 0, esize] = product;

V[d, 128] = result;