abs.d

Floating-point absolute value (double precision)

Sets $f2 to the absolute value of $f4 (double-precision).

Forms

  • abs.d ,

Operands

$f2
An even-numbered floating-point register, $f0 to $f30. A double-precision value uses this register and the next odd-numbered register.
$f4
An even-numbered floating-point register holding a double. It may be the same register as $f2.

Both register numbers must be even. Works by clearing the sign bit of the high word.

.data
value: .double -1.5
.text
# Apply abs.d to -1.5; inspect $f6:$f7 for 1.5 (raw bits 0x3FF8000000000000).
l.d $f2, value
abs.d $f6, $f2