FREM
Operation
Computes the destination remainder using a nearest-even integral quotient.
Assembler Syntax
FREM.{S|D}(z) <ea>(e), Fn(d)
FREM.{S|D}(z) Fn(s), Fn(d)
Privilege
Unprivileged
Required CPUID flags
FP
Repeat eligibility
REP eligible
Computes and writes the IEEE floating-point remainder to the destination using a quotient rounded to the nearest integer with ties to even.
After DAZ processing, let \(x\) be the original destination and \(y\) the source. For finite valid operands, choose \(q\) as \(x/y\) rounded to the nearest integer with ties to even and compute $\(r = x - qy\)$ with exact intermediate arithmetic. A zero result has the sign of \(x\).
A signaling NaN generates NV; a NaN input produces the selected quiet NaN. Infinite \(x\) or zero \(y\) generates NV and produces the architectural default quiet NaN. Infinite \(y\) with finite \(x\) returns \(x\). An enabled floating-point exception condition raises the FLOATING_POINT_EXCEPTION architectural event before the destination write.
2.75in
Encodings
FREM.{S|D}(z) <ea>(e), Fn(d)
Format: Instruction format for FREM.{S|D}(z) <ea>(e), Fn(d)
2.75in FREM.{S|D}(z) Fn(s), Fn(d)
Format: Instruction format for FREM.{S|D}(z) Fn(s), Fn(d)